requireNonNull(mutableLock);
requireNonNull(validation);
requireNonNull(session);
Response response = Util.emptyResponse();
ILock lock = ILock.build(mutableLock);
try {
sessionValidator.checkAuthenticated(
session,
ImmutableSet.of(getRoleFromLockKey(lock.getKey())));
if (validation == LockValidation.CHECKED) {
lockManager.validateIfLocked(lock.getKey(), Optional.of(lock));
}
lockManager.releaseLock(lock);
return response.setResponseCode(OK);
} catch (AuthFailedException e) {
return addMessage(response, AUTH_FAILED, e);