com.ibm.portal.resolver.webdav.tree.helper
Class DefaultWebdavTreeModelController<T,M extends Modifiable>
java.lang.Object
com.ibm.portal.resolver.webdav.tree.helper.DefaultWebdavTreeModel<T>
com.ibm.portal.resolver.webdav.tree.helper.DefaultWebdavTreeModelController<T,M>
- All Implemented Interfaces:
- Committable, Disposable, WebdavTreeModel<T>, WebdavTreeModelController<T,M>
-
public class DefaultWebdavTreeModelController<T,M extends Modifiable>
- extends DefaultWebdavTreeModel<T>
- implements WebdavTreeModelController<T,M>
Convenience base class for WebdavTreeModelController implementations.
- Since:
- 6.1.5
- Note:
This interface is designed to be implemented by clients. |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultWebdavTreeModelController
public DefaultWebdavTreeModelController()
createCreationContext
public WebdavCreationContext<T> createCreationContext(java.lang.String name,
boolean isCollection,
java.io.InputStream is,
T parent)
- Description copied from interface: WebdavTreeModelController
- Returns a new creation context to create a new item inside a parent
collection. Depending on the isCollection parameter the new
item can contain subitems or not.
- Specified by:
- createCreationContext in interface WebdavTreeModelController<T,M extends Modifiable>
- Parameters:
- name - name of the new collection or item, not null. The
name will not contain the path separator '/' and will not be
URL encoded.
- isCollection - true if the new item is a collection, else
false
- is - in case a non-collection is created this stream contains the
content of the newly created item and will not be
null. In case a collection is created, this
stream may be null or contains the optional
request body of the MKCOL request.
- parent - the parent collection, not null. This information
can be used as a hint for the target insert location. In any
case the new node will be explicitly inserted as the child of
the parent collection after it has been created.
- Returns:
- a creation context or null
getTreeModelController
public TreeModelController<T,M> getTreeModelController()
- Description copied from interface: WebdavTreeModelController
- Creates a new CommittableTreeModelController used to execute
modification operations on the tree. If no modifications are allowed,
this method may return null
- Specified by:
- getTreeModelController in interface WebdavTreeModelController<T,M extends Modifiable>
- Returns:
- the controller or null
update
public boolean update(M item,
java.io.InputStream is)
throws java.io.IOException
- Description copied from interface: WebdavTreeModelController
- This method updates the modifiable item with the content of the input
stream. If the update is successful, the method returns true
, else it returns false. After a successful update the new
content of the item must be available via the
WebdavTreeModel.createDataSource(T) APIs.
- Specified by:
- update in interface WebdavTreeModelController<T,M extends Modifiable>
- Parameters:
- item - item to update, not null
- is - the (new) content of the item, not null
- Returns:
- true if the operation was successful, else
false
- Throws:
- java.io.IOException
commit
public void commit()
throws CannotCommitException
- Description copied from interface: Committable
- Commits the modifications applied to the controller that implements this
interface. Implementations of this method must not perform database read
access.
After the controller is committed successfully, this method must not be
called again. The same is true for any other method modifying the
controller or its nodes.
- Specified by:
- commit in interface Committable
- Throws:
- CannotCommitException - in case the modifications cannot be committed; if this
exception occurs, the commit operation is considered
unsuccessfully executed