Nuxeo ECM Projects 5.4.3-SNAPSHOT

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 holds a lock owner and lock creation time.


Method Summary
 Lock getLock()
          Gets the lock key if a lock exists on the current object.
 Lock removeLock(String owner)
          Removes a lock on the current document.
 Lock setLock(Lock lock)
          Sets a lock on the current document.
 

Method Detail

setLock

Lock setLock(Lock lock)
             throws DocumentException
Sets a lock on the current document.

Parameters:
lock - the lock to set
Returns:
the existing lock if locking couldn't be done
Throws:
DocumentException

removeLock

Lock removeLock(String owner)
                throws DocumentException
Removes a lock on the current document.

Parameters:
the - owner to check, or null for no check
Returns:
null if there was no lock or if removal succeeded, or a lock if it blocks removal due to owner mismatch
Throws:
DocumentException

getLock

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

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

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.