Class 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
    • Method Detail

      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.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<CmsLockTypegetTypes()
        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 the true 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 against
        lock - the lock to match
        Returns:
        true if the given lock matches
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.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 against
        lock - the lock to match
        isRelatedCheck - if we are currently in the recursive call for the related lock
        Returns:
        true if the given lock matches