Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.core.model
Interface Lockable

All Known Subinterfaces:
Document, DocumentProxy, SQLDocument
All Known Implementing Classes:
AbstractDocument, MockDocument, SQLDocumentLive, SQLDocumentProxy, SQLDocumentVersion

public interface Lockable

An object that can be locked.

A lock is identified by a lock key. The key is used to store information about the lock owner.

Author:
bstefanescu

Method Summary
 java.lang.String getLock()
          Gets the lock key if a lock exists on the current object.
 boolean isLocked()
          Tests if the current object is locked.
 void setLock(java.lang.String key)
          Sets a lock on the current document.
 java.lang.String unlock()
          Removes the lock on the object if any exists, otherwise do nothing.
 

Method Detail

setLock

void setLock(java.lang.String key)
             throws DocumentException
Sets a lock on the current document.

The lock key cannot be null.

Parameters:
key - the lock key
Throws:
DocumentException

isLocked

boolean isLocked()
                 throws DocumentException
Tests if the current object is locked.

Returns:
true if locked false otherwise
Throws:
DocumentException

getLock

java.lang.String getLock()
                         throws DocumentException
Gets the lock key if a lock exists on the current object.

Returns:
the lock key or null if no lock exists
Throws:
DocumentException

unlock

java.lang.String unlock()
                        throws DocumentException
Removes the lock on the object if any exists, otherwise do nothing.

Returns:
the key of the removed lock or null if the object was not locked
Throws:
DocumentException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.