public interface ILockProvider
Modifier and Type | Interface and Description |
---|---|
static class |
ILockProvider.LockStatus |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT |
static java.lang.String |
DATABASE |
static java.lang.String |
HAZELCAST |
static java.lang.String |
LOCK_PROVIDER_NAME |
static java.lang.String |
RESOURCE_NAME |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
ILockInformation |
attemptLock(ILockInformation lockInformation)
Attempts to lock the passed instance.
|
ILockInformation |
createLockInformation(java.lang.String aRequestorID,
java.lang.String aOperatorID,
java.lang.String aOperatorName,
java.util.Date aExpireTime,
java.util.Date aAcquisitionTime,
java.lang.String aLockHandle,
java.util.Date aCreateTime,
java.util.Date aUpdateTime,
java.lang.String aUserHost,
java.lang.String aTenantID)
Create lock information
|
ILockInformation |
createLockInformation(java.lang.String aRequestorID,
java.lang.String aOperatorID,
java.lang.String aOperatorName,
java.util.Date aExpireTime,
java.util.Date aAcquisitionTime,
java.lang.String aLockHandle,
java.util.Date aCreateTime,
java.util.Date aUpdateTime,
java.lang.String aUserHost,
java.lang.String aCreateSystemId,
java.lang.String aSystemName,
java.lang.String aSystemNode,
java.lang.String aPzInsKey,
java.lang.String aUpdateOperatorId,
java.lang.String aUpateOpeatorName,
java.lang.String aTenantID)
Create lock information
|
java.util.Collection<ILockInformation> |
expireRequestorLocks(java.lang.String requestorId)
When the current requestor times out expire all locks held by him by
moving the expiration date to now
|
ILockInformation |
findExistingLockInstance(java.lang.String aLockName)
Gets the a current lock instance from the database/hazelcast cluster.
|
java.util.Collection<ILockInformation> |
getAllLocks() |
java.util.Collection<ILockInformation> |
getLocksInformation() |
ILockInformation |
getRequestorLockInformation(java.lang.String requestorId)
Retrieve first active lock information for the requestor id.
|
java.lang.String |
getType() |
ILockProvider.LockStatus |
releaseLock(java.lang.String aLockName,
java.lang.String requestorId,
boolean aInDifferentRequestor,
boolean aSetStatusIfLost,
boolean localCache)
Releases a lock.
|
int |
releaseSystemLocks() |
boolean |
removeAllLocks() |
int |
unlockAllForOperator(java.lang.String operatorId) |
int |
unlockForRequestor(java.lang.String requestorId) |
boolean |
updateLock(ILockInformation existingLock,
ILockInformation newLock)
Updates a lock instance.
|
ILockInformation |
withNewExpiration(ILockInformation aLockInformation,
java.util.Date newExpirationTime,
java.util.Date newDBExpirationTime,
java.util.Date newUpdateTime,
java.lang.String aTenantID)
Create a new lock that is a copy of this lock, except with a new
expiration time.
|
static final java.lang.String COPYRIGHT
static final java.lang.String VERSION
static final java.lang.String DATABASE
static final java.lang.String RESOURCE_NAME
static final java.lang.String HAZELCAST
static final java.lang.String LOCK_PROVIDER_NAME
ILockInformation attemptLock(ILockInformation lockInformation) throws LockFailureException
lockInformation
- lock information of the lock to be attempted onLockFailureException
- if there is any problem during lockingILockInformation findExistingLockInstance(java.lang.String aLockName) throws LockFailureException
aLockName
- name of the desired lockLockFailureException
- if something goes wrongboolean updateLock(ILockInformation existingLock, ILockInformation newLock) throws LockFailureException
existingLock
- existing lock instance whose information should be updatednewLock
- new lock instance with the information to be updatedLockFailureException
- if there is a database problemILockProvider.LockStatus releaseLock(java.lang.String aLockName, java.lang.String requestorId, boolean aInDifferentRequestor, boolean aSetStatusIfLost, boolean localCache) throws LockFailureException, DatabaseException
aLockName
- key of the lock to releaserequestorId
- requestor id whose lock should be releasedaInDifferentRequestor
- should we unlock it even if a different Requestor is holding
it?aSetStatusIfLost
- if this is true, then the processing status is set to fail if
the lock to release is not therelocalCache
- if this is true, then the lock is released from local cache tooaInDifferentRequestor
is false (that is, if we
know that we deleted a record that corresponded to our
Requestor)DatabaseException
- if a connection fails or something goes wrongLockGoneException
- if the lock is no longer there. If this happens, then the
processing status will be set to "fail" iff the
aSetStatusIfLost
parameter is set to true.LockFailureException
- if there is some other database/hazelcast-related problemint unlockAllForOperator(java.lang.String operatorId) throws LockFailureException
operatorId
- operator id whose locks should be releasedLockFailureException
- if there is some other database/hazelcast-related problemint unlockForRequestor(java.lang.String requestorId) throws LockFailureException
requestorId
- requestor id whose locks should be releasedLockFailureException
- if there is some other database/hazelcast-related problemint releaseSystemLocks() throws LockFailureException
LockFailureException
- if there is some other database/hazelcast-related problemjava.util.Collection<ILockInformation> expireRequestorLocks(java.lang.String requestorId) throws LockFailureException
requestorId
- requestor id whose locks should be releasedLockFailureException
- if there is some other database/hazelcast-related problemjava.util.Collection<ILockInformation> getLocksInformation() throws LockFailureException
LockFailureException
- if there is some other database/hazelcast-related problemILockInformation createLockInformation(java.lang.String aRequestorID, java.lang.String aOperatorID, java.lang.String aOperatorName, java.util.Date aExpireTime, java.util.Date aAcquisitionTime, java.lang.String aLockHandle, java.util.Date aCreateTime, java.util.Date aUpdateTime, java.lang.String aUserHost, java.lang.String aTenantID)
aRequestorID
- aOperatorID
- aOperatorName
- aExpireTime
- aAcquisitionTime
- aLockHandle
- aCreateTime
- aUpdateTime
- aUserHost
- aTenantID
- ILockInformation createLockInformation(java.lang.String aRequestorID, java.lang.String aOperatorID, java.lang.String aOperatorName, java.util.Date aExpireTime, java.util.Date aAcquisitionTime, java.lang.String aLockHandle, java.util.Date aCreateTime, java.util.Date aUpdateTime, java.lang.String aUserHost, java.lang.String aCreateSystemId, java.lang.String aSystemName, java.lang.String aSystemNode, java.lang.String aPzInsKey, java.lang.String aUpdateOperatorId, java.lang.String aUpateOpeatorName, java.lang.String aTenantID)
aRequestorID
- aOperatorID
- aOperatorName
- aExpireTime
- aAcquisitionTime
- aLockHandle
- aCreateTime
- aUpdateTime
- aUserHost
- aCreateSystemId
- aSystemName
- aSystemNode
- aPzInsKey
- aUpdateOperatorId
- aUpateOpeatorName
- aTenantID
- ILockInformation withNewExpiration(ILockInformation aLockInformation, java.util.Date newExpirationTime, java.util.Date newDBExpirationTime, java.util.Date newUpdateTime, java.lang.String aTenantID)
aLockInformation
- LockInformation to be changed.newExpirationTime
- Date representing the desired expiration timenewDBExpirationTime
- Date representing the desired db expiration timenewUpdateTime
- Date representing the updatetimeaTenantID
- java.lang.String getType()
boolean removeAllLocks() throws LockFailureException
LockFailureException
java.util.Collection<ILockInformation> getAllLocks() throws LockFailureException
LockFailureException
ILockInformation getRequestorLockInformation(java.lang.String requestorId) throws LockFailureException
requestorId
- LockFailureException
- if there is some other database-related problemCopyright © 2018 Pegasystems Inc. All Rights Reserved.