Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / spi / DataManagerProviderServices.java @ 40559

History | View | Annotate | Download (5.13 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/*
25
 * AUTHORS (In addition to CIT):
26
 * 2008 IVER T.I. S.A.   {{Task}}
27
 */
28

    
29
package org.gvsig.fmap.dal.spi;
30

    
31
import org.gvsig.fmap.dal.DataManager;
32
import org.gvsig.fmap.dal.DataServerExplorerParameters;
33
import org.gvsig.fmap.dal.DataStoreParameters;
34
import org.gvsig.fmap.dal.DataStoreProviderFactory;
35
import org.gvsig.fmap.dal.DataTypes;
36
import org.gvsig.fmap.dal.exception.DataException;
37
import org.gvsig.fmap.dal.exception.InitializeException;
38
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
39
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor;
40
import org.gvsig.fmap.dal.feature.FeatureStore;
41
import org.gvsig.fmap.dal.feature.FeatureType;
42
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProvider;
43
import org.gvsig.fmap.dal.feature.spi.cache.FeatureCacheProviderFactory;
44
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProviderServices;
45
import org.gvsig.tools.dynobject.DynObject;
46

    
47

    
48
/**
49
 * Inteface of DataManager of Services for data providers
50
 *
51
 * @author jmvivo
52
 *
53
 */
54
public interface DataManagerProviderServices extends DataManager {
55

    
56
        public void registerStoreProvider(String name,
57
                        Class dataStoreProviderClass,
58
                        Class parametersClass);
59
        
60
        /**
61
         * Registers a store factory. 
62
         * @param name
63
         * @param dataStoreProviderClass
64
         * @param factoryClass
65
         */
66
        public void registerStoreFactory(String name,
67
                        Class storeFactoryClass);
68

    
69
        /**
70
         * Register a new provider of data server explorer
71
         *
72
         * FIXME
73
         *
74
         * @param <code>name</code> of de provider
75
         * @param dataSourceClass
76
         *            class of provider
77
         * @param parametersClass
78
         *            parameters class of provider
79
         */
80
        public void registerExplorerProvider(String name,
81
                        Class dataSourceClass, Class parametersClass);
82

    
83

    
84
    /**
85
     * Registers a new feature index provider.
86
     *
87
     * @param name
88
     *                         provider's name
89
     *
90
     * @param description
91
     *                         provider's description
92
     *
93
     * @param clazz
94
     *                         a custom FeatureIndexProvider implementation
95
     *
96
     * @param dataType
97
     *                         one of the constants in {@link DataTypes}. This means that this provider
98
     *                         can build indexes based on attributes of this type.
99
     */
100
        public void registerFeatureIndexProvider(String name, String description, Class clazz, int dataType);
101

    
102
        /**
103
         * Returns a DataIndexProvider compatible with the attribute data type.
104
         *
105
         * @param store
106
         *            associated FeatureStore
107
         * @param type
108
         *            associated FeatureType
109
         * @param attr
110
         *            associated FeatureAttributeDescriptor
111
         * @param providerNames
112
         *            array of strings containing one or more preferred providers
113
         * @return empty DataIndexProvider, initialized and ready to use
114
         */
115
        public FeatureIndexProviderServices createFeatureIndexProvider(String name, FeatureStore store, FeatureType type,
116
                        String indexName,
117
                        FeatureAttributeDescriptor attr) throws InitializeException,
118
                        ProviderNotRegisteredException;
119

    
120
         /**
121
     * Registers a new cache provider.
122
     *
123
     * @param name
124
     *                         provider's name
125
     *
126
     * @param description
127
     *                         provider's description
128
     *
129
     * @param clazz
130
     *                         a custom FeatureCacheProvider implementation
131
     */
132
         public void registerFeatureCacheProvider(FeatureCacheProviderFactory providerFactory);
133
                    
134
         /**
135
          * Creates a FeatureCacheProvider from a name and the parameters to configure 
136
          * its data server explorer. The cache provider creates new stores using the
137
          * {@link DataServerExplorerParameters}.
138
          * @param name provider's name.                   
139
          * @param parameters parameters used to create a explorer.
140
          * @return A cache provider
141
          * @throws DataException
142
          */
143
         public FeatureCacheProvider createFeatureCacheProvider(String name, DynObject parameters) throws DataException;
144

    
145

    
146
         /**
147
          *
148
          * Creates a new instance of the provider associated to the passed parameters.
149
          * 
150
          * @param store
151
          * @param parameters
152
          * @return
153
          * @throws InitializeException
154
          * @throws ProviderNotRegisteredException
155
          */
156
         public DataStoreProvider createProvider(DataStoreProviderServices providerServices, DataStoreParameters parameters) throws InitializeException, ProviderNotRegisteredException;         
157

    
158
         public void registerStoreProviderFactory(DataStoreProviderFactory factory);
159

    
160
}