Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / DataManager.java @ 29326

History | View | Annotate | Download (5.45 KB)

1
package org.gvsig.fmap.dal;
2

    
3
import java.util.List;
4

    
5
import org.gvsig.fmap.dal.exception.InitializeException;
6
import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
7
import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
8
import org.gvsig.fmap.dal.feature.FeatureIndex;
9
import org.gvsig.fmap.dal.feature.spi.index.FeatureIndexProvider;
10
import org.gvsig.fmap.dal.resource.ResourceManager;
11
import org.gvsig.tools.evaluator.Evaluator;
12

    
13
/**
14
 * There are two top level management roles within DAL: data access and resource management.
15
 *
16
 * This class is responsible of the data access management role. It provides ways
17
 * for registering and instantiating {@link DataServerExplorer}(s), {@link DataStore}(s),
18
 * {@link Evaluator}(s) and {@link FeatureIndex}(es).
19
 *
20
 * @see ResourceManager
21
 *
22
 */
23

    
24
public interface DataManager {
25

    
26
        /**
27
         * Returns the default DAL's temporary directory
28
         *
29
         * @return Temporary directory name
30
         */
31
        public String getTemporaryDirectory();
32

    
33
        /*
34
         * ====================================================================
35
         *
36
         * Store related services
37
         */
38

    
39
        /**
40
         * Creates, initializes and returns an instance of DataStoreParameters given
41
         * the name with which their provider is registered.
42
         *
43
         * @param name
44
         *            provider name
45
         *
46
         * @throws InitializeException
47
         *
48
         * @throws ProviderNotRegisteredException
49
         **/
50
        public DataStoreParameters createStoreParameters(String name)
51
                        throws InitializeException, ProviderNotRegisteredException;
52

    
53
        /**
54
         *
55
         * Creates, initializes and returns an instance of DataStore given the
56
         * DataStoreParameters.
57
         *
58
         * @param parameters
59
         *            parameters used to instantiate and initialize the DataStore
60
         * 
61
         * @throws InitializeException
62
         *
63
         * @throws ProviderNotRegisteredException
64
         * @throws ValidateDataParametersException
65
         **/
66
        public DataStore createStore(DataStoreParameters parameters)
67
                        throws InitializeException, ProviderNotRegisteredException,
68
                        ValidateDataParametersException;
69

    
70
        /**
71
         * Returns a list of Strings containing the names of all available DataStore
72
         * providers.
73
         *
74
         * @return list of String containing available DataStore provider names
75
         */
76
        public List getStoreProviders();
77

    
78
        /*
79
         * ====================================================================
80
         *
81
         * Explorer related services
82
         */
83
        /**
84
         * Returns an instance of {@link DataServerExplorerParameters} corresponding to
85
         * the given name.
86
         *
87
         * @param name
88
         *            name of a registered server explorer provider
89
         *
90
         * @throws InitializeException
91
         *                         if parameter initialization causes an error.
92
         *
93
         * @throws ProviderNotRegisteredException
94
         *                         if could not find a provider by the given name.
95
         *
96
         **/
97
        public DataServerExplorerParameters createServerExplorerParameters(
98
                        String name)
99
                        throws InitializeException, ProviderNotRegisteredException;
100

    
101
        /**
102
         * Returns an instance of {@link DataServerExplorer} given its parameters.
103
         *
104
         * @param parameters
105
         *            parameters used to instantiate and initialize the
106
         *            {@link DataServerExplorer}.
107
         *
108
         * @return an instance of {@link DataServerExplorer}.
109
         *
110
         * @throws InitializeException
111
         * 
112
         * @throws ProviderNotRegisteredException
113
         * @throws ValidateDataParametersException
114
         */
115
        public DataServerExplorer createServerExplorer(
116
                        DataServerExplorerParameters parameters)
117
                        throws InitializeException, ProviderNotRegisteredException,
118
                        ValidateDataParametersException;
119

    
120
        /**
121
         * Returns a list of String containing the names of the available
122
         * DataServerExplorer providers.
123
         *
124
         * @return list of String containing the names of the available
125
         *         DataServerExplorer providers.
126
         */
127
        public List getExplorerProviders();
128

    
129
        /*
130
         * ====================================================================
131
         *
132
         * Expression evaluation related services
133
         */
134

    
135
        /**
136
         * Registers the default expression evaluator. It is used by DAL to evaluate
137
         * and resolve query filters and expressions.
138
         *
139
         * @param evaluator
140
         *            Class that will be called to evaluate the expression. It must
141
         *            implement {@link Evaluator}.
142
         */
143
        public void registerDefaultEvaluator(Class evaluator);
144

    
145
        /**
146
         * Creates an instance of Evaluator that represents the given expression.
147
         *
148
         * @param expression
149
         *            String containing a CQL expression.
150
         * @return instance of Evaluator representing the given expression.
151
         * @throws InitializeException
152
         */
153
        public Evaluator createExpresion(String expression)
154
                        throws InitializeException;
155

    
156
        /*
157
         * ====================================================================
158
         *
159
         * Index related services
160
         */
161

    
162

    
163
        /**
164
         * Returns a list of String containing the names of the available index providers.
165
         *
166
         * @return
167
         *                 list of strings with the names of the available index providers
168
         */
169
        public List getFeatureIndexProviders();
170

    
171
        /**
172
         * Sets the default DataIndexProvider for the given data type.
173
         *
174
         * @param dataType
175
         *                                 one of the data types defined in {@link DataTypes}.
176
         * @param name
177
         *                         Provider's name
178
         */
179
    public void setDefaultFeatureIndexProviderName(int dataType, String name);
180

    
181
        /**
182
         * Returns the default DataIndexProvider name, given a data type. Data types
183
         * are defined in {@link DataTypes}.
184
         *
185
         * @param dataType
186
         *            one of the constants in {@link DataTypes}.
187
         *
188
         * @return
189
         *                 the name of the default {@link FeatureIndexProvider} if there is
190
         *                 anyone available for the given data type.
191
         */
192
    public String getDefaultFeatureIndexProviderName(int dataType);
193

    
194

    
195
}