LOG.debug(String.format("Resource is locked by %s", userLock.getName()));
}
throw new PermissionDeniedException(userLock.getName());
}
LockToken lockToken = document.getMetadata().getLockToken();
if (!token.equals(lockToken.getOpaqueLockToken())) {
if (LOG.isDebugEnabled()) {
LOG.debug("Token does not match");
}
throw new PermissionDeniedException(String.format("Token %s does not match %s", token, lockToken.getOpaqueLockToken()));
}
lockToken.setTimeOut(LockToken.LOCK_TIMEOUT_INFINITE);
// Make token persistant
txnManager = brokerPool.getTransactionManager();
txn = txnManager.beginTransaction();
broker.storeXMLResource(txn, document);