svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / DataStore.java @ 23339
History | View | Annotate | Download (5.39 KB)
1 |
package org.gvsig.fmap.data; |
---|---|
2 |
|
3 |
import java.util.Iterator; |
4 |
|
5 |
import org.gvsig.fmap.data.commands.CommandsRecord; |
6 |
import org.gvsig.fmap.data.feature.IsNotFeatureSettingException; |
7 |
import org.gvsig.fmap.data.operation.DataStoreOperationContext; |
8 |
import org.gvsig.fmap.data.operation.DataStoreOperationException; |
9 |
import org.gvsig.fmap.data.operation.DataStoreOperationNotSupportedException; |
10 |
import org.gvsig.metadata.IMetadatable; |
11 |
import org.gvsig.tools.observer.Observable; |
12 |
|
13 |
import com.iver.utiles.IPersistence; |
14 |
import com.iver.utiles.XMLEntity; |
15 |
import com.iver.utiles.XMLException; |
16 |
|
17 |
/**
|
18 |
* <p>This is the basic interface of data sources. DataStore
|
19 |
* offers generic services like:
|
20 |
* <ul>
|
21 |
* <li>Open, close, reject data source</li>
|
22 |
* <li>Access data collections, with the posibility of
|
23 |
* load data in background.</li>
|
24 |
* <li>Use of selection and blocks, as well as data
|
25 |
* collections</li>
|
26 |
* <li>Edition</li>
|
27 |
* <li>Register of events observers through the public
|
28 |
* methoths of Observable interface</li>
|
29 |
* <li>Access to data sources embebed into itself (like GML)</li>
|
30 |
* <li>Information about Spatial Reference Sistems that data
|
31 |
* source use</li>
|
32 |
* </ul>
|
33 |
* </p>
|
34 |
* <br>
|
35 |
* @author
|
36 |
*
|
37 |
*/
|
38 |
public interface DataStore extends Observable, IMetadatable, IPersistence{ |
39 |
|
40 |
public String getName(); |
41 |
|
42 |
/**
|
43 |
* Return the of parameters of this store
|
44 |
*
|
45 |
* @return parameters of this store
|
46 |
*/
|
47 |
public DataStoreParameters getParameters();
|
48 |
|
49 |
public void init(DataStoreParameters parameters) throws InitializeException; |
50 |
public void setXMLEntity(XMLEntity xmlEntity) throws XMLException; |
51 |
|
52 |
/*
|
53 |
* FIXME: Comprobar el valor de retorno de las funciones Deberan de ser booleanas?
|
54 |
*/
|
55 |
/**
|
56 |
* Indica que se va a comenzar a hacer una serie de operaciones sobre el
|
57 |
* origen de datos con la finalidad de que dicho origen de datos se
|
58 |
* prepare (abra el fichero, comience una transaccin, conecte al
|
59 |
* servidor, ...). Abre el fichero de ndices en caso de que exista.
|
60 |
* @throws OpenException
|
61 |
* @throws IsNotFeatureSettingException
|
62 |
*
|
63 |
*/
|
64 |
/**
|
65 |
* Shows that a operation series will start on the data source
|
66 |
* with the finallite that the data source will prepare
|
67 |
* (open file, start transaction, connect to the server, ...)
|
68 |
* Open index file if exists.
|
69 |
* @throws OpenException
|
70 |
* @throws IsNotFeatureSettingException
|
71 |
*
|
72 |
*/
|
73 |
// public void open() throws OpenException;
|
74 |
public void refresh() throws OpenException,InitializeException; |
75 |
|
76 |
/**
|
77 |
* Hace que se cierre el soporte fsico de la capa. Cierra el fichero de
|
78 |
* ndices en caso de que exista.
|
79 |
*
|
80 |
*/
|
81 |
/**
|
82 |
* <p>
|
83 |
* Close the fisic layer souport. Close index file if exists.
|
84 |
* </p>
|
85 |
*
|
86 |
* @throws CloseException
|
87 |
*/
|
88 |
// public void close() throws CloseException;
|
89 |
public void dispose() throws CloseException; |
90 |
|
91 |
/**
|
92 |
*
|
93 |
* @return DataCollection
|
94 |
* @throws ReadException
|
95 |
*/
|
96 |
public DataCollection getDataCollection() throws ReadException; |
97 |
|
98 |
/**
|
99 |
*
|
100 |
* @return DataCollection
|
101 |
*/
|
102 |
|
103 |
public DataCollection getSelection();
|
104 |
|
105 |
/**
|
106 |
*
|
107 |
* @param DataCollection
|
108 |
* selection
|
109 |
* @throws DataException
|
110 |
*/
|
111 |
public void setSelection(DataCollection selection) throws DataException; |
112 |
|
113 |
/**
|
114 |
*
|
115 |
* @return DataCollection
|
116 |
*/
|
117 |
public DataCollection createSelection();
|
118 |
|
119 |
public Iterator getChilds(); // Iterator of DataStore |
120 |
|
121 |
/*
|
122 |
* TODO: Falta comprobar si el tema de edicin lo dejamos aqui o
|
123 |
* volvemos a bajarlo al FeatureStore
|
124 |
*
|
125 |
* FIXME: Comprobar el valor de retorno de las funciones Deberan de ser booleanas?
|
126 |
*/
|
127 |
/**
|
128 |
* return boolean
|
129 |
*/
|
130 |
public boolean isEditable(); |
131 |
|
132 |
/**
|
133 |
* @throws ReadException
|
134 |
*/
|
135 |
public void startEditing() throws ReadException; |
136 |
|
137 |
public void cancelEditing(); |
138 |
|
139 |
/**
|
140 |
*
|
141 |
* @throws WriteException
|
142 |
* @throws ReadException
|
143 |
*/
|
144 |
public void finishEditing() throws WriteException, ReadException; |
145 |
public boolean isEditing(); |
146 |
|
147 |
public void undo(); |
148 |
public void redo(); |
149 |
|
150 |
/**
|
151 |
*
|
152 |
* @return CommandsRecord
|
153 |
*/
|
154 |
public CommandsRecord getCommandsRecord();
|
155 |
|
156 |
public void beginComplexNotification(); |
157 |
public void endComplexNotification(); |
158 |
|
159 |
//Bloqueo en edicin similar a la seleccin
|
160 |
|
161 |
public DataCollection getLocked();
|
162 |
|
163 |
/**
|
164 |
* <p>Blocks the data collection like selection do.</p>
|
165 |
*/
|
166 |
public void setLocked(DataCollection locked); |
167 |
|
168 |
public DataCollection createLocked();
|
169 |
|
170 |
/**
|
171 |
*
|
172 |
* @return DataExplorer
|
173 |
* @throws ReadException
|
174 |
*/
|
175 |
public DataExplorer getExplorer() throws ReadException; |
176 |
|
177 |
/**
|
178 |
*
|
179 |
* @param int code
|
180 |
* @param DataStoreOperationContext
|
181 |
* context
|
182 |
* @return Object
|
183 |
* @throws DataStoreOperationException
|
184 |
* @throws DataStoreOperationNotSupportedException
|
185 |
*/
|
186 |
public Object invokeOperation(int code,DataStoreOperationContext context) throws DataStoreOperationException, DataStoreOperationNotSupportedException; |
187 |
|
188 |
/**
|
189 |
*
|
190 |
* @param String
|
191 |
* name
|
192 |
* @param DataStoreOperationContext
|
193 |
* context
|
194 |
* @return Object
|
195 |
* @throws DataStoreOperationException
|
196 |
* @throws DataStoreOperationNotSupportedException
|
197 |
*/
|
198 |
public Object invokeOperation(String name,DataStoreOperationContext context) throws DataStoreOperationException, DataStoreOperationNotSupportedException; |
199 |
|
200 |
public boolean implementsOperation(int code); |
201 |
public boolean implementsOperation(String name); |
202 |
|
203 |
|
204 |
} |
205 |
|