com.orchestranetworks.service.extensions
Class LockSpec

java.lang.Object
  extended bycom.orchestranetworks.service.extensions.LockSpec

public class LockSpec
extends Object

Handles a lock over a branch. When locked, a branch can be modified only by the owner of the lock.

The methods to call for locking and unlocking a branch are lock(AdaptationHome, Session) and unlock(AdaptationHome, Session).


Constructor Summary
LockSpec()
           
 
Method Summary
 UserMessage getDescription()
           
 boolean isOwnerPrivileges()
           
 void lock(AdaptationHome aBranch, Session aSession)
          Locks the branch specified.
 void setDescription(UserMessage description)
          Specifies a message describing the purpose or the context of the lock.
 void setOwnerPrivileges(boolean allPrivileges)
          If true, assumes the current user is either the owner of the branch or the owner of the lock (when unlocking).
 void unlock(AdaptationHome aBranch, Session aSession)
          Unlocks the branch specified.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockSpec

public LockSpec()
Method Detail

lock

public void lock(AdaptationHome aBranch,
                 Session aSession)
          throws OperationException
Locks the branch specified.

If branch is already locked, it throws an exception.

Note: this method cannot be called inside a procedure execution (because of transaction management restrictions).

A user can lock a branch if :

Throws:
OperationException
See Also:
SessionPermissions.getHomeActionPermissionToLockHome(LockSpec, AdaptationHome)

unlock

public void unlock(AdaptationHome aBranch,
                   Session aSession)
            throws OperationException
Unlocks the branch specified.

If branch is already unlocked, it throws an exception.

When branch is locked, a user can unlock it if:

Note: this method cannot be called inside a procedure execution (because of transaction management restrictions).

Throws:
OperationException
See Also:
SessionPermissions.getHomeActionPermissionToUnlockHome(LockSpec, AdaptationHome)

getDescription

public UserMessage getDescription()
See Also:
setDescription(UserMessage)

setDescription

public void setDescription(UserMessage description)
Specifies a message describing the purpose or the context of the lock.

This possibly internationalized message is displayed in EBX.Manager when the user accesses to a branch that is locked.


isOwnerPrivileges

public boolean isOwnerPrivileges()
See Also:
setOwnerPrivileges(boolean)

setOwnerPrivileges

public void setOwnerPrivileges(boolean allPrivileges)
If true, assumes the current user is either the owner of the branch or the owner of the lock (when unlocking).



(report a bug)
EBX.Platform 4.5.3 [0607:0001]
Copyright Orchestra Networks 2000-2008. All rights reserved.