Class JpaResourceLock
- java.lang.Object
-
- com.broadleafcommerce.common.messaging.provider.jpa.domain.JpaResourceLock
-
- All Implemented Interfaces:
Serializable
@Entity public class JpaResourceLock extends Object implements Serializable
Represents a single lock on a resource held in the current datastore. This is often used to prevent concurrent mutating operations on the same resource. A common application of this concept is the locking of sandbox workflow operations on the same Trackable resource.- Author:
- Jeff Fischer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JpaResourceLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
String
get_id()
String
getConceptKey()
A generally descriptive key that identifies the overall concept for which the lock is taking place.String
getContextId()
The contextId of the Trackable resource to lockInstant
getExpirationTimestamp()
The time at which the lock will naturally expireBoolean
getLocked()
Whether or not the resource is lockedString
getSandboxId()
The sandboxId in which the workflow operation is taking place.Instant
getTimestamp()
The time at which the lock was set to trueString
getToken()
The token assigned the last time the lock was set to true.String
getTypeAlias()
An alias used to represent the Java type of the resource being locked.int
hashCode()
void
set_id(String _id)
void
setConceptKey(String conceptKey)
A generally descriptive key that identifies the overall concept for which the lock is taking place.void
setContextId(String contextId)
The contextId of the Trackable resource to lockvoid
setExpirationTimestamp(Instant expirationTimestamp)
The time at which the lock will naturally expirevoid
setLocked(Boolean locked)
Whether or not the resource is lockedvoid
setSandboxId(String sandboxId)
The sandboxId in which the workflow operation is taking place.void
setTimestamp(Instant timestamp)
The time at which the lock was set to truevoid
setToken(String token)
The token assigned the last time the lock was set to true.void
setTypeAlias(String typeAlias)
An alias used to represent the Java type of the resource being locked.String
toString()
-
-
-
Method Detail
-
get_id
public String get_id()
-
getContextId
public String getContextId()
The contextId of the Trackable resource to lock- Returns:
- The contextId of the Trackable resource to lock
-
getTypeAlias
public String getTypeAlias()
An alias used to represent the Java type of the resource being locked. This is most often the Java class simple name.- Returns:
- An alias used to represent the Java type of the resource being locked
-
getSandboxId
public String getSandboxId()
The sandboxId in which the workflow operation is taking place.- Returns:
- The sandboxId in which the workflow operation is taking place.
-
getConceptKey
public String getConceptKey()
A generally descriptive key that identifies the overall concept for which the lock is taking place.WorkflowTransitionHelper#LOCK_CONCEPT_KEY
is an example that identifies locks for sandbox workflows. Other concept keys may be used to apply locks for the same resource under a different context.- Returns:
- A generally descriptive key
-
getLocked
public Boolean getLocked()
Whether or not the resource is locked- Returns:
- Whether or not the resource is locked
-
getTimestamp
public Instant getTimestamp()
The time at which the lock was set to true- Returns:
- The time at which the lock was set to true
-
getExpirationTimestamp
public Instant getExpirationTimestamp()
The time at which the lock will naturally expire- Returns:
- The time at which the lock will naturally expire
-
getToken
public String getToken()
The token assigned the last time the lock was set to true. The token simply identifies the lock record and can be used to unlock the resource.- Returns:
- The token assigned the last time the lock was set to true
-
set_id
public void set_id(String _id)
-
setContextId
public void setContextId(String contextId)
The contextId of the Trackable resource to lock- Parameters:
contextId
- The contextId of the Trackable resource to lock
-
setTypeAlias
public void setTypeAlias(String typeAlias)
An alias used to represent the Java type of the resource being locked. This is most often the Java class simple name.- Parameters:
typeAlias
- An alias used to represent the Java type of the resource being locked
-
setSandboxId
public void setSandboxId(String sandboxId)
The sandboxId in which the workflow operation is taking place.- Parameters:
sandboxId
- The sandboxId in which the workflow operation is taking place.
-
setConceptKey
public void setConceptKey(String conceptKey)
A generally descriptive key that identifies the overall concept for which the lock is taking place.WorkflowTransitionHelper#LOCK_CONCEPT_KEY
is an example that identifies locks for sandbox workflows. Other concept keys may be used to apply locks for the same resource under a different context.- Parameters:
conceptKey
- A generally descriptive key
-
setLocked
public void setLocked(Boolean locked)
Whether or not the resource is locked- Parameters:
locked
- Whether or not the resource is locked
-
setTimestamp
public void setTimestamp(Instant timestamp)
The time at which the lock was set to true- Parameters:
timestamp
- The time at which the lock was set to true
-
setExpirationTimestamp
public void setExpirationTimestamp(Instant expirationTimestamp)
The time at which the lock will naturally expire- Parameters:
expirationTimestamp
- The time at which the lock will naturally expire
-
setToken
public void setToken(String token)
The token assigned the last time the lock was set to true. The token simply identifies the lock record and can be used to unlock the resource.- Parameters:
token
- The token assigned the last time the lock was set to true
-
canEqual
protected boolean canEqual(Object other)
-
-