java.lang.Object
com.orchestranetworks.service.extensions.LockSpec

public class LockSpec extends Object
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 Details

    • LockSpec

      public LockSpec()
  • Method Details

    • lock

      public void lock(AdaptationHome aDataSpace, Session aSession) throws OperationException
      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:

      Throws:
      OperationException
      See Also:
    • unlock

      public void unlock(AdaptationHome aDataSpace, Session aSession) throws OperationException
      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 a setOwnerPrivileges(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 a setIgnoreLockReason(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.
      Throws:
      OperationException
      See Also:
    • getDescription

      public UserMessage getDescription()
      See Also:
    • setDescription

      public void setDescription(UserMessage description)
      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 to true. Default value is false.
    • isChildBranchCreationAllowed

      public boolean isChildBranchCreationAllowed()
    • isOwnerPrivileges

      public boolean isOwnerPrivileges()
      See Also:
    • setOwnerPrivileges

      public 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).
    • isIgnoreLockReason

      public boolean isIgnoreLockReason()
      See Also:
    • setIgnoreLockReason

      public void setIgnoreLockReason(boolean ignoreLockReason)
      If true, when unlocking, the initial means of the locking is ignored.