public interface DeletableCollectionResource extends DeletableResource, CollectionResource
public boolean isLockedOut( Request inRequest, Resource inResource ) {
if( inResource == null || !( inResource instanceof LockableResource ) ) {
return false;
}
LockableResource lr = (LockableResource) inResource;
LockToken token = lr.getCurrentLock();
if( token != null ) {
Auth auth = inRequest.getAuthorization();
String lockedByUser = token.info.lockedByUser;
if( lockedByUser == null ) {
log.warn( "Resource is locked with a null user. Ignoring the lock" );
return false;
} else if( !lockedByUser.equals( auth.getUser() ) ) {
log.info( "fail: lock owned by: " + lockedByUser + " not by " + auth.getUser() );
String value = inRequest.getIfHeader();
if( value != null ) {
if( value.contains( "opaquelocktoken:" + token.tokenId + ">" ) ) {
log.info( "Contained valid token. so is unlocked" );
return false;
}
}
return true;
}
}
return false;
}
| Modifier and Type | Method and Description |
|---|---|
boolean |
isLockedOutRecursive(Request request)
Check to see if this resource or any child resource are locked by someone
other then the current user (as per the Authorisation property of the request)
|
deletechild, getChildrenauthenticate, authorise, checkRedirect, getModifiedDate, getName, getRealm, getUniqueIdboolean isLockedOutRecursive(Request request)
request -