Package io.milton.resource
Interface LockableResource
- All Superinterfaces:
Resource
- All Known Subinterfaces:
LockingCollectionResource,LockNullResource
webDAV LOCK
You should also implement LockingCollectionResource on your collections for full
locking support
-
Method Summary
Modifier and TypeMethodDescriptionlock(LockTimeout timeout, LockInfo lockInfo) Lock this resource and return a tokenrefreshLock(String token) Renew the lock and return new lock infovoidIf the resource is currently locked, and the tokenId matches the current one, unlock the resourceMethods inherited from interface io.milton.resource.Resource
authenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueId
-
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 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
-