Package org.opencms.lock
Class CmsLockFilter
- java.lang.Object
-
- org.opencms.lock.CmsLockFilter
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class CmsLockFilter extends java.lang.Object implements java.lang.Cloneable
A filter to retrieve the locks.- Since:
- 6.5.4
-
-
Field Summary
Fields Modifier and Type Field Description static CmsLockFilter
FILTER_ALL
To filter all locks.static CmsLockFilter
FILTER_INHERITED
To filter all inherited locks.static CmsLockFilter
FILTER_NON_INHERITED
To filter all non inherited locks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
CmsLockFilter
filterIncludeChildren()
Returns an extended filter that will extend the result to the given path and all its children.CmsLockFilter
filterIncludeParents()
Returns an extended filter that will extend the result to the given path and all its parents.CmsLockFilter
filterLockableByUser(CmsUser user)
Returns an extended filter with the given user restriction.CmsLockFilter
filterNotLockableByUser(CmsUser user)
Returns an extended filter with the given user restriction.CmsLockFilter
filterNotOwnedByUserId(CmsUUID userId)
Returns an extended filter with the given user restriction.CmsLockFilter
filterOwnedByUserId(CmsUUID userId)
Returns an extended filter with the given user restriction.CmsLockFilter
filterProject(CmsUUID projectId)
Returns an extended filter with the given project restriction.CmsLockFilter
filterSharedExclusive()
Returns an extended filter that also matches shared exclusive locks (siblings).CmsLockFilter
filterType(CmsLockType type)
Returns an extended filter with the given type restriction.CmsUser
getLockableByUserId()
Returns the user that can overwrite the locks.CmsUser
getNotLockableByUserId()
Returns the user that can not overwrite the locks.CmsUUID
getNotOwnedByUserId()
Returns the user that has not to own the locks.CmsUUID
getOwnedByUserId()
Returns the user that has to own the locks.CmsUUID
getProjectId()
Returns the project restriction.java.util.Set<CmsLockType>
getTypes()
Returns the types to filter.boolean
isIncludeChildren()
Returns the include children flag.boolean
isIncludeParent()
Returns the include parents flag.boolean
isSharedExclusive()
Returns thetrue
if this filter also matches shared exclusive locks.boolean
match(java.lang.String rootPath, CmsLock lock)
Matches the given lock against this filter and the given path.protected boolean
match(java.lang.String rootPath, CmsLock lock, boolean isRelatedCheck)
Matches the given lock against this filter and the given path.java.lang.String
toString()
-
-
-
Field Detail
-
FILTER_ALL
public static final CmsLockFilter FILTER_ALL
To filter all locks.
-
FILTER_INHERITED
public static final CmsLockFilter FILTER_INHERITED
To filter all inherited locks.
-
FILTER_NON_INHERITED
public static final CmsLockFilter FILTER_NON_INHERITED
To filter all non inherited locks.
-
-
Method Detail
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
- See Also:
Object.clone()
-
filterIncludeChildren
public CmsLockFilter filterIncludeChildren()
Returns an extended filter that will extend the result to the given path and all its children.- Returns:
- an extended filter to search the subresources of the given path
-
filterIncludeParents
public CmsLockFilter filterIncludeParents()
Returns an extended filter that will extend the result to the given path and all its parents.- Returns:
- an extended filter to search the subresources of the given path
-
filterLockableByUser
public CmsLockFilter filterLockableByUser(CmsUser user)
Returns an extended filter with the given user restriction.- Parameters:
user
- the user to filter- Returns:
- an extended filter with the given user restriction
-
filterNotLockableByUser
public CmsLockFilter filterNotLockableByUser(CmsUser user)
Returns an extended filter with the given user restriction.- Parameters:
user
- the user to filter- Returns:
- an extended filter with the given user restriction
-
filterNotOwnedByUserId
public CmsLockFilter filterNotOwnedByUserId(CmsUUID userId)
Returns an extended filter with the given user restriction.- Parameters:
userId
- the user id to filter- Returns:
- an extended filter with the given user restriction
-
filterOwnedByUserId
public CmsLockFilter filterOwnedByUserId(CmsUUID userId)
Returns an extended filter with the given user restriction.- Parameters:
userId
- the user id to filter- Returns:
- an extended filter with the given user restriction
-
filterProject
public CmsLockFilter filterProject(CmsUUID projectId)
Returns an extended filter with the given project restriction.- Parameters:
projectId
- the project to filter the locks with- Returns:
- an extended filter with the given project restriction
-
filterSharedExclusive
public CmsLockFilter filterSharedExclusive()
Returns an extended filter that also matches shared exclusive locks (siblings).- Returns:
- an extended filter that also matches shared exclusive locks
-
filterType
public CmsLockFilter filterType(CmsLockType type)
Returns an extended filter with the given type restriction.- Parameters:
type
- the lock type to filter- Returns:
- an extended filter with the given type restriction
-
getLockableByUserId
public CmsUser getLockableByUserId()
Returns the user that can overwrite the locks.- Returns:
- the user that can overwrite the locks
-
getNotLockableByUserId
public CmsUser getNotLockableByUserId()
Returns the user that can not overwrite the locks.- Returns:
- the user that can not overwrite the locks
-
getNotOwnedByUserId
public CmsUUID getNotOwnedByUserId()
Returns the user that has not to own the locks.- Returns:
- the user that has not to own the locks
-
getOwnedByUserId
public CmsUUID getOwnedByUserId()
Returns the user that has to own the locks.- Returns:
- the user that has to own the locks
-
getProjectId
public CmsUUID getProjectId()
Returns the project restriction.- Returns:
- the project restriction
-
getTypes
public java.util.Set<CmsLockType> getTypes()
Returns the types to filter.- Returns:
- the types to filter
-
isIncludeChildren
public boolean isIncludeChildren()
Returns the include children flag.- Returns:
- if set the filter extends the result to the given path and all its children
-
isIncludeParent
public boolean isIncludeParent()
Returns the include parents flag.- Returns:
- if set the filter extends the result to the given path and all its parents
-
isSharedExclusive
public boolean isSharedExclusive()
Returns thetrue
if this filter also matches shared exclusive locks.- Returns:
- the
true
if this filter also matches shared exclusive locks
-
match
public boolean match(java.lang.String rootPath, CmsLock lock)
Matches the given lock against this filter and the given path.- Parameters:
rootPath
- the path to match the lock againstlock
- the lock to match- Returns:
true
if the given lock matches
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
match
protected boolean match(java.lang.String rootPath, CmsLock lock, boolean isRelatedCheck)
Matches the given lock against this filter and the given path.- Parameters:
rootPath
- the path to match the lock againstlock
- the lock to matchisRelatedCheck
- if we are currently in the recursive call for the related lock- Returns:
true
if the given lock matches
-
-