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
Modifier and TypeInterfaceDescriptionstatic class
Locking operation options -
Method Summary
Modifier and TypeMethodDescriptionboolean
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, String options) Check if options can be locked.boolean
canBeOptionsUnlocked
(com.nomagic.ci.persistence.IProject project, 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.getDecompositionLock
(com.nomagic.ci.persistence.IProject project) Return decomposition lockgetLockedBy
(String user) Collect all elements locked by given userCollect all elements locked by current userReturns collection of locked elements.Returns collection of locked elements owners in the server.Collect all usages locked by any usergetLockInfo
(ModuleUsage moduleUsage) Return lock information on given usagegetLockInfo
(Element element) Return lock information on given elementgetModulesLockedBy
(String user) Collect all usages locked by given userCollect all usages locked by current usergetOptionsLock
(com.nomagic.ci.persistence.IProject project, String options) Get options lock data.boolean
hasLockedBy
(String user) Checks if there are any locks for specified userboolean
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
Check if element is lockedboolean
isLockedBy
(Element element, 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, String options) Check if given options are locked.boolean
isOptionsLockedByMe
(com.nomagic.ci.persistence.IProject project, String options) Check if options locked by current user.default boolean
lockElements
(Collection<? extends Element> elements, boolean lockRecursively, ProgressStatus status) Lock given elements.boolean
lockElements
(Collection<? extends Element> elements, ILockProjectService.LockOptions options, ProgressStatus status) Lock given elements.default boolean
lockElements
(Collection<? extends Element> elements, ProgressStatus status) Lock given elements.boolean
lockModules
(Collection<ModuleUsage> moduleUsages, boolean checkForNewVersion, boolean lockAsManyAsPossible, ProgressStatus status) Lock given usages.boolean
lockModules
(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, String options, boolean locked, ProgressStatus status) Lock/unlock options.boolean
unlockElements
(Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status) Unlock given elements.boolean
unlockElements
(Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status, boolean unlockOnlyMyLocks) Unlock given elements.boolean
unlockElements
(Collection<? extends Element> elements, boolean unlockRecursively, ProgressStatus status, Collection<Element> elementsToUnlock, boolean unlockOnlyMyLocks) Unlock given elements.boolean
unlockElements
(Collection<? extends Element> elements, ProgressStatus status) Unlock given elements.boolean
unlockElements
(Collection<? extends Element> elements, ProgressStatus status, boolean unlockOnlyMyLocks) Unlock given elements.boolean
unlockModules
(Collection<ModuleUsage> moduleUsages, ProgressStatus status) Unlock given usages.void
updateLocks
(ProgressStatus status) Update local information about locks from server.
-
Method Details
-
isLocked
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
Check if given element is locked by a user- Parameters:
element
- elementuser
- user- Returns:
- true if user has lock on this element
-
getLockInfo
Return lock information on given element- Parameters:
element
- element- Returns:
- lock information or null of element is not locked
-
getLockInfo
Return lock information on given usage- Parameters:
moduleUsage
- module usage- Returns:
- lock information or null of usage is not locked
-
isLocked
Check if usage is locked- Parameters:
moduleUsage
- usage- Returns:
- true is usage is locked
-
isLockedByMe
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
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
Checks if there are any locks for specified user- Parameters:
user
- user- Returns:
true
- when there are locks for specified user, otherwise -
false
-
getLockedBy
Collect all elements locked by given user- Parameters:
user
- user- Returns:
- locked elements
-
getLockedByMe
Collection<Element> getLockedByMe()Collect all elements locked by current user- Returns:
- locked elements
-
getModulesLockedBy
Collect all usages locked by given user- Parameters:
user
- user- Returns:
- locked usages
-
getModulesLockedByMe
Collection<ModuleUsage> getModulesLockedByMe()Collect all usages locked by current user- Returns:
- locked usages
-
getLockedModules
Collection<ModuleUsage> getLockedModules()Collect all usages locked by any user- Returns:
- locked usages
-
canBeLocked
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
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
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
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(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(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(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(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(Collection<? extends Element> elements, boolean unlockRecursively, @CheckForNull ProgressStatus status, 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
Unlock given usages.- Parameters:
moduleUsages
- elementsstatus
- progress status- Returns:
- true if all usages where unlocked
-
lockModules
boolean lockModules(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(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
Update local information about locks from server. In other words retrieve latest locks information from server.- Parameters:
status
- progress
-
getLockedElements
Collection<Element> getLockedElements()Returns collection of locked elements.- Returns:
- locked elements
-
getLockedElementUsers
Collection<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
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
Check if given options are locked.- Parameters:
project
- project.options
- options.- Returns:
- true - locked.
-
isOptionsLockedByMe
Check if options locked by current user.- Parameters:
project
- project.options
- options.- Returns:
- true - locked by current user.
-
canBeOptionsLocked
Check if options can be locked.- Parameters:
project
- project.options
- options.- Returns:
- true if can be locked.
-
canBeOptionsUnlocked
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, 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
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(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(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
Unlock given elements. Children are not unlocked- Parameters:
elements
- elementsstatus
- progress status- Returns:
- true if all elements where unlocked
-
hasPermissionToLock
Check permissions for element.- Parameters:
element
- element to check- Returns:
- true because of not available package permissions
-