public class LockSpec extends Object
The methods to call for locking and unlocking a dataspace are
lock(AdaptationHome, Session)
and unlock(AdaptationHome, Session)
.
Constructor and Description |
---|
LockSpec() |
Modifier and Type | Method and Description |
---|---|
UserMessage |
getDescription() |
boolean |
isChildBranchCreationAllowed() |
boolean |
isIgnoreLockReason() |
boolean |
isOwnerPrivileges() |
void |
lock(AdaptationHome aDataSpace,
Session aSession)
Locks the specified dataspace.
|
void |
setChildBranchCreationAllowed(boolean childBranchCreationAllowed)
Declares that it is possible to create a child dataspace
when set to
true . |
void |
setDescription(UserMessage description)
Specifies a message describing the the context or reason for the lock.
|
void |
setIgnoreLockReason(boolean ignoreLockReason)
If
true , when unlocking, the initial means of the locking is ignored. |
void |
setOwnerPrivileges(boolean allPrivileges)
If
true , assumes the current user is either the owner of the dataspace or the owner of the lock
(when unlocking). |
void |
unlock(AdaptationHome aDataSpace,
Session aSession)
Unlocks the specified dataspace.
|
public void lock(AdaptationHome aDataSpace, Session aSession) throws OperationException
If the dataspace is already locked, this method throws an exception.
Note: this method cannot be called inside a procedure execution (because of transaction management restrictions).
A user can lock a dataspace if:
LockSpec
instance is in a
setOwnerPrivileges(boolean)
mode.public void unlock(AdaptationHome aDataSpace, Session aSession) throws OperationException
If the dataspace is already unlocked, this method throws an exception.
When dataspace is locked, a user can unlock it if:
LockSpec
instance is in a setOwnerPrivileges(boolean)
mode.And if:
LockSpec
instance is in a setIgnoreLockReason(boolean)
mode.Note:
LockSpec
will have to be created to unlock the
other
dataspace.public UserMessage getDescription()
setDescription(UserMessage)
public void setDescription(UserMessage description)
This localized message is displayed in the EBX® user interface when the user accesses a dataspace that is locked.
public void setChildBranchCreationAllowed(boolean childBranchCreationAllowed)
true
.
Default value is false
.public boolean isChildBranchCreationAllowed()
public boolean isOwnerPrivileges()
setOwnerPrivileges(boolean)
public void setOwnerPrivileges(boolean allPrivileges)
true
, assumes the current user is either the owner of the dataspace or the owner of the lock
(when unlocking).public boolean isIgnoreLockReason()
setIgnoreLockReason(boolean)
public void setIgnoreLockReason(boolean ignoreLockReason)
true
, when unlocking, the initial means of the locking is ignored.