org.deegree_impl.services.wfs.protocol
Class WFSLockFeatureRequest_Impl

java.lang.Object
  extended byorg.deegree_impl.services.OGCWebServiceRequest_Impl
      extended byorg.deegree_impl.services.wfs.protocol.WFSBasicRequest_Impl
          extended byorg.deegree_impl.services.wfs.protocol.WFSLockFeatureRequest_Impl
All Implemented Interfaces:
OGCWebServiceRequest, WFSBasicRequest, WFSLockFeatureRequest

class WFSLockFeatureRequest_Impl
extends WFSBasicRequest_Impl
implements WFSLockFeatureRequest

Web connections are inherently stateless. Unfortunately, this means that the semantics of serializable transactions are not preserved. To understand the issue consider an UPDATE operation.

The client fetches a feature instance. The feature is then modified on the client side, and submitted back to the database, via a Transaction request for update. Serializability is lost since there is nothing to guarantee that while the feature was being modified on the client side, another client did not come along and update that same feature in the database.

One way to ensure serializability is to require that access to data be done in a mutually exclusive manner; that is while one transaction accesses a data item, no other transaction can modify the same data item. This can be accomplished by using locks that control access to the data.

The purpose of the LockFeature interface is to expose a long term feature locking mechanism to ensure consistency. The lock is considered long term because network latency would make feature locks last relatively longer than native commercial database locks.

The LockFeature interface is optional and need only be implemented if the underlying datastore supports (or can be made to support) data locking. In addition, the implementation of locking is completely opaque to the client.

--------------------------------------------------------

Version:
$Revision: 1.5 $ $Date: 2004/06/16 09:38:08 $
Author:
Andreas Poth

Field Summary
private  int expiry
           
private  java.util.ArrayList locks
           
 
Fields inherited from class org.deegree_impl.services.wfs.protocol.WFSBasicRequest_Impl
 
Fields inherited from class org.deegree_impl.services.OGCWebServiceRequest_Impl
id, request, service, vendorSpecificParameter, version
 
Constructor Summary
(package private) WFSLockFeatureRequest_Impl(java.lang.String version, java.lang.String id, java.util.HashMap vendorSpecificParameter, WFSNative native_, int expiry, WFSLock[] locks)
          constructor initializing the class with the
 
Method Summary
 void addLocks(WFSLock locks)
          adds the
 int getExpiry()
          The element is used to set a limit on how long the lock should be held in the event that a transaction is never issued that will release the lock.
 WFSLock[] getLocks()
          A LockFeature request can be used to acquire a lock on a single feature or a set of features defined using the element as defined in the OGC Filter Encoding Specification [Ref2].
 void setExpiry(int expiry)
          sets the
 void setLocks(WFSLock[] locks)
          sets the
 java.lang.String toString()
           
 
Methods inherited from class org.deegree_impl.services.wfs.protocol.WFSBasicRequest_Impl
exportAsXML, getNative, setNative
 
Methods inherited from class org.deegree_impl.services.OGCWebServiceRequest_Impl
getId, getRequest, getRequestParameter, getService, getVendorSpecificParameter, getVendorSpecificParameters, getVersion, putVendorSpecificParameter, setId, setRequest, setService, setVendorSpecificParameter, setVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deegree.services.wfs.protocol.WFSBasicRequest
getNative
 
Methods inherited from interface org.deegree.services.OGCWebServiceRequest
getId, getRequest, getRequestParameter, getService, getVendorSpecificParameter, getVendorSpecificParameters, getVersion
 

Field Detail

locks

private java.util.ArrayList locks

expiry

private int expiry
Constructor Detail

WFSLockFeatureRequest_Impl

WFSLockFeatureRequest_Impl(java.lang.String version,
                           java.lang.String id,
                           java.util.HashMap vendorSpecificParameter,
                           WFSNative native_,
                           int expiry,
                           WFSLock[] locks)
constructor initializing the class with the

Method Detail

getExpiry

public int getExpiry()
The element is used to set a limit on how long the lock should be held in the event that a transaction is never issued that will release the lock. The expiry limit is specified in minutes. Once the specified number of minutes have elapsed the lock will be released if it still exists. Any further transactions issued against that lock will fail.

Specified by:
getExpiry in interface WFSLockFeatureRequest

setExpiry

public void setExpiry(int expiry)
sets the


getLocks

public WFSLock[] getLocks()

A LockFeature request can be used to acquire a lock on a single feature or a set of features defined using the element as defined in the OGC Filter Encoding Specification [Ref2].

If a filter is not specified, then the optional typeName attribute can be used to specify that all feature instances of a particular feature type should be locked.

The optional lockAction attribute is used to control how feature locks are acquired. A lock action of ALL indicates that the web feature server should try to acquire a lock on all requested features; if all features cannot be locked then the operation should fail. If the lock action is set to SOME, then the web feature server tries to lock as many of the requested features as it can. The default lock action shall be ALL.

Specified by:
getLocks in interface WFSLockFeatureRequest

addLocks

public void addLocks(WFSLock locks)
adds the


setLocks

public void setLocks(WFSLock[] locks)
sets the


toString

public java.lang.String toString()
Overrides:
toString in class OGCWebServiceRequest_Impl
Returns: