GeoAPI 2.0
Build 2005-06-08

@XmlSchema(URL="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd", specification=OGC_04094)

Package org.opengis.feature

Gives a normalized interface to a data provider that can serve up collections of Feature objects.

See:
          Description

Interface Summary
Feature Represents a feature of arbitrary complexity.
FeatureAttributeDescriptor Descriptor that gives the name, data type, and cardinality of an attribute from a FeatureType.
FeatureCollection Represents a collection of features.
FeatureIterator Extends the Iterator interface to include a close method for cleaning up connections to a persistent store.
FeatureListener The listener interface for receiving feature events.
FeatureStore Gives a normalized interface to a data provider that can serve up collections of Feature objects.
FeatureStoreFactory A provider of spatial information.
FeatureStoreListener Interface whose methods are invoked when types are modified in a FeatureStore.
FeatureType Describes a feature in an application namespace.
FeatureTypeFactory Interface through which new FeatureTypes are made known to a FeatureCanvas.
LockRequest Represents the request for a lock.
LockResponse Represents a response for a lock request.
Query Used by the getFeatures method of the data store interface, to encapsulate a request.
Transaction The controller for transaction with FeatureStore.
Transaction.State FeatureStore implementations can use this interface to externalize the state they require to implement Transaction support.
 

Class Summary
DataType Enumeration class whose static constants give the possible data types for Feature attributes.
FeatureEvent Instances of this class are passed to the methods of FeatureListener when a new feature is added to, removed from, or changed within a given feature collection.
FeatureStoreEvent Instances of this class are passed to the methods of FeatureStoreListener when the user of the FeatureStore adds, deletes, or modifies a feature type.
 

Exception Summary
BackingStoreException Thrown to indicate that a FeatureCollection operation could not complete because of a failure in the backing store, or a failure to contact the backing store.
FeatureStoreException Thrown to indicate that a FeatureStore operation could not complete because of a failure in the backing store, or a failure to contact the backing store.
 

Package org.opengis.feature Description

Gives a normalized interface to a data provider that can serve up collections of Feature objects.

Package Specification

This package is based on the following specifications:

WFS Long Transaction Support

The locking workflow described by FeatureCollection.lock() methods and LockRequest, and LockResponse, and indeed the Transaction facilities employed by FeatureCollection are informed by the requirements of the WFS specification.

The WFS specification provides an attractive middle ground between full versioned Features, and light-weight in-process or file lock based approaches. Locks are maintained for a requested duration. A successful lock operation results in an authorization token that may be used at a later time. A transaction may be assigned a token allowing it to work on previously locked features. WFS allows a lock to be taken out across multiple FeatureCollections in a single request. We have extended this idea to support FeatureCollection from different FeatureStores - although we confess that the authorization tokens are still on a per FeatureStore basis.

Code example:

  // The FilterFactory.bnf( "" ) method is unfortuantly mythical
  //
  FeatureStore featureStore = FeatureStoreFactory.create( new URI("myfile.gml") );
  GenericName roads = featureStore.getTypeNames().iterator().next();
  
  FeatureCollection kaslo = featureStore.getFeatures( roads, FilterFactory.bnf( "CITY='kaslo'" );
  LockRequest lockRequest = new LockRequest( 45678 );
  Transaction t = new Transaction();
  
  kaslo.setTransaction( t );
  kaslo.setLock( lockRequest );
  kaslo.lock(); // returns LockResponse.PENDING
  LockResponse lockResults = t.commit(); // kaslo roads are now locked
  
  String token = lockResults.getToken(); // token now contains a data store specific string (like WDRHENDHA123123ADEF )
                                         // This is a pure momento with no meaning to client code and no documented
                                         // internal strucutre. May not even be human readable.
      
  kaslo.deleteAll( kaslo.subCollection( FilterFactory.bnf( "CITY='kaslo' AND NAME='A street'" ) );
  try {
     t.commit(); // commit does not even return as we have a lock conflict ...
  } catch (IOException locked){
     // A stree is safe - we did not use authorization
     System.out.println("expected locking message:"+locked); 
  }
  
  t.useAuthorization( token );
  kaslo.deleteAll( kaslo.subCollection( FilterFactory.bnf( "CITY='kaslo' AND NAME='A street'" ) );
  lockResults = t.commit(); // lockResults now equals LockResults.NONE as this commit had no lock methods called
  

At the end of the above example, kaslo A street has been deleted and the remaining streets in kaslo are unlocked since the token has been used.

Related Documentation


GeoAPI 2.0
Build 2005-06-08

Symbols, terms and definitions
Copyright OpenGIS® Consortium