org.vfny.geoserver.requests.wfs
Class LockRequest

java.lang.Object
  extended byorg.vfny.geoserver.requests.Request
      extended byorg.vfny.geoserver.requests.WFSRequest
          extended byorg.vfny.geoserver.requests.wfs.LockRequest

public class LockRequest
extends WFSRequest

Represents a lock request.


Nested Class Summary
static class LockRequest.Lock
          Represents a single Lock element.
 
Field Summary
protected  int expiry
          Specifies a lock expiration.
protected  boolean lockAll
          Specifices whether or not to lock all features grabbed in request
protected  java.util.List locks
           
 
Fields inherited from class org.vfny.geoserver.requests.WFSRequest
WFS_SERVICE_TYPE
 
Fields inherited from class org.vfny.geoserver.requests.Request
httpServletRequest, request, service, version
 
Constructor Summary
LockRequest()
          Empty constructor.
 
Method Summary
 void addLock(LockRequest.Lock lock)
          Adds a single lock to this request
 void addLock(java.lang.String featureType, org.geotools.filter.Filter filter)
          Creates a lock of the given featureType and filter and adds it to the lock list.
 void addLock(java.lang.String featureType, org.geotools.filter.Filter filter, java.lang.String handle)
          Creates a lock of the given featureType, filter and handle and adds it to the lock list.
 boolean equals(java.lang.Object obj)
           
 int getExpiry()
          Gets the expiration of the locks (in minutes).
 int getExpirySeconds()
           
 java.lang.String getHandle()
           
 boolean getLockAll()
          Gets whether lock request should fail if not all can be locked
 java.util.List getLocks()
          Gets a list of the locks held by this request(as LockRequest.Lock objects)
 void setExpiry(int expiry)
          Sets the expiration of the locks (in minutes).
 void setHandle(java.lang.String handle)
           
 void setLockAll(boolean lockAll)
          Sets whether lock request should fail if not all can be locked
 void setLocks(java.util.List locks)
          Sets the lock list for this request.
 void setLocks(java.util.List typeList, java.util.List filterList)
          Sets the locks for this request according to the two lists passed in Little error checking is done, as this is a convenience method for LockKVP Reader, which does its own error checking.
 org.geotools.data.FeatureLock toFeatureLock()
          Turn this request into a FeatureLock.
 java.lang.String toString()
           
 
Methods inherited from class org.vfny.geoserver.requests.Request
getBaseUrl, getGeoServer, getHttpServletRequest, getRequest, getRootDir, getService, getValidationProcessor, getVersion, hashCode, isLoggedIn, setHttpServletRequest, setRequest, setService, setVersion
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

expiry

protected int expiry
Specifies a lock expiration.


lockAll

protected boolean lockAll
Specifices whether or not to lock all features grabbed in request


locks

protected java.util.List locks
Constructor Detail

LockRequest

public LockRequest()
Empty constructor.

Method Detail

toFeatureLock

public org.geotools.data.FeatureLock toFeatureLock()
Turn this request into a FeatureLock.

You will return FeatureLock.getAuthorization() to your user so they can refer to this lock again.

The getAuthorization() value is based on getHandle(), with a default of "GeoServer" if the user has not provided a handle.

The FeatureLock produced is based on expiry:

Returns:

setHandle

public void setHandle(java.lang.String handle)

getHandle

public java.lang.String getHandle()

getLockAll

public boolean getLockAll()
Gets whether lock request should fail if not all can be locked

Returns:
true If the request should fail if all are not locked.

setLockAll

public void setLockAll(boolean lockAll)
Sets whether lock request should fail if not all can be locked

Parameters:
lockAll - true If the request should fail if all are not locked.

getExpiry

public int getExpiry()
Gets the expiration of the locks (in minutes).

Returns:
An int of the expiry in minutes.

setExpiry

public void setExpiry(int expiry)
Sets the expiration of the locks (in minutes).

Parameters:
expiry - An int of the expiry in minutes.

getExpirySeconds

public int getExpirySeconds()

getLocks

public java.util.List getLocks()
Gets a list of the locks held by this request(as LockRequest.Lock objects)

Returns:
The list of the locks.

addLock

public void addLock(LockRequest.Lock lock)
Adds a single lock to this request

Parameters:
lock - A Lock to be added to this request.

setLocks

public void setLocks(java.util.List locks)
Sets the lock list for this request. Gets rid of the old lock list.

Parameters:
locks - The list of locks to add.

setLocks

public void setLocks(java.util.List typeList,
                     java.util.List filterList)
Sets the locks for this request according to the two lists passed in Little error checking is done, as this is a convenience method for LockKVP Reader, which does its own error checking. None of the locks created will have handles (kvp's don't have handles).

Parameters:
typeList - a list of featureTypes as Strings.
filterList - a list of Filters. Should either be null, in which case the locks have no filters, or else should be of the same length as the typeList.

addLock

public void addLock(java.lang.String featureType,
                    org.geotools.filter.Filter filter,
                    java.lang.String handle)
Creates a lock of the given featureType, filter and handle and adds it to the lock list.

Parameters:
featureType - the typeName to lock.
filter - which features of the featureType to lock.
handle - the name to identify this lock, for error reporting.

addLock

public void addLock(java.lang.String featureType,
                    org.geotools.filter.Filter filter)
Creates a lock of the given featureType and filter and adds it to the lock list.

Parameters:
featureType - the typeName to lock.
filter - which features of the featureType to lock.

toString

public java.lang.String toString()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Request