Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / DataStore.java @ 25570

History | View | Annotate | Download (4.21 KB)

1 24496 jmvivo
package org.gvsig.fmap.dal;
2 23754 jjdelcerro
3
import java.util.Iterator;
4
5 24505 jmvivo
import org.gvsig.fmap.dal.exception.DataException;
6 23754 jjdelcerro
import org.gvsig.metadata.Metadatable;
7 24268 jjdelcerro
import org.gvsig.tools.observer.ComplexWeakReferencingObservable;
8 23754 jjdelcerro
import org.gvsig.tools.observer.Observer;
9 24079 jjdelcerro
import org.gvsig.tools.operations.Operations;
10
import org.gvsig.tools.persistence.Persistent;
11 23754 jjdelcerro
12
/**
13 25481 jiyarza
 * <p>This is the basic interface for all data stores. Depending on the context,
14 24395 jiyarza
 * it can represent a geographic layer, an alphanumeric database table or any data file.
15
 * DataStore offers generic services like:
16 23754 jjdelcerro
 *   <ul>
17 25481 jiyarza
 *     <li>Open, close and reject data stores</li>
18 24395 jiyarza
 *     <li>Access to data sets, with the possibility of loading data
19
 *             in background.</li>
20
 *     <li>Use of selection and locks, as well as data sets</li>
21 25481 jiyarza
 *     <li>Editing</li>
22 24395 jiyarza
 *     <li>Register of event observers through the Observable interface</li>
23 25481 jiyarza
 *     <li>Access to data stores embedded into itself (like GML)</li>
24
 *     <li>Information about the Spatial Reference Systems used by the data store</li>
25 23754 jjdelcerro
 *   </ul>
26
 * </p>
27
 * <br>
28
 *
29
 */
30 25547 jjdelcerro
public interface DataStore extends ComplexWeakReferencingObservable, Persistent,
31
                Operations { // , Metadatable {
32 23754 jjdelcerro
33 24395 jiyarza
        /**
34
         * Returns this store's name.
35
         *
36
         * @return String containing this store's name.
37
         */
38 23754 jjdelcerro
        public String getName();
39
40
        /**
41
         * Return the of parameters of this store
42
         *
43
         * @return parameters of this store
44
         */
45
        public DataStoreParameters getParameters();
46
47
48 24395 jiyarza
        /**
49
         * Refreshes this store state.
50
         *
51
         * @throws DataException
52
         */
53 23772 jjdelcerro
        public void refresh() throws DataException;
54 23754 jjdelcerro
55 24395 jiyarza
        /**
56
         * Frees this store's resources
57
         *
58
         * @throws DataException
59
         */
60 23772 jjdelcerro
        public void dispose() throws DataException;
61 23754 jjdelcerro
62
        /**
63 24395 jiyarza
         * Returns all available data.
64 23754 jjdelcerro
         *
65 24395 jiyarza
         * @return a set of data
66
         * @throws DataException
67
         *             if there is any error while loading the data
68 23754 jjdelcerro
         */
69 23842 jjdelcerro
        DataSet getDataSet() throws DataException;
70 23754 jjdelcerro
71
        /**
72
         * Returns a subset of data taking into account the properties and
73
         * restrictions of the DataQuery.
74
         *
75 24395 jiyarza
         * @param dataQuery
76
         *            defines the properties of the requested data
77
         * @return a set of data
78
         * @throws DataException
79
         *             if there is any error while loading the data
80 23754 jjdelcerro
         */
81 23842 jjdelcerro
        DataSet getDataSet(DataQuery dataQuery) throws DataException;
82 23754 jjdelcerro
83
        /**
84 24395 jiyarza
         * Loads all available data and notifies the observer for each loaded block of data.
85 23754 jjdelcerro
         *
86
         * @param observer
87 24395 jiyarza
         *            to be notified for each block of data loaded
88 23754 jjdelcerro
         * @throws DataException
89 24395 jiyarza
         *             if there is any error while loading the data
90 23754 jjdelcerro
         */
91 23842 jjdelcerro
        void getDataSet(Observer observer) throws DataException;
92 23754 jjdelcerro
93
        /**
94
         * Loads a subset of data taking into account the properties and
95
         * restrictions of the DataQuery. Data loading is performed by calling the
96 24395 jiyarza
         * Observer, once each data block is loaded.
97 23754 jjdelcerro
         *
98 24395 jiyarza
         * @param dataQuery
99
         *            defines the properties of the requested data
100 23754 jjdelcerro
         * @param observer
101 24395 jiyarza
         *            to be notified for each block of data loaded
102 23754 jjdelcerro
         * @throws DataException
103 24395 jiyarza
         *             if there is any error while loading the data
104 23754 jjdelcerro
         */
105 24395 jiyarza
        void getDataSet(DataQuery dataQuery, Observer observer) throws DataException;
106 23754 jjdelcerro
107
        /**
108 24395 jiyarza
         * Returns the selected set of data
109
         *
110
         * @return DataSet
111 23754 jjdelcerro
         */
112
113 23842 jjdelcerro
        public DataSet getSelection() throws DataException;
114 23754 jjdelcerro
115
        /**
116 24395 jiyarza
         * Sets the current data selection with the given data set.
117
         *
118 23842 jjdelcerro
         * @param DataSet
119 23754 jjdelcerro
         *            selection
120
         * @throws DataException
121
         */
122 23842 jjdelcerro
        public void setSelection(DataSet selection) throws DataException;
123 23754 jjdelcerro
124
        /**
125 24395 jiyarza
         * Creates a new selection.
126 23754 jjdelcerro
         *
127 24395 jiyarza
         * @return DataSet that contains the selection
128
         *
129
         * @throws DataException
130 23754 jjdelcerro
         */
131 23842 jjdelcerro
        public DataSet createSelection() throws DataException;
132 23754 jjdelcerro
133 24395 jiyarza
        /**
134
         * Returns an iterator over this store children
135
         *
136
         * @return Iterator over this DataStore children
137
         */
138
        public Iterator getChildren();
139 23754 jjdelcerro
140
        /**
141 24874 jmvivo
         * Returns the DataServerExplorer to which this DataStore belongs, if there is any.
142 24395 jiyarza
         *
143 24874 jmvivo
         * @return DataServerExplorer to which this DataStore belongs, or <code>null</code> if
144
         *                    this was not accessed through any DataServerExplorer.
145 24395 jiyarza
         *
146
         * @throws DataException
147 23754 jjdelcerro
         */
148 24874 jmvivo
        public DataServerExplorer getExplorer() throws DataException;
149 23754 jjdelcerro
150
}