Revision 29289 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/spi/FeatureStoreProvider.java

View differences:

FeatureStoreProvider.java
3 3

  
4 4
import java.util.Iterator;
5 5

  
6
import org.gvsig.fmap.dal.DataTypes;
6 7
import org.gvsig.fmap.dal.exception.DataException;
7 8
import org.gvsig.fmap.dal.exception.InitializeException;
8 9
import org.gvsig.fmap.dal.feature.FeatureLocks;
9 10
import org.gvsig.fmap.dal.feature.FeatureQuery;
10 11
import org.gvsig.fmap.dal.feature.FeatureSelection;
12
import org.gvsig.fmap.dal.feature.FeatureStore;
11 13
import org.gvsig.fmap.dal.feature.FeatureType;
12 14
import org.gvsig.fmap.dal.spi.DataStoreProvider;
13 15
import org.gvsig.fmap.geom.primitive.Envelope;
14
import org.gvsig.tools.persistence.Persistent;
15 16

  
16
public interface FeatureStoreProvider extends Persistent,
17
		DataStoreProvider {
17
public interface FeatureStoreProvider extends DataStoreProvider {
18 18

  
19
	/**
20
	 * Return the name of the provider.
21
	 *
22
	 * @return
23
	 */
19 24
	public String getName();
20 25

  
21 26
	/**
22
	 * Devuelbe un OID valido para una nueva feature.
27
	 * Return a new OID valid for a new feature.
23 28
	 *
24
	 * @return
29
	 * @return a new OID
30
	 * @see {@link FeatureStoreProvider#getOIDType()}
25 31
	 */
26 32
	public Object createNewOID();
27 33

  
28 34
	/**
29
	 * Construye un FeatureData apto para este store
35
	 * Return OID data type (from {@link DataTypes}) of this store.
30 36
	 *
31
	 * @param type
37
	 * @return OID data type
38
	 * @see {@link FeatureStoreProvider#createNewOID()} {@link DataTypes}
39
	 */
40
	public int getOIDType();
41

  
42
	/**
43
	 * Factory of {@link FeatureProvider}. Create a new {@link FeatureProvider} instance
44
	 * valid for this Store.
45
	 *
46
	 * @param {@link FeatureType} of the {@link FeatureProvider}
32 47
	 * @return
33 48
	 * @throws DataException
34 49
	 */
35
	public FeatureData createFeatureData(FeatureType type) throws DataException;
50
	public FeatureProvider createFeatureData(FeatureType type) throws DataException;
36 51

  
37 52
	/**
38
	 * Devuelbe el FeatureData asociado a la referencia pasada.
53
	 * Factory of {@link FeatureSelection}. Create a new
54
	 * {@link FeatureSelection} instance valid for this Store.
39 55
	 *
40
	 * @param reference
41 56
	 * @return
42 57
	 * @throws DataException
43 58
	 */
44
	public FeatureData getFeatureDataByReference(FeatureReferenceProviderServices reference)
45
			throws DataException;
46

  
47 59
	public FeatureSelection createFeatureSelection() throws DataException;
48 60

  
61
	/**
62
	 * Factory of {@link FeatureLocks}. Create a new {@link FeatureLocks}
63
	 * instance valid for this Store.
64
	 *
65
	 *
66
	 * @return {@link FeatureLocks} or <code>null</code> if not
67
	 *         {@link FeatureStoreProvider#isLocksSupported()}
68
	 * @throws DataException
69
	 */
49 70
	public FeatureLocks createFeatureLocks() throws DataException;
50 71

  
51
	public FeatureData getFeatureDataByReference(
72
	/**
73
	 * Factory of {@link FeatureSetProvider}. Create a new
74
	 * {@link FeatureSetProvider} that represents result of {@link FeatureQuery}
75
	 * .
76
	 *
77
	 * @param query
78
	 *            (never will be null)
79
	 * @param featureType
80
	 *            (never will be null)
81
	 * @return
82
	 * @throws DataException
83
	 */
84
	public FeatureSetProvider createSet(FeatureQuery query,
85
			FeatureType featureType) throws DataException;
86

  
87
	/**
88
	 * Return {@link FeatureProvider} from a
89
	 * {@link FeatureReferenceProviderServices} using
90
	 * {@link FeatureStore#getDefaultFeatureType()} as {@link FeatureType}
91
	 *
92
	 * @param reference
93
	 * @return
94
	 * @throws DataException
95
	 */
96
	public FeatureProvider getFeatureDataByReference(FeatureReferenceProviderServices reference)
97
			throws DataException;
98

  
99
	/**
100
	 * Return {@link FeatureProvider} from a
101
	 * {@link FeatureReferenceProviderServices} using <code>featureType</code>
102
	 * as {@link FeatureType}
103
	 *
104
	 * @param reference
105
	 * @return
106
	 * @throws DataException
107
	 */
108
	public FeatureProvider getFeatureDataByReference(
52 109
			FeatureReferenceProviderServices reference, FeatureType featureType)
53 110
			throws DataException;
54

  
111
	/**
112
	 * Informs that store supports write.
113
	 *
114
	 * @return <true> if write is supported
115
	 */
55 116
	public boolean allowWrite();
56 117

  
57
	public boolean canWriteGeometry(int geometryType) throws DataException;
118
	/**
119
	 *Informs that store supports write a geometry.
120
	 *
121
	 * @param geometryType
122
	 * @param geometrySubType
123
	 * @return
124
	 * @throws DataException
125
	 */
126
	public boolean canWriteGeometry(int geometryType, int geometrySubType) throws DataException;
58 127

  
128

  
129
	public interface FeatureTypeChanged {
130
		FeatureType getSource();
131

  
132
		FeatureType getTarget();
133
	}
134

  
59 135
	/**
136
	 * Perform changes on store.
60 137
	 *
61 138
	 * @param deleteds
62 139
	 *            iterator of {@link FeatureReferenceProviderServices}
63 140
	 * @param inserteds
64
	 *            iterator of {@link FeatureData}
141
	 *            iterator of {@link FeatureProvider}
65 142
	 * @param updateds
66
	 *            iterator of {@link FeatureData}
67
	 * @param originalFeatureTypesUpdated
68
	 *            iterator of {@link FeatureType}
143
	 *            iterator of {@link FeatureProvider}
144
	 * @param featureTypesChanged
145
	 *            iterator of {@link FeatureTypeChanged}
146
	 *
69 147
	 * @throws DataException
70 148
	 */
71
	public void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator originalFeatureTypesUpdated) throws DataException;
149
	public void performChanges(Iterator deleteds, Iterator inserteds, Iterator updateds, Iterator featureTypesChanged) throws DataException;
72 150

  
151
	/**
152
	 * Returns this store's total envelope (extent).
153
	 *
154
	 * @return this store's total envelope (extent) or <code>null</code> if
155
	 *         store not have geometry information
156
	 */
73 157
	public Envelope getEnvelope() throws DataException;
74 158

  
75 159
	public FeatureStoreProvider initialize(FeatureStoreProviderServices store)
76 160
			throws InitializeException;
77 161

  
78
	public FeatureSetProvider createSet(FeatureQuery query, FeatureType featureType)
79
			throws DataException;
80

  
162
	/**
163
	 * Informs if store supports locks
164
	 *
165
	 * @return
166
	 */
81 167
	public boolean isLocksSupported();
82 168

  
169
	/**
170
	 * Return {@link FeatureStoreProviderServices} for this store
171
	 *
172
	 * @return
173
	 */
83 174
	public FeatureStoreProviderServices getStoreServices();
84 175

  
85
	public int getFeatureReferenceOIDType();
176
	/**
177
	 * Inform if the store provider supports automatic values for attributues
178
	 * (autonumeric)
179
	 *
180
	 * @return <code>true</code> if supported
181
	 */
182
	public boolean allowAutomaticValues();
86 183

  
184
	/**
185
	 * Returns total feature count of this store.
186
	 *
187
	 * @return
188
	 * @throws DataException
189
	 */
190
	public long getFeatureCount() throws DataException;
87 191

  
192

  
88 193
	public boolean supportsAppendMode();
89 194

  
90 195
	public void beginAppend() throws DataException;
91 196

  
92 197
	public void endAppend() throws DataException;
93 198

  
94
	public void append(FeatureData featureData) throws DataException;
199
	public void append(FeatureProvider featureData) throws DataException;
95 200

  
96
	public boolean allowAutomaticValues();
97 201

  
98
	public long getFeatureCount() throws DataException;
99 202

  
100 203
}

Also available in: Unified diff