Package org.onehippo.repository.update
Interface NodeUpdateVisitor
-
- All Known Implementing Classes:
BaseNodeUpdateVisitor
public interface NodeUpdateVisitor
Visitor for updating repository content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
Allows cleanup of resources held by this updater.boolean
doUpdate(Node node)
Update the given node.void
initialize(Session session)
Allows initialization of this updater.boolean
undoUpdate(Node node)
Revert the given node.
-
-
-
Method Detail
-
initialize
void initialize(Session session) throws RepositoryException
Allows initialization of this updater. Called before any other method is called.- Parameters:
session
- a JCRSession
with system credentials- Throws:
RepositoryException
- when thrown, the updater will not be run by the framework
-
doUpdate
boolean doUpdate(Node node) throws RepositoryException
Update the given node.- Parameters:
node
- theNode
to be updated- Returns:
true
if the node was changed,false
if not- Throws:
RepositoryException
- if an exception occurred while updating the node
-
undoUpdate
boolean undoUpdate(Node node) throws RepositoryException, UnsupportedOperationException
Revert the given node. This method is intended to be the reverse of thedoUpdate(javax.jcr.Node)
method. It allows update runs to be reverted in case a problem arises due to the update. The method should throw anUnsupportedOperationException
when it is not implemented.- Parameters:
node
- the node to be reverted.- Returns:
true
if the node was changed,false
if not- Throws:
RepositoryException
- if an exception occurred while reverting the nodeUnsupportedOperationException
- if the method is not implemented
-
destroy
void destroy()
Allows cleanup of resources held by this updater. Called after an updater run was completed.
-
-