Provides a locking mechanism.
boolean
|
createLock(String objectKey, String sessionKey, Date expires)
Sets a self expiring lock for the given key. The lock will expire as of the date/time indicated. Maximum lock time is 1 hour.
|
|
deleteLock(String objectKey)
Deletes the specified lock
|
Date
|
getExpire(String objectKey, String sessionKey)
Returns the expiration, if any, for the specified objectKey. If sessionKey is provided, this returns the expire datetime only if the sessionKey has the lock.
|
String
|
getSessionKey(String objectKey)
Returns the session key, if any, for the specified objectKey.
|
boolean
|
hasLock(String objectKey, String sessionKey)
Returns true if the specified sessionKey has a lock on the objectKey. If sessionKey is provided, this returns the expire datetime only if the sessionKey has the lock.
|
String
|
toString()
Returns a description of this object.
|
Method Detail
boolean createLock(String objectKey, String sessionKey, Date expires)
Sets a self expiring lock for the given key. The lock will expire as of the date/time indicated. Maximum lock time is 1 hour.
Parameters:
-
String
objectKey
Required parameter.
Maximum allowed size of parameter: 128
-
String
sessionKey
Required parameter.
Maximum allowed size of parameter: 128
-
Date
expires
Required parameter.
Returns:
boolean
Since:
11-10-2015
deleteLock(String objectKey)
Deletes the specified lock
Parameters:
-
String
objectKey
Required parameter.
Maximum allowed size of parameter: 128
Since:
11-10-2015
Date getExpire(String objectKey, String sessionKey)
Returns the expiration, if any, for the specified objectKey. If sessionKey is provided, this returns the expire datetime only if the sessionKey has the lock.
Parameters:
-
String
objectKey
Required parameter.
Maximum allowed size of parameter: 128
-
String
sessionKey
Maximum allowed size of parameter: 128
Returns:
Date
Since:
11-10-2015
String getSessionKey(String objectKey)
Returns the session key, if any, for the specified objectKey.
Parameters:
-
String
objectKey
Required parameter.
Maximum allowed size of parameter: 128
Returns:
String
Since:
11-10-2015
boolean hasLock(String objectKey, String sessionKey)
Returns true if the specified sessionKey has a lock on the objectKey. If sessionKey is provided, this returns the expire datetime only if the sessionKey has the lock.
Parameters:
-
String
objectKey
Required parameter.
Maximum allowed size of parameter: 128
-
String
sessionKey
Maximum allowed size of parameter: 128
Returns:
boolean
Since:
11-10-2015
String toString()
Returns a description of this object.
Returns:
String
Since:
11-10-2015