com.ibm.portal.resolver.webdav.tree
Interface WebdavLockableTreeModelController<T,M extends Modifiable>

All Superinterfaces:
Committable, Disposable, WebdavLockableTreeModel<T>, WebdavTreeModel<T>, WebdavTreeModelController<T,M>

public interface WebdavLockableTreeModelController<T,M extends Modifiable>
extends WebdavTreeModelController<T,M>, WebdavLockableTreeModel<T>

Implemented by tree models that enable locking and unlocking of their resources.

Since:
6.1.5
Note:
This interface is designed to be implemented by clients.

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavLockableTreeModel
WebdavLockableTreeModel.SupportedLockType
 
Field Summary
 
Fields inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavTreeModelController
FLAG_COLLECTION, FLAG_FILE
 
Method Summary
 java.net.URI lock(T item, WebdavLockInfo lock)
          Request to lock a particular resource.
 boolean unlock(java.net.URI lockToken, T item)
           Request to unlock a particular resource.
 
Methods inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavTreeModelController
createCreationContext, getTreeModelController, update
 
Methods inherited from interface com.ibm.portal.Committable
commit, dispose
 
Methods inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavLockableTreeModel
getSupportedLock, visitLocks
 
Methods inherited from interface com.ibm.portal.resolver.webdav.tree.WebdavTreeModel
createDataSource, getItem, getLocalized, getName, getTreeModel, isCollection
 

Method Detail

lock

java.net.URI lock(T item,
                  WebdavLockInfo lock)
                  throws java.io.IOException
Request to lock a particular resource. Implementations may use the WebdavXMLReaderFactory#createLockToken() method to construct their unique lock tokens.

Parameters:
item - item to be locked, not null
lock - information about the requested lock, not null. If the WebdavLockInfo.getLockType() method returns null this request is a lock-refresh request and the method should update the lock information but should not create a new lock token.
Returns:
the new lock token or null if the requested lock already existed and the lock operation only resulted in a lock refresh
Throws:
java.io.IOException

unlock

boolean unlock(java.net.URI lockToken,
               T item)
               throws java.io.IOException

Request to unlock a particular resource. Implementations may return false to indicate that the unlock operation has failed, but it is recommended to rather throw an exception that explains why the operation failed. This exception should subclass IOException and implement the LocalizedStatus interface.

Implementations must be prepared to receive unlock requests for lock tokens that they did not issue. In this case the operation should fail.

Parameters:
lockToken - token to unlock, not null
item - item to be locked, not null
Returns:
true if the operation succeeded, else falseThrows:
java.io.IOException