org.opencms.lock
Class CmsLockFilter

java.lang.Object
  extended by 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
Version:
$Revision: 1.2 $
Author:
Michael Moossen

Field Summary
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
 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 getTypes()
          Returns the types to filter.
 boolean isIncludeChildren()
          Returns the include children flag.
 boolean isIncludeParent()
          Returns the include parents flag.
 boolean isSharedExclusive()
          Returns the true 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 class java.lang.Object
See Also:
Object.clone()

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

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

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

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

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

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

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

getOwnedByUserId

public CmsUUID getOwnedByUserId()
Returns the user that has to own the locks.

Returns:
the user that has to own 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

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

getProjectId

public CmsUUID getProjectId()
Returns the project restriction.

Returns:
the project restriction

getTypes

public java.util.Set 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 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()