org.apache.jackrabbit.webdav.lock
Class SimpleLockManager

java.lang.Object
  extended by org.apache.jackrabbit.webdav.lock.SimpleLockManager
All Implemented Interfaces:
LockManager

public class SimpleLockManager
extends Object
implements LockManager

Simple manager for webdav locks.


Constructor Summary
SimpleLockManager()
           
 
Method Summary
 ActiveLock createLock(LockInfo lockInfo, DavResource resource)
          Adds the lock for the given resource, replacing any existing lock.
 ActiveLock getLock(Type type, Scope scope, DavResource resource)
          Returns the lock applying to the given resource or null if no lock can be found.
 boolean hasLock(String lockToken, DavResource resource)
          Returns true, if the the manager contains a lock for the given resource, that is hold by the specified token.
 ActiveLock refreshLock(LockInfo lockInfo, String lockToken, DavResource resource)
          Refresh the lock identified by the given lockToken and initially created on the specified resouce.
 void releaseLock(String lockToken, DavResource resource)
          Remove the lock hold by the given resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleLockManager

public SimpleLockManager()
Method Detail

hasLock

public boolean hasLock(String lockToken,
                       DavResource resource)
Description copied from interface: LockManager
Returns true, if the the manager contains a lock for the given resource, that is hold by the specified token.

Specified by:
hasLock in interface LockManager
Parameters:
lockToken -
resource -
Returns:
See Also:
LockManager.hasLock(String, org.apache.jackrabbit.webdav.DavResource)

getLock

public ActiveLock getLock(Type type,
                          Scope scope,
                          DavResource resource)
Returns the lock applying to the given resource or null if no lock can be found.

Specified by:
getLock in interface LockManager
Parameters:
type -
scope -
resource -
Returns:
lock that applies to the given resource or null.

createLock

public ActiveLock createLock(LockInfo lockInfo,
                             DavResource resource)
                      throws DavException
Adds the lock for the given resource, replacing any existing lock.

Specified by:
createLock in interface LockManager
Parameters:
lockInfo -
resource - being the lock holder
Returns:
Throws:
DavException

refreshLock

public ActiveLock refreshLock(LockInfo lockInfo,
                              String lockToken,
                              DavResource resource)
                       throws DavException
Description copied from interface: LockManager
Refresh the lock identified by the given lockToken and initially created on the specified resouce. The update information can be retrieved from the lockInfo object passes.

Specified by:
refreshLock in interface LockManager
Parameters:
lockInfo -
lockToken -
resource -
Returns:
Throws:
DavException
See Also:
DavResource.refreshLock(org.apache.jackrabbit.webdav.lock.LockInfo, String)

releaseLock

public void releaseLock(String lockToken,
                        DavResource resource)
                 throws DavException
Remove the lock hold by the given resource.

Specified by:
releaseLock in interface LockManager
Parameters:
lockToken -
resource - that is the lock holder
Throws:
DavException


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.