public class DirectoryFeatureStore extends DirectoryFeatureSource implements SimpleFeatureStore
| Constructor and Description |
|---|
DirectoryFeatureStore(SimpleFeatureStore store) |
| Modifier and Type | Method and Description |
|---|---|
List<FeatureId> |
addFeatures(FeatureCollection collection)
Adds all features from the feature collection.
|
Transaction |
getTransaction()
Gets the
Transaction that this FeatureStore is currently 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[] name,
Object[] value,
Filter filter)
Modifies the attributes with the supplied values in all features selected by the given
filter.
|
void |
modifyFeatures(Name attributeName,
Object attributeValue,
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 value,
Filter filter) |
void |
removeFeatureListener(FeatureListener listener)
Removes an object from this
FeatureSource's listeners. |
void |
removeFeatures(Filter filter)
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. |
SimpleFeatureStore |
unwrap() |
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHintsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFeatures, getFeatures, getFeaturesaddFeatureListener, getBounds, getBounds, getCount, getDataStore, getInfo, getName, getQueryCapabilities, getSchema, getSupportedHintspublic DirectoryFeatureStore(SimpleFeatureStore store)
public Transaction getTransaction()
FeatureStoreTransaction that this FeatureStore is currently operating against.
Transaction t = featureStore.getTransaction();
try {
featureStore.addFeatures( features );
t.commit();
} catch( IOException erp ){
// something went wrong;
java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", ex);
t.rollback();
}
getTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>public void modifyFeatures(Name attributeName, Object attributeValue, Filter filter) throws IOException
FeatureStoremodifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>attributeName - the attribute to modifyattributeValue - the new value for the attributefilter - an OpenGIS filterIOException - if modification is not supported; if the value type does not match the
attribute type; or if there errors accessing the data sourcepublic void modifyFeatures(AttributeDescriptor type, Object value, Filter filter) throws IOException
FeatureStoremodifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>type - the attribute to modifyvalue - the new value for the attributefilter - an OpenGIS filterIOExceptionpublic void modifyFeatures(Name[] name, Object[] value, Filter filter) throws IOException
FeatureStoremodifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>name - the attributes to modifyvalue - the new values for the attributesfilter - an OpenGIS filterIOException - 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 sourcepublic void modifyFeatures(String name, Object value, Filter filter) throws IOException
modifyFeatures in interface SimpleFeatureStoreIOExceptionpublic void modifyFeatures(String[] names, Object[] values, Filter filter) throws IOException
modifyFeatures in interface SimpleFeatureStoreIOExceptionpublic void modifyFeatures(AttributeDescriptor[] type, Object[] value, Filter filter) throws IOException
FeatureStoremodifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>type - the attributes to modifyvalue - the new values for the attributesfilter - an OpenGIS filterIOExceptionpublic void removeFeatureListener(FeatureListener listener)
FeatureSourceFeatureSource's listeners.removeFeatureListener in interface FeatureSource<SimpleFeatureType,SimpleFeature>removeFeatureListener in class DirectoryFeatureSourcelistener - the listener to removepublic void removeFeatures(Filter filter) throws IOException
FeatureStoreremoveFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>filter - an OpenGIS filterIOException - if an error occurs modifying the data sourcepublic void setFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader) throws IOException
FeatureStoresetFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>reader - - the collection to be writtenIOException - if there are any datasource errors.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;
java.util.logging.Logger.getGlobal().log(java.util.logging.Level.INFO, "", ex);
t.rollback();
} finally {
t.close();
}
setTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>transaction - the transactionpublic List<FeatureId> addFeatures(FeatureCollection collection) throws IOException
FeatureStoreA 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 addFeatureIds of the newly added featuresIOException - if an error occurs modifying the data sourcepublic SimpleFeatureStore unwrap()
unwrap in class DirectoryFeatureSourceCopyright © 1996–2019 Geotools. All rights reserved.