|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractFeatureSource
WFSFeatureSource
WFSFeatureStore
public class WFSFeatureStore
FeatureStore used to assemble a Transaction Request (issued during commit).
Please note this FeatureStore does not support working on Transaction.AUTO_COMMIT. Instead it builds up the Transaction request in a WFSTransactionState; each call to addFeatures, removeFeatures etc results in a series of "Actions" being recorded. These actions are used to both modify the contents you are looking at prior to commit being called; and to construct the Transaction Request when commit() is called.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class WFSFeatureSource |
|---|
WFSFeatureSource.WFSFeatureResults |
| Field Summary | |
|---|---|
protected Transaction |
trans
|
| Fields inherited from class WFSFeatureSource |
|---|
ds, fname |
| Fields inherited from class AbstractFeatureSource |
|---|
hints, queryCapabilities |
| Constructor Summary | |
|---|---|
WFSFeatureStore(WFS_1_0_0_DataStore ds,
String typeName)
|
|
| Method Summary | |
|---|---|
List<FeatureId> |
addFeatures(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
Adds all features from the feature collection. |
List<FeatureId> |
addFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
|
Set |
getSupportedHints()
By default, no Hints are supported |
Transaction |
getTransaction()
Retrieve the Transaction this SimpleFeatureSource is operating against. |
void |
modifyFeatures(AttributeDescriptor[] type,
Object[] value,
Filter filter)
For backwards compatibility; please be careful that your descriptor is actually compatible with the one declared. |
void |
modifyFeatures(AttributeDescriptor type,
Object value,
Filter filter)
For backwards compatibility; please be careful that your descriptor is actually compatible with the one declared. |
void |
modifyFeatures(Name[] names,
Object[] value,
Filter filter2)
Modifies the attributes with the supplied values in all features selected by the given filter. |
void |
modifyFeatures(Name type,
Object value,
Filter filter)
Modifies an attribute with the supplied value in all features selected by the given filter. |
void |
modifyFeatures(String[] names,
Object[] values,
Filter filter)
|
void |
modifyFeatures(String name,
Object attributeValue,
Filter filter)
|
void |
removeFeatures(Filter filter2)
Removes features selected by the given filter. |
void |
setFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
Deletes any existing features in the data source and then inserts new features provided by the given reader. |
void |
setTransaction(Transaction transaction)
Provide a transaction for commit/rollback control of a modifying operation on this FeatureStore. |
| Methods inherited from class WFSFeatureSource |
|---|
addFeatureListener, getBounds, getBounds, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getSchema, removeFeatureListener |
| Methods inherited from class AbstractFeatureSource |
|---|
getCount, getQueryCapabilities, namedQuery |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface SimpleFeatureStore |
|---|
getFeatures, getFeatures, getFeatures |
| Methods inherited from interface FeatureSource |
|---|
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getInfo, getName, getQueryCapabilities, getSchema, removeFeatureListener |
| Field Detail |
|---|
protected Transaction trans
| Constructor Detail |
|---|
public WFSFeatureStore(WFS_1_0_0_DataStore ds,
String typeName)
ds - typeName - | Method Detail |
|---|
public Set getSupportedHints()
AbstractFeatureSource
getSupportedHints in interface FeatureSource<SimpleFeatureType,SimpleFeature>getSupportedHints in class WFSFeatureSourceRenderingHints#Key objects; may be empty but never nullHints.FEATURE_DETACHED,
Hints.JTS_GEOMETRY_FACTORY,
Hints.JTS_COORDINATE_SEQUENCE_FACTORY,
Hints.JTS_PRECISION_MODEL,
Hints.JTS_SRID,
Hints.GEOMETRY_DISTANCE,
Hints.FEATURE_2Dpublic Transaction getTransaction()
AbstractFeatureSourceFor a plain SimpleFeatureSource that cannot modify this will always be Transaction.AUTO_COMMIT.
getTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>getTransaction in class WFSFeatureSourceAbstractFeatureSource.getTransaction()
public List<FeatureId> addFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
throws IOException
IOException
public List<FeatureId> addFeatures(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
throws IOException
FeatureStore
A list of FeatureIds is returned, one for each feature in the order created.
However, these might not be assigned until after a commit has been performed.
addFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>collection - the collection of features to add
FeatureIds of the newly added features
IOException - if an error occurs modifying the data source
public void removeFeatures(Filter filter2)
throws IOException
FeatureStore
removeFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>filter2 - an OpenGIS filter
IOException - if an error occurs modifying the data sourceorg.geotools.data.FeatureStore#removeFeatures(org.geotools.filter.Filter)
public void modifyFeatures(Name[] names,
Object[] value,
Filter filter2)
throws IOException
FeatureStore
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>names - the attributes to modifyvalue - the new values for the attributesfilter2 - an OpenGIS filter
IOException - if the attribute and object arrays are not equal
in length; if the value types do not match the attribute types;
if modification is not supported; or if there errors accessing the
data sourceorg.geotools.data.FeatureStore#modifyFeatures(org.geotools.feature.AttributeType[], java.lang.Object[], org.geotools.filter.Filter)
public final void modifyFeatures(AttributeDescriptor type,
Object value,
Filter filter)
throws IOException
FeatureStore
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>type - the attribute to modifyvalue - the new value for the attributefilter - an OpenGIS filter
IOException
public void modifyFeatures(Name type,
Object value,
Filter filter)
throws IOException
FeatureStore
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>type - the attribute to modifyvalue - the new value for the attributefilter - an OpenGIS filter
IOException - if modification is not supported; if the value type does
not match the attribute type; or if there errors accessing the data sourceorg.geotools.data.FeatureStore#modifyFeatures(org.geotools.feature.AttributeType, java.lang.Object, org.geotools.filter.Filter)
public final void modifyFeatures(AttributeDescriptor[] type,
Object[] value,
Filter filter)
throws IOException
FeatureStore
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>type - the attributes to modifyvalue - the new values for the attributesfilter - an OpenGIS filter
IOException
public void modifyFeatures(String name,
Object attributeValue,
Filter filter)
throws IOException
modifyFeatures in interface SimpleFeatureStoreIOException
public void modifyFeatures(String[] names,
Object[] values,
Filter filter)
throws IOException
modifyFeatures in interface SimpleFeatureStoreIOException
public void setFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
throws IOException
FeatureStore
setFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>reader - - the collection to be written
IOException - if there are any datasource errors.FeatureStore.setFeatures(org.geotools.data.FeatureReader)public void setTransaction(Transaction transaction)
FeatureStoreFeatureStore.
Transation t = new DefaultTransaction();
featureStore.setTransaction(t);
try {
featureStore.addFeatures( someFeatures );
t.commit();
} catch ( IOException ex ) {
// something went wrong;
ex.printStackTrace();
t.rollback();
} finally {
t.close();
}
setTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>transaction - the transactionFeatureStore.setTransaction(org.geotools.data.Transaction)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||