Package io.milton.resource
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LockTokengetCurrentLock()LockResultlock(LockTimeout timeout, LockInfo lockInfo)Lock this resource and return a tokenLockResultrefreshLock(String token)Renew the lock and return new lock infovoidunlock(String tokenId)If the resource is currently locked, and the tokenId matches the current one, unlock the resource-
Methods inherited from interface io.milton.resource.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
-
-
-
-
Method Detail
-
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 nulllockInfo-- Returns:
- - a result containing the token representing the lock if succesful, otherwise a failure reason code
- Throws:
io.milton.http.exceptions.NotAuthorizedExceptionio.milton.http.exceptions.PreConditionFailedExceptionio.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.NotAuthorizedExceptionio.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.NotAuthorizedExceptionio.milton.http.exceptions.PreConditionFailedException
-
getCurrentLock
LockToken getCurrentLock()
- Returns:
- - the current lock, if the resource is locked, or null
-
-