Statistics
| Revision:

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

History | View | Annotate | Download (4.51 KB)

1
package org.gvsig.fmap.dal;
2

    
3
import java.util.List;
4

    
5
import org.gvsig.fmap.dal.exceptions.InitializeException;
6
import org.gvsig.fmap.dal.exceptions.ProviderNotRegisteredException;
7
import org.gvsig.fmap.dal.resource.ResourceManager;
8
import org.gvsig.tools.evaluator.Evaluator;
9

    
10
/**
11
 * This class contains the main DAL specific services. It provides functionality for 
12
 * registering and instantiating DataExplorer(s), DataStore(s), Evaluator(s) and FeatureIndex(es).
13
 * 
14
 * (note that resource management is {@link ResourceManager}'s responsibility)
15
 *
16
 */
17

    
18
public interface DataManager {
19

    
20
    /**
21
         * Returns the default DAL's temporary directory
22
         * 
23
         * @return Temporary directory name
24
         */
25
        public String getTemporaryDirectory();
26

    
27
        /*
28
         * ====================================================================
29
         *
30
         * Store related services
31
         */
32

    
33
        /**
34
         * Creates, initializes and returns an instance of DataStoreParameters given the name with which 
35
         * their provider is registered.
36
         *
37
         * @param String
38
         *            provider name
39
         * @throws InitializeException
40
         *             
41
         * @throws ProviderNotRegisteredException
42
         **/
43
        public DataStoreParameters createStoreParameters(String name)
44
                        throws InitializeException, ProviderNotRegisteredException;
45

    
46
        /**
47
         * 
48
         * Creates, initializes and returns an instance of DataStore given the DataStoreParameters.
49
         *
50
         * @param DataStoreParameters 
51
         *                                                 parameters used to instantiate and initialize the DataStore
52
         * @throws InitializeException
53
         * 
54
         * @throws ProviderNotRegisteredException
55
         **/
56
        public DataStore createStore(DataStoreParameters parameters)
57
                        throws InitializeException, ProviderNotRegisteredException;
58

    
59

    
60
        /**
61
         * Returns a list of Strings containing the names of all available 
62
         * DataStore providers.
63
         * 
64
         * @return list of String containing available DataStore provider names
65
         */
66
        public List getStoreProviders();
67

    
68
        /*
69
         * ====================================================================
70
         *
71
         * Explorer related services
72
         */
73
        /**
74
         * Start a instance with solicited parameters starts name in the instance
75
         * and returns it.
76
         *
77
         * @param String
78
         *            name
79
         * @throws InitializeException
80
         * @throws ProviderNotRegisteredException
81
         **/
82
        public DataExplorerParameters createExplorerParameters(
83
                        String name)
84
                        throws InitializeException, ProviderNotRegisteredException;
85

    
86
        /**
87
         * 
88
         * @param parameters
89
         * @return
90
         * @throws InitializeException
91
         * @throws ProviderNotRegisteredException
92
         */
93
        public DataExplorer createExplorer(
94
                        DataExplorerParameters parameters)
95
                        throws InitializeException, ProviderNotRegisteredException;
96

    
97

    
98
        /**
99
         * Returns a list of String containing the names of the available DataExplorer providers.
100
         * 
101
         * @return list of String containing the names of the available DataExplorer providers.
102
         */
103
        public List getExplorerProviders();
104

    
105
        /*
106
         * ====================================================================
107
         * 
108
         * Expression evaluation related services
109
         */
110

    
111
        /**
112
         * Registers the default expression evaluator. It is used by DAL to evaluate and resolve 
113
         * query filters and expressions.
114
         * 
115
         * @param evaluator 
116
         *                         Class that will be called to evaluate the expression. It must implement {@link Evaluator}.
117
         */
118
        public void registerDefaultEvaluator(Class evaluator);
119

    
120
        /**
121
         * Creates an instance of Evaluator that represents the given expression.
122
         * 
123
         * @param expresion String containing a CQL expression.
124
         * @return instance of Evaluator representing the given expression.
125
         * @throws InitializeException
126
         */
127
        public Evaluator createExpresion(String expresion)
128
                        throws InitializeException;
129

    
130
        /*
131
         * ====================================================================
132
         * 
133
         * Index related services
134
         */
135

    
136

    
137
        /**
138
         * Returns a list of String containing the names of the available index providers.
139
         *
140
         * @return list of strings with the names of the available index providers
141
         */
142
        public List getFeatureIndexProviders();
143

    
144
        /**
145
         * Sets the default DataIndexProvider for the given data type.
146
         * @param dataType one of the data types defined in the api package
147
         * @param name Provider's name
148
         */
149
    public void setDefaultFeatureIndexProviderName(int dataType, String name);
150

    
151
    /**
152
     * Returns the default DataIndexProvider name, given a data type. Data types are defined in {@link DataTypes}.
153
     * 
154
     * @param dataType, one of the constants in {@link DataTypes}. 
155
     * @return An instance of DataIndexProvider if there is anyone available for the given data type.
156
     */
157
    public String getDefaultFeatureIndexProviderName(int dataType);
158

    
159

    
160
}