Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / DataManager.java @ 23867

History | View | Annotate | Download (6.5 KB)

1
package org.gvsig.fmap.data;
2

    
3
import org.gvsig.fmap.data.exceptions.InitializeException;
4
import org.gvsig.fmap.data.exceptions.NotResgisteredStore;
5
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor;
6
import org.gvsig.fmap.data.feature.FeatureStore;
7
import org.gvsig.fmap.data.feature.FeatureType;
8
import org.gvsig.fmap.data.feature.spi.DataIndexProvider;
9
import org.gvsig.tools.evaluator.Evaluator;
10
import org.gvsig.tools.operations.Operation;
11

    
12
import com.iver.utiles.XMLEntity;
13

    
14
public interface DataManager {
15

    
16
        /**
17
         *
18
         * @param String
19
         *            name
20
         * @param Class
21
         *            dataStoreClass
22
         * @param Class
23
         *            parametersClass
24
         */
25

    
26
        public void registerDefaultEvaluator(Class evaluator);
27

    
28
        public Evaluator createExpresion(String expresion);
29

    
30
        public void registerDataStoreProvider(String name, Class dataStoreProviderClass,
31
                        Class parametersClass);
32

    
33
        /**
34
         * Levanta una instancia de los parametros solicitados inicializa el nombre
35
         * en la instancia y la devuelve.
36
         *
37
         * @throws InitializeException
38
         *             TODO
39
         **/
40
        /**
41
         * Start a instance of the solicited parameters inicialize the instance name
42
         * and returns it.
43
         *
44
         * @param String
45
         *            name
46
         * @throws InitializeException
47
         *             TODO
48
         * @throws NotResgisteredStore
49
         **/
50
        public DataStoreParameters createDataStoreParameters(String name)
51
                        throws InitializeException, NotResgisteredStore;
52

    
53
        public DataStoreParameters createDataStoreParameters(
54
                        XMLEntity xmlEntity)
55
                        throws InitializeException, NotResgisteredStore;
56

    
57
        /**
58
         * Levanta la instancia del datasource,
59
         * levanta una instancia del driver que precisa el datasource
60
         * y por ultimo invoca al metodo init del datasource.
61
         * @throws InitializeException
62
         **/
63
        /**
64
         * Start a instance of datasource, start a instance of driver that
65
         * datasource needs at ends invoke datasource init method
66
         *
67
         * @params DataStoreParameters parameters
68
         * @throws InitializeException
69
         * @throws NotResgisteredStore
70
         **/
71
        public DataStore createDataStore(DataStoreParameters parameters)
72
                        throws InitializeException, NotResgisteredStore;
73

    
74
        public DataStore createDataStore(XMLEntity xmlEntity)
75
                        throws InitializeException, NotResgisteredStore;
76

    
77
        /**
78
         * Collection of generic properties of a DataStore type which can access
79
         * without create a DataStore/Driver.
80
         *
81
         * For example for "DriverDataSource.shp" could have the size of the data
82
         * identification.
83
         *
84
         * In "DriverDataSource.postgres" could add information about availables
85
         * tables or things like that. We`ll have to see what GeoDB needs and where
86
         * it can get.
87
         *
88
         * We have to think it good.
89
         */
90
        /**
91
         * @param String name
92
         * @param Class dataSourceClass
93
         * @param Class parametersClass
94
         */
95

    
96
        public void registerDataExplorer(String name,
97
                        Class dataSourceClass, Class parametersClass);
98

    
99
        /**
100
         * Levanta una instancia de los parametros solicitados
101
         * inicializa el nombre en la instancia
102
         * y la devuelve.
103
         * @throws InitializeException TODO
104
         **/
105
        /**
106
         * Start a instance with solicited parameters starts name in the instance
107
         * and returns it.
108
         *
109
         * @param String
110
         *            name
111
         * @throws InitializeException
112
         *             TODO
113
         * @throws NotResgisteredStore
114
         **/
115

    
116
        public DataExplorerParameters createDataExplorerParameters(
117
                        String name)
118
                        throws InitializeException, NotResgisteredStore;
119

    
120
        /**
121
         *
122
         * @param DataExplorerParameters
123
         *            parameters
124
         * @return DataExplorer
125
         * @throws InitializeException
126
         * @throws NotResgisteredStore
127
         */
128

    
129
        public DataExplorerParameters createDataExplorerParameters(
130
                        XMLEntity xmlEntity) throws InitializeException,
131
                        NotResgisteredStore;
132

    
133
        public DataExplorer createDataExplorer(
134
                        DataExplorerParameters parameters)
135
                        throws InitializeException, NotResgisteredStore;
136

    
137
        /**
138
         * 
139
         * @param String
140
         *            name
141
         * @return RegisterInfo
142
         * @throws NotResgisteredStore
143
         */
144

    
145
        public DataExplorer createDataExplorer(XMLEntity xmlEntity)
146
                        throws InitializeException, NotResgisteredStore;
147

    
148
        /**
149
         *
150
         * @param String
151
         *            storeName
152
         * @param String
153
         *            operationName
154
         * @param DataStoreOperation
155
         *            operation
156
         * @return int index
157
         * @throws IllegalArgumentException
158
         */
159

    
160
        public int registerDataStoreOperation(String storeName,
161
                        String operationName, Operation operation);
162

    
163
        /**
164
         *
165
         * @return String[] TYPE_STORE
166
         */
167

    
168
        public String[] getRegistersStores();
169

    
170
        /**
171
         *
172
         * @return String[] TYPE_EXPLORER
173
         */
174

    
175
        public String[] getRegistersExplorers();
176
        
177
        /**
178
         * Returns an array of index provider names that are compatible with
179
         * the given data type.
180
         * 
181
         * @param dataType
182
         * @return list of strings with the names of compatible index providers
183
         */
184
        public String[] getDataIndexProviders(int dataType);
185

    
186
        /**
187
         * Registers a new DataIndexProvider
188
         * @param name identifier
189
         * @param description a brief description of the provider
190
         * @param clazz implementation class
191
         */
192
        public void registerDataIndexProvider(String name, String description, Class clazz);
193
        
194
        /**
195
         * Returns a DataIndexProvider compatible with the attribute data type.
196
         * @param store associated FeatureStore
197
         * @param type associated FeatureType 
198
         * @param attr associated FeatureAttributeDescriptor
199
         * @param providerNames array of strings containing one or more preferred providers
200
         * @return empty DataIndexProvider, initialized and ready to use
201
         */
202
        public DataIndexProvider createDataIndexProvider(FeatureStore store, FeatureType type, 
203
                        FeatureAttributeDescriptor attr, String[] providerNames) throws InitializeException, NotResgisteredStore;
204

    
205
        /**
206
         * Returns the default DataIndexProvider compatible with the attribute data type.
207
         * @param store associated FeatureStore
208
         * @param type associated FeatureType 
209
         * @param attr associated FeatureAttributeDescriptor
210
         * @return
211
         */
212
        public DataIndexProvider createDataIndexProvider(FeatureStore store, FeatureType type,
213
                        FeatureAttributeDescriptor attr) throws InitializeException, NotResgisteredStore;
214
        
215
        /**
216
         * Sets the default DataIndexProvider for the given data type.
217
         * @param dataType one of the data types defined in the api package
218
         * @param name Provider's name
219
         */
220
    public void setDefaultDataIndexProviderName(int dataType, String name);
221
    
222
    /**
223
     * Returns the default DataIndexProvider name, given a data type.
224
     * @param dataType
225
     * @return
226
     */
227
    public String getDefaultDataIndexProviderName(int dataType);
228
   
229
    /**
230
     * Returns the default DAL's temporary directory
231
     * @return Temporary directory name
232
     */
233
    public String getTemporaryDirectory();        
234

    
235
}