public abstract class ALcdWFSLock extends Object
ILcdWFSLockFactory
Modifier and Type | Class and Description |
---|---|
static class |
ALcdWFSLock.LockAction
An enumeration that corresponds to the 'LockAction' attribute of 'GetFeaturesWithLock' and
'LockFeatures' requests.
|
Constructor and Description |
---|
ALcdWFSLock()
Creates a lock.
|
Modifier and Type | Method and Description |
---|---|
long |
getExpiry()
Returns the duration for which this lock is valid after its creation time in seconds.
|
abstract ILcdModel |
getFeaturesWithLock(TLcdWFSGetFeatureConstraints aConstraints,
ALcdWFSLock.LockAction aLockAction,
TLcdWFSRequestContext aContext)
Tries to acquire a lock on features and returns the locked features as an
ILcdModel . |
String |
getId()
Returns the server-wide unique id of this lock.
|
boolean |
isValid()
Returns whether this lock is valid based on its expiry.
|
abstract void |
lockFeaturesSFCT(List<TLcdWFSGetFeatureConstraints> aConstraints,
ALcdWFSLock.LockAction aLockAction,
TLcdWFSRequestContext aRequestContext,
List<String> aLockedFeaturesSFCT,
List<String> aNotLockedFeaturesSFCT)
Tries to acquire a lock on features.
|
void |
setExpiry(long aExpiry)
Sets the expiry of a lock, can be used after initialization, or to refresh the lock.
|
abstract void |
unlockAllFeatures()
Unlocks all features that are locked by this lock.
|
abstract void |
unlockFeatures(Map<ILcdWFSFeatureType,List<Object>> aFeatures,
TLcdWFSRequestContext aContext)
Unlocks all the specified features.
|
public ALcdWFSLock()
public String getId()
public long getExpiry()
public void setExpiry(long aExpiry)
aExpiry
- a valid expiry.public boolean isValid()
public abstract void lockFeaturesSFCT(List<TLcdWFSGetFeatureConstraints> aConstraints, ALcdWFSLock.LockAction aLockAction, TLcdWFSRequestContext aRequestContext, List<String> aLockedFeaturesSFCT, List<String> aNotLockedFeaturesSFCT) throws TLcdWFSServiceException
aLockedFeaturesSFCT
. The id's of features that could not be locked should be added
to aNotLockedFeaturesSFCT
.
If aLockAction
is set to 'ALL' aNotLockedFeaturesSFCT
should be empty
if all features are successfully locked, otherwise an exception should be thrown to indicate
that not all features could be locked.aConstraints
- the constraints that specify which features should be locked.aLockAction
- specifies whether this method should only lock features if 'ALL' features
can be locked, or also if only 'SOME' features can be locked.aRequestContext
- a request context.aLockedFeaturesSFCT
- a list to which all id's of locked features should be added.aNotLockedFeaturesSFCT
- a list to which all id's of features which could not be locked
should be added.TLcdWFSServiceException
- An exception which will be returned to the client in case
anything goes wrong, or if the lock action is set to 'ALL' and not all features can
be locked.public abstract ILcdModel getFeaturesWithLock(TLcdWFSGetFeatureConstraints aConstraints, ALcdWFSLock.LockAction aLockAction, TLcdWFSRequestContext aContext) throws TLcdWFSServiceException
ILcdModel
.
If aLockAction
is set to 'ALL' and one of the requested features can not be locked,
a TLcdWFSServiceException
is thrown.aConstraints
- the constraints that define the features that should be locked.aLockAction
- specifies whether this method should only lock features if 'ALL' features can be locked,
or also if only 'SOME' features can be locked.aContext
- a request context.TLcdWFSServiceException
- if the operation fails.public abstract void unlockFeatures(Map<ILcdWFSFeatureType,List<Object>> aFeatures, TLcdWFSRequestContext aContext)
aFeatures
are the same objects as the ones returned by
ALcdWFSTransactionHandler.handleUpdateSFCT(com.luciad.ogc.wfs.ILcdWFSFeatureType, java.util.List<com.luciad.ogc.wfs.TLcdWFSTransactionUpdateProperty>, java.util.List<java.lang.Object>, java.util.List<java.lang.Object>, com.luciad.ogc.filter.model.TLcdOGCFilter, java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
, and/or
ALcdWFSTransactionHandler.handleDeleteSFCT(com.luciad.ogc.wfs.ILcdWFSFeatureType, java.util.List<java.lang.Object>, com.luciad.ogc.filter.model.TLcdOGCFilter, java.lang.String, com.luciad.ogc.wfs.TLcdWFSRequestContext)
.aFeatures
- a map containing a list of features which should be unlocked for each feature type.aContext
- a request context.public abstract void unlockAllFeatures()