org.geotools.data.wfs
Class WFSFeatureStore

java.lang.Object
  extended byorg.geotools.data.AbstractFeatureSource
      extended byorg.geotools.data.wfs.WFSFeatureSource
          extended byorg.geotools.data.wfs.WFSFeatureStore
All Implemented Interfaces:
FeatureSource, FeatureStore

public class WFSFeatureStore
extends WFSFeatureSource
implements FeatureStore

DOCUMENT ME!

Author:
dzwiers

Nested Class Summary
 
Nested classes inherited from class org.geotools.data.wfs.WFSFeatureSource
WFSFeatureSource.WFSFeatureResults
 
Field Summary
protected  Transaction trans
           
 
Fields inherited from class org.geotools.data.wfs.WFSFeatureSource
ds, fname
 
Constructor Summary
WFSFeatureStore(WFSDataStore ds, java.lang.String typeName)
           
 
Method Summary
 java.util.Set addFeatures(FeatureReader reader)
          NOTE: The fids returned are not persistent until the transaction is commited.
 Transaction getTransaction()
          Used to access the Transaction this DataSource is currently opperating against.
 void modifyFeatures(AttributeType[] type, java.lang.Object[] value, Filter filter)
          Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter.
 void modifyFeatures(AttributeType type, java.lang.Object value, Filter filter)
          Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter.
 void removeFeatures(Filter filter)
          Removes all of the features specificed by the passed filter from the collection.
 void setFeatures(FeatureReader reader)
          Deletes the all the current Features of this datasource and adds the new collection.
 void setTransaction(Transaction transaction)
          Provides a transaction for commit/rollback control of this FeatureStore.
 
Methods inherited from class org.geotools.data.wfs.WFSFeatureSource
addFeatureListener, getBounds, getBounds, getDataStore, getFeatures, getFeatures, getFeatures, getSchema, removeFeatureListener
 
Methods inherited from class org.geotools.data.AbstractFeatureSource
getCount, namedQuery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.data.FeatureSource
addFeatureListener, getBounds, getBounds, getCount, getDataStore, getFeatures, getFeatures, getFeatures, getSchema, removeFeatureListener
 

Field Detail

trans

protected Transaction trans
Constructor Detail

WFSFeatureStore

public WFSFeatureStore(WFSDataStore ds,
                       java.lang.String typeName)
Parameters:
ds -
Method Detail

getTransaction

public Transaction getTransaction()
Description copied from interface: FeatureStore
Used to access the Transaction this DataSource is currently opperating against.

Example Use: adding features to a road DataSource


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

Specified by:
getTransaction in interface FeatureStore
Overrides:
getTransaction in class WFSFeatureSource
See Also:
AbstractFeatureSource.getTransaction()

addFeatures

public java.util.Set addFeatures(FeatureReader reader)
                          throws java.io.IOException
NOTE: The fids returned are not persistent until the transaction is commited.

Specified by:
addFeatures in interface FeatureStore
Parameters:
reader - The reader from which to add the features.
Returns:
the FeatureIds of the newly added features.
Throws:
java.io.IOException - if anything goes wrong.
See Also:
FeatureStore.addFeatures(org.geotools.data.FeatureReader)

removeFeatures

public void removeFeatures(Filter filter)
                    throws java.io.IOException
Description copied from interface: FeatureStore
Removes all of the features specificed by the passed filter from the collection.

Specified by:
removeFeatures in interface FeatureStore
Parameters:
filter - An OpenGIS filter; specifies which features to remove.
Throws:
java.io.IOException - If anything goes wrong.
See Also:
FeatureStore.removeFeatures(org.geotools.filter.Filter)

modifyFeatures

public void modifyFeatures(AttributeType[] type,
                           java.lang.Object[] value,
                           Filter filter)
                    throws java.io.IOException
Description copied from interface: FeatureStore
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter.

Specified by:
modifyFeatures in interface FeatureStore
Parameters:
type - The attributes to modify.
value - The values to put in the attribute types.
filter - An OGC filter to note which attributes to modify.
Throws:
java.io.IOException - if the attribute and object arrays are not eqaul length, if the object types do not match the attribute types, or if there are backend errors.
See Also:
FeatureStore.modifyFeatures(org.geotools.feature.AttributeType[], java.lang.Object[], org.geotools.filter.Filter)

modifyFeatures

public void modifyFeatures(AttributeType type,
                           java.lang.Object value,
                           Filter filter)
                    throws java.io.IOException
Description copied from interface: FeatureStore
Modifies the passed attribute types with the passed objects in all features that correspond to the passed OGS filter. A convenience method for single attribute modifications.

Specified by:
modifyFeatures in interface FeatureStore
Parameters:
type - The attributes to modify.
value - The values to put in the attribute types.
filter - An OGC filter to note which attributes to modify.
Throws:
java.io.IOException - If modificaton is not supported, if the object type do not match the attribute type.
See Also:
FeatureStore.modifyFeatures(org.geotools.feature.AttributeType, java.lang.Object, org.geotools.filter.Filter)

setFeatures

public void setFeatures(FeatureReader reader)
                 throws java.io.IOException
Description copied from interface: FeatureStore
Deletes the all the current Features of this datasource and adds the new collection. Primarily used as a convenience method for file datasources.

Specified by:
setFeatures in interface FeatureStore
Parameters:
reader - - the collection to be written
Throws:
java.io.IOException - if there are any datasource errors.
See Also:
FeatureStore.setFeatures(org.geotools.data.FeatureReader)

setTransaction

public void setTransaction(Transaction transaction)
Description copied from interface: FeatureStore
Provides a transaction for commit/rollback control of this FeatureStore.

This method operates as a replacement for setAutoCommitMode. When a transaction is provided you are no longer automatically committing.

In order to return to AutoCommit mode supply the Transaction.AUTO_COMMIT to this method. Since this represents a return to AutoCommit mode the previous Transaction will be commited.

Specified by:
setTransaction in interface FeatureStore
Parameters:
transaction - DOCUMENT ME!
See Also:
FeatureStore.setTransaction(org.geotools.data.Transaction)


Copyright © GeoTools. All Rights Reserved.