Interface ILockProjectService
-
- All Known Implementing Classes:
LockService
@OpenApiAll public interface ILockProjectService
Project data locking service. Provides api to check, request and release locks on various project data
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ILockProjectService.LockOptions
Locking operation options
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
canBeDecompositionLocked(com.nomagic.ci.persistence.IProject project)
Check if project decomposition can be locked by current userboolean
canBeDecompositionUnlocked(com.nomagic.ci.persistence.IProject project)
Check if project decomposition can be unlocked by current userboolean
canBeLocked(ModuleUsage moduleUsage)
Check if given usage can be locked by current user.boolean
canBeLocked(Element element)
Check if given element can be locked by current user.boolean
canBeOptionsLocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options can be locked.boolean
canBeOptionsUnlocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options can be unlocked.boolean
canBeUnlocked(ModuleUsage moduleUsage)
Check if given usage can be unlocked by current user.boolean
canBeUnlocked(Element element)
Check if given element can be unlocked by current user.LockInfo
getDecompositionLock(com.nomagic.ci.persistence.IProject project)
Return decomposition lockjava.util.Collection<Element>
getLockedBy(java.lang.String user)
Collect all elements locked by given userjava.util.Collection<Element>
getLockedByMe()
Collect all elements locked by current userjava.util.Collection<Element>
getLockedElements()
Returns collection of locked elements.java.util.Collection<java.lang.String>
getLockedElementUsers()
Returns collection of locked elements owners in the server.java.util.Collection<ModuleUsage>
getLockedModules()
Collect all usages locked by any userLockInfo
getLockInfo(ModuleUsage moduleUsage)
Return lock information on given usageLockInfo
getLockInfo(Element element)
Return lock information on given elementjava.util.Collection<ModuleUsage>
getModulesLockedBy(java.lang.String user)
Collect all usages locked by given userjava.util.Collection<ModuleUsage>
getModulesLockedByMe()
Collect all usages locked by current userLockInfo
getOptionsLock(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Get options lock data.boolean
hasLockedBy(java.lang.String user)
Checks if there are any locks for specified userboolean
hasLockedElements()
Check if project has some locked databoolean
hasPermissionToLock(Element element)
Check permissions for element.boolean
isDecompositionLocked(com.nomagic.ci.persistence.IProject project)
Check if decomposition model is lockedboolean
isDecompositionLockedByMe(com.nomagic.ci.persistence.IProject project)
Checks for decomposition model lockboolean
isLocked(ModuleUsage moduleUsage)
Check if usage is lockedboolean
isLocked(Element element)
Check if element is lockedboolean
isLockedBy(Element element, java.lang.String user)
Check if given element is locked by a userboolean
isLockedByMe(ModuleUsage moduleUsage)
Check if the given usage has lock on it, and this lock owner is current user.boolean
isLockedByMe(Element element)
Check if the given element has lock on it, and this lock owner is current user.boolean
isOptionsLocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if given options are locked.boolean
isOptionsLockedByMe(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options locked by current user.default boolean
lockElements(java.util.Collection<? extends Element> elements, boolean lockRecursively, ProgressStatus status)
Lock given elements.boolean
lockElements(java.util.Collection<? extends Element> elements, ILockProjectService.LockOptions options, ProgressStatus status)
Lock given elements.default boolean
lockElements(java.util.Collection<? extends Element> elements, ProgressStatus status)
Lock given elements.boolean
lockModules(java.util.Collection<ModuleUsage> moduleUsages, boolean checkForNewVersion, boolean lockAsManyAsPossible, ProgressStatus status)
Lock given usages.boolean
lockModules(java.util.Collection<ModuleUsage> moduleUsages, boolean checkForNewVersion, ProgressStatus status)
Lock given usages.void
setCacheOptionsLock(boolean value)
Sets whether options lock should be cached or not.boolean
setDecompositionLockedByMe(com.nomagic.ci.persistence.IProject project, boolean locked, ProgressStatus status)
Lock/Unlock decomposition model.boolean
setOptionsLockedByMe(com.nomagic.ci.persistence.IProject project, java.lang.String options, boolean locked, ProgressStatus status)
Lock/unlock options.boolean
unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status)
Unlock given elements.boolean
unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status, boolean unlockOnlyMyLocks)
Unlock given elements.boolean
unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status, java.util.Collection<Element> elementsToUnlock, boolean unlockOnlyMyLocks)
Unlock given elements.boolean
unlockElements(java.util.Collection<? extends Element> elements, ProgressStatus status)
Unlock given elements.boolean
unlockElements(java.util.Collection<? extends Element> elements, ProgressStatus status, boolean unlockOnlyMyLocks)
Unlock given elements.boolean
unlockModules(java.util.Collection<ModuleUsage> moduleUsages, ProgressStatus status)
Unlock given usages.void
updateLocks(ProgressStatus status)
Update local information about locks from server.
-
-
-
Method Detail
-
isLocked
boolean isLocked(Element element)
Check if element is locked- Parameters:
element
- element- Returns:
- true if element is locked
-
hasLockedElements
boolean hasLockedElements()
Check if project has some locked data- Returns:
- true if locked data exists in project
-
isLockedBy
boolean isLockedBy(Element element, java.lang.String user)
Check if given element is locked by a user- Parameters:
element
- elementuser
- user- Returns:
- true if user has lock on this element
-
getLockInfo
@CheckForNull LockInfo getLockInfo(Element element)
Return lock information on given element- Parameters:
element
- element- Returns:
- lock information or null of element is not locked
-
getLockInfo
LockInfo getLockInfo(ModuleUsage moduleUsage)
Return lock information on given usage- Parameters:
moduleUsage
- module usage- Returns:
- lock information or null of usage is not locked
-
isLocked
boolean isLocked(ModuleUsage moduleUsage)
Check if usage is locked- Parameters:
moduleUsage
- usage- Returns:
- true is usage is locked
-
isLockedByMe
boolean isLockedByMe(Element element)
Check if the given element has lock on it, and this lock owner is current user.- Parameters:
element
- element to check for locked user.- Returns:
- true when given element is locked by the current user.
-
isLockedByMe
boolean isLockedByMe(ModuleUsage moduleUsage)
Check if the given usage has lock on it, and this lock owner is current user.- Parameters:
moduleUsage
- usage to check for locked user.- Returns:
- true when given usage is locked by the current user.
-
hasLockedBy
boolean hasLockedBy(java.lang.String user)
Checks if there are any locks for specified user- Parameters:
user
- user- Returns:
true
- when there are locks for specified user, otherwise -
false
-
getLockedBy
java.util.Collection<Element> getLockedBy(java.lang.String user)
Collect all elements locked by given user- Parameters:
user
- user- Returns:
- locked elements
-
getLockedByMe
java.util.Collection<Element> getLockedByMe()
Collect all elements locked by current user- Returns:
- locked elements
-
getModulesLockedBy
java.util.Collection<ModuleUsage> getModulesLockedBy(@CheckForNull java.lang.String user)
Collect all usages locked by given user- Parameters:
user
- user- Returns:
- locked usages
-
getModulesLockedByMe
java.util.Collection<ModuleUsage> getModulesLockedByMe()
Collect all usages locked by current user- Returns:
- locked usages
-
getLockedModules
java.util.Collection<ModuleUsage> getLockedModules()
Collect all usages locked by any user- Returns:
- locked usages
-
canBeLocked
boolean canBeLocked(Element element)
Check if given element can be locked by current user. Includes checking resource lock, granularity, user rights and if object is locked already.- Parameters:
element
- element- Returns:
- true if user can lock given element.
-
canBeUnlocked
boolean canBeUnlocked(Element element)
Check if given element can be unlocked by current user. Includes checking resource lock, granularity, user rights and if object is locked already.- Parameters:
element
- element- Returns:
- true if user can unlock given element.
-
canBeLocked
boolean canBeLocked(ModuleUsage moduleUsage)
Check if given usage can be locked by current user. Includes checking resource lock, granularity, user rights and if object is locked already.- Parameters:
moduleUsage
- usage- Returns:
- true if user can lock given usage.
-
canBeUnlocked
boolean canBeUnlocked(ModuleUsage moduleUsage)
Check if given usage can be unlocked by current user. Includes checking resource lock, granularity, user rights and if object is locked already.- Parameters:
moduleUsage
- usage- Returns:
- true if user can unlock given usage.
-
lockElements
default boolean lockElements(java.util.Collection<? extends Element> elements, boolean lockRecursively, @CheckForNull ProgressStatus status)
Lock given elements. Can lock children of given elements also.- Parameters:
elements
- elementslockRecursively
- lock children recursivelystatus
- progress status- Returns:
- true if all given elements where locked
-
lockElements
default boolean lockElements(java.util.Collection<? extends Element> elements, @CheckForNull ProgressStatus status)
Lock given elements. Children are not locked- Parameters:
elements
- elementsstatus
- progress status- Returns:
- true if all elements where locked
-
lockElements
boolean lockElements(java.util.Collection<? extends Element> elements, ILockProjectService.LockOptions options, @CheckForNull ProgressStatus status)
Lock given elements. Children are not locked- Parameters:
elements
- elementsstatus
- progress statusoptions
- lock operation options- Returns:
- true if all elements where locked
-
unlockElements
boolean unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, @CheckForNull ProgressStatus status, boolean unlockOnlyMyLocks)
Unlock given elements. Can unlock children of given elements also.- Parameters:
elements
- elementsunlockRecursively
- children recursivelystatus
- progress statusunlockOnlyMyLocks
- unlock only my locked elements (used for ESI projects)- Returns:
- true if all given elements where unlocked
-
unlockElements
boolean unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, @CheckForNull ProgressStatus status, java.util.Collection<Element> elementsToUnlock, boolean unlockOnlyMyLocks)
Unlock given elements. Can unlock children of given elements also.- Parameters:
elements
- elementsunlockRecursively
- children recursivelystatus
- progress statuselementsToUnlock
- elements to unlockunlockOnlyMyLocks
- unlock only my locked elements (used for ESI projects)- Returns:
- true if all given elements where unlocked
-
unlockModules
boolean unlockModules(java.util.Collection<ModuleUsage> moduleUsages, @CheckForNull ProgressStatus status)
Unlock given usages.- Parameters:
moduleUsages
- elementsstatus
- progress status- Returns:
- true if all usages where unlocked
-
lockModules
boolean lockModules(java.util.Collection<ModuleUsage> moduleUsages, boolean checkForNewVersion, @CheckForNull ProgressStatus status)
Lock given usages.- Parameters:
moduleUsages
- elementscheckForNewVersion
- check if new project version exists on server before lockingstatus
- progress status- Returns:
- true if all usages where locked
-
lockModules
boolean lockModules(java.util.Collection<ModuleUsage> moduleUsages, boolean checkForNewVersion, boolean lockAsManyAsPossible, @CheckForNull ProgressStatus status)
Lock given usages.- Parameters:
moduleUsages
- elementscheckForNewVersion
- check if new project version exists on server before lockinglockAsManyAsPossible
- stop without locking any usages if there is at least one usage which cannot be lockedstatus
- progress status- Returns:
- true if all usages where locked
-
updateLocks
void updateLocks(@CheckForNull ProgressStatus status)
Update local information about locks from server. In other words retrieve latest locks information from server.- Parameters:
status
- progress
-
getLockedElements
java.util.Collection<Element> getLockedElements()
Returns collection of locked elements.- Returns:
- locked elements
-
getLockedElementUsers
java.util.Collection<java.lang.String> getLockedElementUsers()
Returns collection of locked elements owners in the server.- Returns:
- users whose have locked elements in the server
-
isDecompositionLockedByMe
boolean isDecompositionLockedByMe(com.nomagic.ci.persistence.IProject project)
Checks for decomposition model lock- Parameters:
project
- project which decomposition model is locked- Returns:
- true if given project decomposition model is locked by me
-
isDecompositionLocked
boolean isDecompositionLocked(com.nomagic.ci.persistence.IProject project)
Check if decomposition model is locked- Parameters:
project
- project- Returns:
- true if decomposition is locked by any user
-
setDecompositionLockedByMe
boolean setDecompositionLockedByMe(com.nomagic.ci.persistence.IProject project, boolean locked, @CheckForNull ProgressStatus status)
Lock/Unlock decomposition model.- Parameters:
project
- project which decomposition model is lockedlocked
- new lock valuestatus
- progress status- Returns:
- true if decomposition is locked by me
-
getDecompositionLock
LockInfo getDecompositionLock(com.nomagic.ci.persistence.IProject project)
Return decomposition lock- Parameters:
project
- project- Returns:
- lock or null
-
canBeDecompositionLocked
boolean canBeDecompositionLocked(com.nomagic.ci.persistence.IProject project)
Check if project decomposition can be locked by current user- Parameters:
project
- project- Returns:
- true if can be locked
-
canBeDecompositionUnlocked
boolean canBeDecompositionUnlocked(com.nomagic.ci.persistence.IProject project)
Check if project decomposition can be unlocked by current user- Parameters:
project
- project- Returns:
- true if can be unlocked
-
isOptionsLocked
boolean isOptionsLocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if given options are locked.- Parameters:
project
- project.options
- options.- Returns:
- true - locked.
-
isOptionsLockedByMe
boolean isOptionsLockedByMe(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options locked by current user.- Parameters:
project
- project.options
- options.- Returns:
- true - locked by current user.
-
canBeOptionsLocked
boolean canBeOptionsLocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options can be locked.- Parameters:
project
- project.options
- options.- Returns:
- true if can be locked.
-
canBeOptionsUnlocked
boolean canBeOptionsUnlocked(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Check if options can be unlocked.- Parameters:
project
- project.options
- options.- Returns:
- true if can be unlocked.
-
setOptionsLockedByMe
boolean setOptionsLockedByMe(com.nomagic.ci.persistence.IProject project, java.lang.String options, boolean locked, @CheckForNull ProgressStatus status)
Lock/unlock options.- Parameters:
project
- project.options
- optionlocked
- true to lock, false to unlockstatus
- status.- Returns:
- true if operation succeeds.
-
getOptionsLock
@CheckForNull LockInfo getOptionsLock(com.nomagic.ci.persistence.IProject project, java.lang.String options)
Get options lock data.- Parameters:
project
- projectoptions
- options- Returns:
- lock.
-
setCacheOptionsLock
void setCacheOptionsLock(boolean value)
Sets whether options lock should be cached or not.- Parameters:
value
- if true then options lock should be cached on the first call.
-
unlockElements
boolean unlockElements(java.util.Collection<? extends Element> elements, ProgressStatus status, boolean unlockOnlyMyLocks)
Unlock given elements. Can unlock children of given elements also.- Parameters:
elements
- elementsstatus
- progress statusunlockOnlyMyLocks
- unlock only my locked elements (used for ESI projects)- Returns:
- true if all given elements where unlocked
-
unlockElements
boolean unlockElements(java.util.Collection<? extends Element> elements, boolean unlockRecursively, @CheckForNull ProgressStatus status)
Unlock given elements. Can unlock children of given elements also.- Parameters:
elements
- elementsunlockRecursively
- children recursivelystatus
- progress status- Returns:
- true if all given elements where unlocked
-
unlockElements
boolean unlockElements(java.util.Collection<? extends Element> elements, @CheckForNull ProgressStatus status)
Unlock given elements. Children are not unlocked- Parameters:
elements
- elementsstatus
- progress status- Returns:
- true if all elements where unlocked
-
hasPermissionToLock
boolean hasPermissionToLock(Element element)
Check permissions for element.- Parameters:
element
- element to check- Returns:
- true because of not available package permissions
-
-