Class LockSpec
java.lang.Object
com.orchestranetworks.service.extensions.LockSpec
Handles a lock on a dataspace.
When locked, a dataspace can only be modified by the owner of the lock or an administrator.
The methods to call for locking and unlocking a dataspace are
lock(AdaptationHome, Session)
and unlock(AdaptationHome, Session)
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
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 totrue
.void
setDescription
(UserMessage description) Specifies a message describing the the context or reason for the lock.void
setIgnoreLockReason
(boolean ignoreLockReason) Iftrue
, when unlocking, the initial means of the locking is ignored.void
setOwnerPrivileges
(boolean allPrivileges) Iftrue
, 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.
-
Constructor Details
-
LockSpec
public LockSpec()
-
-
Method Details
-
lock
Locks the specified dataspace.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:
- The user is a "super owner" of the dataspace (see Permissions reference page),
- The user is an administrator,
- The
LockSpec
instance is in asetOwnerPrivileges(boolean)
mode.
-
unlock
Unlocks the specified dataspace.If the dataspace is already unlocked, this method throws an exception.
When dataspace is locked, a user can unlock it if:
- The user is the owner of the lock,
- The user is a "super owner" of the dataspace (see permissions),
- The user is an administrator,
- The
LockSpec
instance is in asetOwnerPrivileges(boolean)
mode.
And if:
- The means used to unlock the dataspace is the same as that used to lock it That is, if it was locked through the user interface, the user interface must also be used to unlock it, or
- The
LockSpec
instance is in asetIgnoreLockReason(boolean)
mode.
Note:
- This method cannot be called inside a procedure execution (because of transaction management restrictions).
- If a parent or child dataspace of the current dataspace has also been locked (for instance, during a merge
procedure),
only the current dataspace will be unlocked. Another
LockSpec
will have to be created to unlock the other dataspace.
-
getDescription
- See Also:
-
setDescription
Specifies a message describing the the context or reason for the lock.This localized message is displayed in the EBX® user interface when the user accesses a dataspace that is locked.
-
setChildBranchCreationAllowed
public void setChildBranchCreationAllowed(boolean childBranchCreationAllowed) Declares that it is possible to create a child dataspace when set totrue
. Default value isfalse
. -
isChildBranchCreationAllowed
public boolean isChildBranchCreationAllowed() -
isOwnerPrivileges
public boolean isOwnerPrivileges()- See Also:
-
setOwnerPrivileges
public void setOwnerPrivileges(boolean allPrivileges) Iftrue
, assumes the current user is either the owner of the dataspace or the owner of the lock (when unlocking). -
isIgnoreLockReason
public boolean isIgnoreLockReason()- See Also:
-
setIgnoreLockReason
public void setIgnoreLockReason(boolean ignoreLockReason) Iftrue
, when unlocking, the initial means of the locking is ignored.
-