public interface IlrLockingFacility
The objects of type project element IlrProjectElement can be locked by users.
When an object is locked by a user A, user B cannot edit nor delete nor lock this object.
When the locked object is a rule package, all its contained project elements (rules, decision table, ruleflows, and so on)
are also locked. On user request, all the subpackages of a package can also be locked.
This package is then called the root lock, and all the content and subpackages are locked until this root lock is
unlocked. You cannot unlock an element that is not a root lock.
IlrSession| Modifier and Type | Method and Description |
|---|---|
void |
checkIsElementBusy(IlrElementHandle element)
Throws an exception if the given element is locked by another user.
|
void |
clearAllLocks()
Clears all persistent and non-persistent locks of the table.
|
void |
clearNonPersistentLocks()
Clears all non-persistent locks.
|
java.lang.String |
getLockOwner(IlrElementHandle element)
Returns the name of the user who owns the lock.
|
IlrElementHandle |
getRootLockedElementForElement(IlrElementHandle element)
Returns the root lock for the given element.
|
boolean |
isElementBusy(IlrBaseline baseline,
IlrElementHandle element)
Returns true if this element is locked by a user different from the current one, in the provided baseline.
|
boolean |
isElementBusy(IlrElementHandle element)
Returns true if this element is locked by a user different from the current one.
|
boolean |
isPersistentLock(IlrElementHandle element)
Indicates whether the lock on the given element is persistent or not.
|
void |
lockBranches(IlrBaseline branch)
Locks the whole branch given as a parameter, and the working branch.
|
void |
lockElement(IlrElementHandle element)
Locks the given element.
|
void |
lockElement(IlrElementHandle element,
boolean persistent,
boolean recursive)
Locks the given element.
|
void |
lockElements(java.util.List<? extends IlrElementHandle> elements,
boolean persistent,
boolean recursive)
Locks the list of elements.
|
boolean |
ownsLock(IlrElementHandle element)
Returns true if this element is locked by the current user.
|
void |
releaseElementLock(IlrElementHandle element)
Forces the unlocking of the given element.
|
void |
releaseElementLocks(java.util.List<? extends IlrElementHandle> elements)
Forces the unlocking of the given elements.
|
void |
releaseNonPersistentLocks()
Releases all non-persistent locks that were created by the current user.
|
void |
unlockBranches(IlrBaseline branch)
Releases the branch locks that were created with the lockBranches(IlrBaseline) function.
|
void |
unlockElement(IlrElementHandle element)
Unlocks the given element.
|
void |
unlockElements(java.util.List<? extends IlrElementHandle> elements)
Unlocks the given list of elements.
|
void lockElement(IlrElementHandle element) throws IlrObjectNotFoundException, IlrObjectLockedException, IlrObjectNotRootLockException, IlrPermissionException, IlrFrozenBaselineException
If the element is a rule package, all project elements contained in this package will be locked (rules, decision tables, ruleflows, and so on). However the subpackages will not be locked.
This method is equivalent to lockElement(elt, false, false).
IlrObjectNotFoundException - If the element to lock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrObjectNotRootLockException - If the element to lock is locked by the user and is not the root lock.IlrFrozenBaselineException - TODOIlrPermissionExceptionelement - Handle on the element to lock.void lockElement(IlrElementHandle element, boolean persistent, boolean recursive) throws IlrObjectNotFoundException, IlrObjectLockedException, IlrObjectNotRootLockException, IlrPermissionException, IlrFrozenBaselineException
If the element is a rule package, all project elements contained in this package will be locked (rules, decision
tables, ruleflows, and so on). However the subpackages will not be locked unless the recursive flag is
true.
IlrObjectNotFoundException - If the element to lock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrObjectNotRootLockException - If the element to lock is locked by the user and is not the root lock.IlrFrozenBaselineException - TODOIlrPermissionExceptionelement - Handle on the element to lock.persistent - If true, the lock is not released when the session expires.recursive - If true and if the element is a rule package, then all its subpackages will be locked.void unlockElement(IlrElementHandle element) throws IlrObjectNotFoundException, IlrObjectLockedException, IlrObjectNotLockedException, IlrObjectNotRootLockException, IlrPermissionException, IlrFrozenBaselineException
IlrObjectNotFoundException - If the element to unlock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrObjectNotLockedException - If the object to unlock is not locked.IlrObjectNotRootLockException - If the element to lock is locked by the user and is not the root lock.IlrFrozenBaselineException - TODOIlrPermissionExceptionelement - Handle on the element to unlock.void lockBranches(IlrBaseline branch) throws IlrObjectLockedException, IlrInvalidElementException, IlrFrozenBaselineException, ilog.rules.teamserver.model.IlrAPIException, IlrApplicationException
IlrObjectLockedException - if any element of the project is already locked by someone else.IlrInvalidElementException - if the argument or the working branch is null.IlrFrozenBaselineException - if the argument or the working branch is not a branch.IlrApplicationExceptionilog.rules.teamserver.model.IlrAPIExceptionbranch - the second branch to lock.void unlockBranches(IlrBaseline branch) throws IlrFrozenBaselineException, IlrInvalidElementException, IlrObjectNotFoundException, IlrObjectLockedException, IlrObjectNotLockedException, IlrObjectNotRootLockException, IlrPermissionException
IlrInvalidElementException - if the argument or the working branch is null.IlrPermissionExceptionIlrObjectNotRootLockExceptionIlrObjectNotLockedExceptionIlrObjectLockedExceptionIlrObjectNotFoundExceptionIlrFrozenBaselineExceptionvoid releaseNonPersistentLocks()
Non-persistent locks should be released automatically when the session is closed. However, in case of a system failure, this automatic cleaning may not be executed. In those cases, the locks will remain active, and cannot be cleared by the user through a new session. This function should be used in such circumstances.
boolean ownsLock(IlrElementHandle element) throws IlrObjectNotFoundException, IlrApplicationException
IlrObjectNotFoundException - If the given element cannot be found.IlrApplicationExceptionelement - Handle on the element to test.boolean isElementBusy(IlrElementHandle element) throws IlrObjectNotFoundException, IlrApplicationException
IlrObjectNotFoundException - If the given element cannot be found.IlrApplicationExceptionelement - Handle on the element to test.boolean isElementBusy(IlrBaseline baseline, IlrElementHandle element) throws IlrObjectNotFoundException, IlrApplicationException
IlrObjectNotFoundException - If the given element cannot be found.IlrApplicationExceptionbaseline - The baseline in which to test.element - Handle on the element to test.java.lang.String getLockOwner(IlrElementHandle element) throws IlrObjectNotFoundException, IlrApplicationException
IlrObjectNotFoundException - If the given element cannot be found.IlrApplicationExceptionelement - Handle on a locked element.IlrElementHandle getRootLockedElementForElement(IlrElementHandle element) throws IlrObjectNotFoundException
IlrObjectNotFoundException - If the given element cannot be found.element - Handle on a package element or a rule package.null if the element is not locked.void clearAllLocks()
This method can be called by the administrator only.
void clearNonPersistentLocks()
Typically, this method can be called after a server crash that would prevent the session end to automatically release the non-persistent locks.
This method can be called by the administrator only.
boolean isPersistentLock(IlrElementHandle element) throws IlrApplicationException
IlrApplicationExceptionelement - Handle on a package element or a rule package.void checkIsElementBusy(IlrElementHandle element) throws IlrObjectLockedException, IlrObjectNotFoundException, IlrApplicationException
IlrObjectLockedException - If the element is locked by someone else.IlrObjectNotFoundException - If the given element cannot be found in the database.IlrApplicationExceptionelement - Handle on the element to test.void lockElements(java.util.List<? extends IlrElementHandle> elements, boolean persistent, boolean recursive) throws IlrObjectNotFoundException, IlrObjectLockedException, IlrFrozenBaselineException, IlrObjectNotRootLockException, IlrPermissionException
IlrObjectNotFoundException - If the element to lock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrFrozenBaselineException - If the working baseline is not frozen.IlrObjectNotRootLockException - If the element to lock is locked by the user and is not the root lock.IlrPermissionExceptionelements - A list of element handles (IlrElementHandle).persistent - If true, the lock is not released when the session expires.recursive - If true and if the element is a rule package, then all its subpackages will be locked.void unlockElements(java.util.List<? extends IlrElementHandle> elements) throws IlrObjectNotFoundException, IlrObjectLockedException, IlrObjectNotLockedException, IlrObjectNotRootLockException, IlrPermissionException, IlrFrozenBaselineException
IlrObjectNotFoundException - If the element to unlock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrObjectNotLockedException - If the object to unlock is not locked.IlrObjectNotRootLockException - If the element to unlock is locked by the user and is not the root lock.IlrFrozenBaselineException - TODOIlrPermissionExceptionelements - A list of element handles (IlrElementHandle).void releaseElementLock(IlrElementHandle element) throws IlrApplicationException
IlrPermissionException - If the current user is not an administrator.IlrObjectNotFoundException - If the element to unlock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrFrozenBaselineException - If the working baseline is not frozen.IlrObjectNotRootLockException - If the element to unlock is locked by the user and is not the root lock.IlrObjectNotLockedException - If the object to unlock is not locked.IlrApplicationExceptionelement - Handle on an element to unlock.void releaseElementLocks(java.util.List<? extends IlrElementHandle> elements) throws IlrApplicationException
IlrPermissionException - If the current user is not an administrator.IlrObjectNotFoundException - If the element to unlock cannot be found in the database.IlrObjectLockedException - If the element is already locked by someone else.IlrFrozenBaselineException - If the working baseline is not frozen.IlrObjectNotRootLockException - If the element to unlock is locked by the user and is not the root lock.IlrObjectNotLockedException - If the object to unlock is not locked.IlrApplicationExceptionelements - List of element handles (IlrElementHandle).© Copyright IBM Corp. 1987, 2017