org.vfny.geoserver.requests.wfs
Class TransactionRequest

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

public class TransactionRequest
extends WFSRequest

Transactional request object, consisting of one or more sub transactional requests.


Field Summary
static org.vfny.geoserver.requests.wfs.ReleaseAction ALL
          Release lockID when the transaction completes.
protected  java.lang.String handle
          Specifices the user-defined name for the entire transaction request.
protected  java.lang.String lockId
          Assume null value means no lockID specified
protected  org.vfny.geoserver.requests.wfs.ReleaseAction releaseAction
          Control how locked features are treated when a transaction is completed.
static org.vfny.geoserver.requests.wfs.ReleaseAction SOME
          Release lockID when the transaction completes.
protected  java.util.List subRequests
          Assume this is a list of SubTransactionRequest
static java.lang.String TRANSACTION_REQUEST_TYPE
           
 
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
TransactionRequest()
          Create a WFS Transaction request.
 
Method Summary
 void addSubRequest(SubTransactionRequest subRequest)
          Adds a delete, insert, or update request to this transaction.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getHandle()
          Returns the user-defined name for the entire Transaction request.
 java.lang.String getLockId()
          Returns the lock id for the entire Transaction request.
 org.vfny.geoserver.requests.wfs.ReleaseAction getReleaseAction()
          Returns the release for the Transaction request.
 SubTransactionRequest getSubRequest(int i)
          Gets the request held at position i.
 int getSubRequestSize()
          Gets the number of delete, update, and insert operations
 void setHandle(java.lang.String handle)
          Sets the user-defined name for the entire Transaction request.
 void setLockId(java.lang.String lockId)
          Sets the lock id for the entire Transaction request.
 void setReleaseAction(boolean releaseAll)
          Sets the release for the Transaction request.
 void setReleaseAction(java.lang.String releaseAction)
           
 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

TRANSACTION_REQUEST_TYPE

public static final java.lang.String TRANSACTION_REQUEST_TYPE
See Also:
Constant Field Values

subRequests

protected java.util.List subRequests
Assume this is a list of SubTransactionRequest


lockId

protected java.lang.String lockId
Assume null value means no lockID specified


ALL

public static final org.vfny.geoserver.requests.wfs.ReleaseAction ALL
Release lockID when the transaction completes.

WFS Specification Definition of ALL:

A value of ALL indicates that the locks on all feature instances locked using the specified lockId should be released when the transaction completes, regardless of whether or not a particular feature instance in the locked set was actually operated upon.


SOME

public static final org.vfny.geoserver.requests.wfs.ReleaseAction SOME
Release lockID when the transaction completes.

WFS Specification Definition of SOME:

A value of SOME indicates that only the locks on feature instances modified by the transaction should be released. The other, unmodified, feature instances should remain locked using the same LockId so that subsequent transactions can operate on those feature instances.

In the event that the releaseAction is set to SOME, and an expiry period was specified, the expiry counter must be reset to zero after each transaction unless all feature instances in the locked set have been operated upon.


releaseAction

protected org.vfny.geoserver.requests.wfs.ReleaseAction releaseAction
Control how locked features are treated when a transaction is completed.


handle

protected java.lang.String handle
Specifices the user-defined name for the entire transaction request.

Note that SubTransactionRequests are allowed there own handle as well, if they don't have one we should try and describe their position in a relative way.

Constructor Detail

TransactionRequest

public TransactionRequest()
Create a WFS Transaction request.

Method Detail

addSubRequest

public void addSubRequest(SubTransactionRequest subRequest)
Adds a delete, insert, or update request to this transaction.

If subRequest does not yet have a handle we will invent one here and give it one, the alternative is have subRequest known about its parent Transaction in order to generate a handle.

Parameters:
subRequest - To be part of this transaction request.

getSubRequest

public SubTransactionRequest getSubRequest(int i)
Gets the request held at position i.

Parameters:
i - the position of the operation request to get.
Returns:
the request at i.

getSubRequestSize

public int getSubRequestSize()
Gets the number of delete, update, and insert operations

Returns:
Number of sub requests.

setHandle

public void setHandle(java.lang.String handle)
Sets the user-defined name for the entire Transaction request.

Parameters:
handle - The user name for this request.

getHandle

public java.lang.String getHandle()
Returns the user-defined name for the entire Transaction request.

Returns:
The user name for this request.

setReleaseAction

public void setReleaseAction(java.lang.String releaseAction)
                      throws WfsTransactionException
Throws:
WfsTransactionException

setReleaseAction

public void setReleaseAction(boolean releaseAll)
Sets the release for the Transaction request.

No matter what value you pick the features you modify in this transaction that are held by lockID will be released.

Parameters:
releaseAll - true if all features held by the lock should be released after this operation.

getReleaseAction

public org.vfny.geoserver.requests.wfs.ReleaseAction getReleaseAction()
Returns the release for the Transaction request.

Returns:
true if all features held by the lock should be released after this operation.

setLockId

public void setLockId(java.lang.String lockId)
Sets the lock id for the entire Transaction request.

Parameters:
lockId - The authorization string to perform with this transaction.

getLockId

public java.lang.String getLockId()
Returns the lock id for the entire Transaction request.

Returns:
The authorization string to perform with this transaction.

toString

public java.lang.String toString()

equals

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