com.bradmcevoy.http
Interface LockableResource

All Superinterfaces:
Resource
All Known Subinterfaces:
LockingCollectionResource, LockNullResource

public interface LockableResource
extends Resource

webDAV LOCK You should also implement LockingCollectionResource on your collections for full locking support

Author:
brad

Method Summary
 LockToken getCurrentLock()
           
 LockResult lock(LockTimeout timeout, LockInfo lockInfo)
          Lock this resource and return a token
 LockResult refreshLock(java.lang.String token)
          Renew the lock and return new lock info
 void unlock(java.lang.String tokenId)
          If the resource is currently locked, and the tokenId matches the current one, unlock the resource
 
Methods inherited from interface com.bradmcevoy.http.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
 

Method Detail

lock

LockResult lock(LockTimeout timeout,
                LockInfo lockInfo)
                throws NotAuthorizedException,
                       PreConditionFailedException,
                       LockedException
Lock this resource and return a token

Parameters:
timeout - - in seconds, or null
lockInfo -
Returns:
- a result containing the token representing the lock if succesful, otherwise a failure reason code
Throws:
NotAuthorizedException
PreConditionFailedException
LockedException

refreshLock

LockResult refreshLock(java.lang.String token)
                       throws NotAuthorizedException,
                              PreConditionFailedException
Renew the lock and return new lock info

Parameters:
token -
Returns:
Throws:
NotAuthorizedException
PreConditionFailedException

unlock

void unlock(java.lang.String tokenId)
            throws NotAuthorizedException,
                   PreConditionFailedException
If the resource is currently locked, and the tokenId matches the current one, unlock the resource

Parameters:
tokenId -
Throws:
NotAuthorizedException
PreConditionFailedException

getCurrentLock

LockToken getCurrentLock()
Returns:
- the current lock, if the resource is locked, or null


Copyright © 2011. All Rights Reserved.