Documentation of 'org.opengis.feature.package-summary' Java class
org.opengis.feature

@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

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:

  • Ref WFS spec for locking workflow
  • Ref Catalog 2.0 spec for paging idea and QueryRequest paging idea

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

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.