|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.deegree.ogcwebservices.AbstractOGCWebServiceRequest org.deegree.ogcwebservices.wfs.operation.AbstractWFSRequest org.deegree.ogcwebservices.wfs.operation.LockFeature
public class LockFeature
Represents a LockFeature
request to a web feature service.
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.
Nested Class Summary | |
---|---|
static class |
LockFeature.ALL_SOME_TYPE
Known lock actions. |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_EXPIRY
Default value for expiry (in minutes). |
static java.lang.String |
LOCK_ACTION_ALL
String value for ALL_SOME_TYPE.ALL . |
static java.lang.String |
LOCK_ACTION_SOME
String value for ALL_SOME_TYPE.SOME . |
Fields inherited from class org.deegree.ogcwebservices.wfs.operation.AbstractWFSRequest |
---|
FORMAT_GML2, FORMAT_GML2_WFS100, FORMAT_GML3, FORMAT_XML |
Constructor Summary | |
---|---|
LockFeature(java.lang.String version,
java.lang.String id,
java.lang.String handle,
long expiry,
LockFeature.ALL_SOME_TYPE lockAction,
java.util.List<Lock> locks)
Creates a new LockFeature instance from the given parameters. |
Method Summary | |
---|---|
static LockFeature |
create(java.util.Map<java.lang.String,java.lang.String> kvp)
Creates a new LockFeature request from the given parameter map. |
static LockFeature |
create(java.lang.String id,
org.w3c.dom.Element root)
Creates a new LockFeature instance from a document that contains the DOM representation of the
request. |
static LockFeature |
create(java.lang.String version,
java.lang.String id,
java.lang.String handle,
long expiry,
LockFeature.ALL_SOME_TYPE lockAction,
java.util.List<Lock> locks)
Creates a new LockFeature instance from the given parameters. |
long |
getExpiry()
Returns the limit on how long the web feature service holds the lock in the event that a transaction is never issued that would release the lock. |
LockFeature.ALL_SOME_TYPE |
getLockAction()
Returns the mode for lock acquisition. |
java.util.List<Lock> |
getLocks()
Returns the contained lock operations. |
void |
guessMissingNamespaces(WFService wfs)
Adds missing namespaces in the names of targeted feature types. |
boolean |
lockAllFeatures()
Returns whether this request requires that all features have to be lockable in order to be performed succesfully. |
(package private) static LockFeature.ALL_SOME_TYPE |
validateLockAction(java.lang.String lockActionString)
Ensures that given lock action String is valid and returns the corresponding LockFeature.ALL_SOME_TYPE . |
Methods inherited from class org.deegree.ogcwebservices.wfs.operation.AbstractWFSRequest |
---|
checkServiceParameter, checkVersionParameter, extractBBOXFilter, extractFilters, extractNamespaceParameter, extractTypeNames, getHandle, getServiceName |
Methods inherited from class org.deegree.ogcwebservices.AbstractOGCWebServiceRequest |
---|
getId, getParam, getParamAsInt, getParamValues, getRequestParameter, getRequiredParam, getVendorSpecificParameter, getVendorSpecificParameters, getVersion, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String DEFAULT_EXPIRY
public static java.lang.String LOCK_ACTION_ALL
ALL_SOME_TYPE.ALL
.
public static java.lang.String LOCK_ACTION_SOME
ALL_SOME_TYPE.SOME
.
Constructor Detail |
---|
LockFeature(java.lang.String version, java.lang.String id, java.lang.String handle, long expiry, LockFeature.ALL_SOME_TYPE lockAction, java.util.List<Lock> locks)
LockFeature
instance from the given parameters.
version
- request versionid
- id of the requesthandle
- handle of the requestexpiry
- the limit on how long the web feature service keeps the lock (in milliseconds)lockAction
- method for lock acquisitionlocks
- contained lock operationsMethod Detail |
---|
public static LockFeature create(java.lang.String version, java.lang.String id, java.lang.String handle, long expiry, LockFeature.ALL_SOME_TYPE lockAction, java.util.List<Lock> locks)
LockFeature
instance from the given parameters.
version
- request versionid
- id of the requesthandle
- handle of the requestexpiry
- the limit on how long the web feature service holds the lock (in milliseconds)lockAction
- method for lock acquisitionlocks
- contained lock operations
LockFeature
requestpublic static LockFeature create(java.lang.String id, org.w3c.dom.Element root) throws OGCWebServiceException
LockFeature
instance from a document that contains the DOM representation of the
request.
id
- of the requestroot
- element that contains the DOM representation of the request
LockFeature
request
OGCWebServiceException
public static LockFeature create(java.util.Map<java.lang.String,java.lang.String> kvp) throws InconsistentRequestException, InvalidParameterValueException, MissingParameterValueException
LockFeature
request from the given parameter map.
kvp
- key-value pairs, keys have to be uppercase
LockFeature
request
InconsistentRequestException
InvalidParameterValueException
MissingParameterValueException
public long getExpiry()
public LockFeature.ALL_SOME_TYPE getLockAction()
LockFeature.ALL_SOME_TYPE
public boolean lockAllFeatures()
LockFeature.ALL_SOME_TYPE
public java.util.List<Lock> getLocks()
public void guessMissingNamespaces(WFService wfs)
If the QualifiedName
of a targeted type has a null namespace, the first qualified feature type name of
the given WFService
with the same local name is used instead.
Note: The method changes this request (the feature type names) and should only be called by the
WFSHandler
class.
wfs
- WFService
instance that is used for the lookup of proper (qualified) feature type namesstatic LockFeature.ALL_SOME_TYPE validateLockAction(java.lang.String lockActionString) throws InvalidParameterValueException
String
is valid and returns the corresponding LockFeature.ALL_SOME_TYPE
.
The given String
must be either:
lockActionString
- String
to validate
LockFeature.ALL_SOME_TYPE
InvalidParameterValueException
- if string is neither ALL
nor SOME
|
deegree 2.5 (2011/06/29 09:44 build-8-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org