org.geotools.arcsde.data
Class ArcSdeFeatureStore

Object
  extended by ArcSdeFeatureSource
      extended by ArcSdeFeatureStore
All Implemented Interfaces:
FeatureSource<SimpleFeatureType,SimpleFeature>, FeatureStore<SimpleFeatureType,SimpleFeature>, SimpleFeatureSource, SimpleFeatureStore

public class ArcSdeFeatureStore
extends ArcSdeFeatureSource
implements SimpleFeatureStore


Field Summary
 
Fields inherited from class ArcSdeFeatureSource
dataStore, transaction, typeInfo
 
Constructor Summary
ArcSdeFeatureStore(FeatureTypeInfo typeInfo, ArcSDEDataStore arcSDEDataStore)
           
 
Method Summary
 List<FeatureId> addFeatures(FeatureCollection<SimpleFeatureType,SimpleFeature> 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[] attributes, Object[] values, Filter filter)
          Modifies the attributes with the supplied values in all features selected by the given filter.
 void modifyFeatures(Name name, 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 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)
          Sets this FeatureStore transaction.
 
Methods inherited from class ArcSdeFeatureSource
addFeatureListener, getBounds, getBounds, getBounds, getCount, getCount, getDataStore, getfeatureReader, getFeatures, getFeatures, getFeatures, getInfo, getName, getQueryCapabilities, getSchema, getSession, getSupportedHints, getVersionHandler, removeFeatureListener
 
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, getSupportedHints, removeFeatureListener
 

Constructor Detail

ArcSdeFeatureStore

public ArcSdeFeatureStore(FeatureTypeInfo typeInfo,
                          ArcSDEDataStore arcSDEDataStore)
Method Detail

getTransaction

public Transaction getTransaction()
Description copied from interface: FeatureStore
Gets the Transaction that this FeatureStore is currently operating against.

 Transaction t = featureStore.getTransaction();
 try {
     featureStore.addFeatures( features );
     t.commit();
 } catch( IOException erp ){
     // something went wrong;
     ex.printStackTrace();
     t.rollback();
 }
 

Specified by:
getTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Returns:
Transaction in use, or Transaction.AUTO_COMMIT
See Also:
FeatureStore.getTransaction()

setTransaction

public void setTransaction(Transaction transaction)
Sets this FeatureStore transaction.

If transaction is not auto commit, initiates an ArcTransactionState with the dataStore's connection pool as key.

Specified by:
setTransaction in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
transaction - the transaction
See Also:
FeatureStore.setTransaction(Transaction)

addFeatures

public List<FeatureId> addFeatures(FeatureCollection<SimpleFeatureType,SimpleFeature> collection)
                            throws IOException
Description copied from interface: FeatureStore
Adds all features from the feature collection.

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.

Specified by:
addFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
collection - the collection of features to add
Returns:
the FeatureIds of the newly added features
Throws:
IOException - if an error occurs modifying the data source
See Also:
FeatureStore#addFeatures(SimpleFeatureCollection)

modifyFeatures

public final void modifyFeatures(AttributeDescriptor[] type,
                                 Object[] value,
                                 Filter filter)
                          throws IOException
Description copied from interface: FeatureStore
For backwards compatibility; please be careful that your descriptor is actually compatible with the one declared.

Specified by:
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
type - the attributes to modify
value - the new values for the attributes
filter - an OpenGIS filter
Throws:
IOException
See Also:
FeatureStore.modifyFeatures(AttributeDescriptor[], Object[], Filter)

modifyFeatures

public void modifyFeatures(Name[] attributes,
                           Object[] values,
                           Filter filter)
                    throws IOException
Description copied from interface: FeatureStore
Modifies the attributes with the supplied values in all features selected by the given filter.

Specified by:
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
attributes - the attributes to modify
values - the new values for the attributes
filter - an OpenGIS filter
Throws:
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 source

modifyFeatures

public void modifyFeatures(String name,
                           Object attributeValue,
                           Filter filter)
                    throws IOException
Specified by:
modifyFeatures in interface SimpleFeatureStore
Throws:
IOException

modifyFeatures

public void modifyFeatures(String[] names,
                           Object[] values,
                           Filter filter)
                    throws IOException
Specified by:
modifyFeatures in interface SimpleFeatureStore
Throws:
IOException

modifyFeatures

public final void modifyFeatures(AttributeDescriptor type,
                                 Object value,
                                 Filter filter)
                          throws IOException
Description copied from interface: FeatureStore
For backwards compatibility; please be careful that your descriptor is actually compatible with the one declared.

Specified by:
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
type - the attribute to modify
value - the new value for the attribute
filter - an OpenGIS filter
Throws:
IOException
See Also:
FeatureStore.modifyFeatures(AttributeDescriptor, Object, Filter)

modifyFeatures

public final void modifyFeatures(Name name,
                                 Object value,
                                 Filter filter)
                          throws IOException
Description copied from interface: FeatureStore
Modifies an attribute with the supplied value in all features selected by the given filter.

Specified by:
modifyFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
name - the attribute to modify
value - the new value for the attribute
filter - an OpenGIS filter
Throws:
IOException - if modification is not supported; if the value type does not match the attribute type; or if there errors accessing the data source

removeFeatures

public void removeFeatures(Filter filter)
                    throws IOException
Description copied from interface: FeatureStore
Removes features selected by the given filter.

Specified by:
removeFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
filter - an OpenGIS filter
Throws:
IOException - if an error occurs modifying the data source
See Also:
FeatureStore.removeFeatures(Filter)

setFeatures

public void setFeatures(FeatureReader<SimpleFeatureType,SimpleFeature> reader)
                 throws IOException
Description copied from interface: FeatureStore
Deletes any existing features in the data source and then inserts new features provided by the given reader. This is primarily used as a convenience method for file-based data sources.

Specified by:
setFeatures in interface FeatureStore<SimpleFeatureType,SimpleFeature>
Parameters:
reader - - the collection to be written
Throws:
IOException - if there are any datasource errors.
See Also:
FeatureStore.setFeatures(FeatureReader)


Copyright © 1996-2014 Geotools. All Rights Reserved.