case LOCK_CREATION:
try {
NamespaceConfig namespaceConfig = token.getNamespaceConfig();
try {
toLockSubject = (SubjectNode) structure
.retrieve(slideToken, lockInfo_lockSubject);
} catch (ObjectNotFoundException ex) {
// Creating a lock null resource
toLockSubject = new SubjectNode();
// Creating new subject
structure.create(slideToken, toLockSubject,
lockInfo_lockSubject);
NodeRevisionDescriptor revisionDescriptor =
new NodeRevisionDescriptor(0);
// Resource type
XMLValue lockNull =
new XMLValue(new Element(E_LOCKNULL, DNSP));
revisionDescriptor.setResourceType(lockNull.toString());
// Creating the revision descriptor
content.create(slideToken, lockInfo_lockSubject,
revisionDescriptor, null);
}
NodeLock lockToken = null;
inheritance = (depth != 0);
boolean exclusive =
!(lockInfo_lockScope.equals(E_SHARED));
if (lockDate == null)
lockDate = new Date((new Date()).getTime()
+ ((long)lockDuration * 1000L));
lockToken =
new NodeLock(toLockSubject, (SubjectNode)security.getPrincipal(slideToken),
namespaceConfig.getCreateObjectAction(),
lockDate, inheritance, exclusive, lockInfo_lockOwner);
lock.lock(slideToken, lockToken);
// Set the lock-token header
// [RFC 2518, 9.5] " The Lock-Token response header is used