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
  • Method Details

    • lock

      LockResult lock(LockTimeout timeout, LockInfo lockInfo) throws io.milton.http.exceptions.NotAuthorizedException, io.milton.http.exceptions.PreConditionFailedException, io.milton.http.exceptions.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:
      io.milton.http.exceptions.NotAuthorizedException
      io.milton.http.exceptions.PreConditionFailedException
      io.milton.http.exceptions.LockedException
    • refreshLock

      LockResult refreshLock(String token) throws io.milton.http.exceptions.NotAuthorizedException, io.milton.http.exceptions.PreConditionFailedException
      Renew the lock and return new lock info
      Parameters:
      token -
      Returns:
      Throws:
      io.milton.http.exceptions.NotAuthorizedException
      io.milton.http.exceptions.PreConditionFailedException
    • unlock

      void unlock(String tokenId) throws io.milton.http.exceptions.NotAuthorizedException, io.milton.http.exceptions.PreConditionFailedException
      If the resource is currently locked, and the tokenId matches the current one, unlock the resource
      Parameters:
      tokenId -
      Throws:
      io.milton.http.exceptions.NotAuthorizedException
      io.milton.http.exceptions.PreConditionFailedException
    • getCurrentLock

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