Package org.onehippo.repository.update
Class BaseNodeUpdateVisitor
- java.lang.Object
-
- org.onehippo.repository.update.BaseNodeUpdateVisitor
-
- All Implemented Interfaces:
NodeUpdateVisitor
public abstract class BaseNodeUpdateVisitor extends Object implements NodeUpdateVisitor
BaseNodeUpdateVisitor
class adding support for logging.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
log
protected Map<String,Object>
parametersMap
protected NodeUpdateVisitorContext
visitorContext
-
Constructor Summary
Constructors Constructor Description BaseNodeUpdateVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Allows cleanup of resources held by this updater.javax.jcr.Node
firstNode(javax.jcr.Session session)
Initiates the retrieval of the nodes when using custom, instead of path or xpath (query) based, node selection/navigation, returning the first node to visit.void
initialize(javax.jcr.Session session)
Allows initialization of this updater.boolean
logSkippedNodePaths()
Overridable boolean function to indicate if skipped node paths should be logged (default true)javax.jcr.Node
nextNode()
Return a following node, when using custom, instead of path or xpath (query) based, node selection/navigation.void
setLogger(org.slf4j.Logger log)
void
setParametersMap(Map<String,Object> parametersMap)
void
setVisitorContext(NodeUpdateVisitorContext visitorContext)
boolean
skipCheckoutNodes()
Overridable boolean function to indicate if node checkout can be skipped (default false)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onehippo.repository.update.NodeUpdateVisitor
doUpdate, undoUpdate
-
-
-
-
Field Detail
-
log
protected org.slf4j.Logger log
-
visitorContext
protected NodeUpdateVisitorContext visitorContext
-
-
Method Detail
-
setLogger
public void setLogger(org.slf4j.Logger log)
-
setVisitorContext
public void setVisitorContext(NodeUpdateVisitorContext visitorContext)
-
logSkippedNodePaths
public boolean logSkippedNodePaths()
Overridable boolean function to indicate if skipped node paths should be logged (default true)- Returns:
- true if skipped node paths should be logged
-
skipCheckoutNodes
public boolean skipCheckoutNodes()
Overridable boolean function to indicate if node checkout can be skipped (default false)- Returns:
- true if node checkout can be skipped (e.g. for readonly visitors and/or updates unrelated to versioned content)
-
initialize
public void initialize(javax.jcr.Session session) throws javax.jcr.RepositoryException
Description copied from interface:NodeUpdateVisitor
Allows initialization of this updater. Called before any other method is called.- Specified by:
initialize
in interfaceNodeUpdateVisitor
- Parameters:
session
- a JCRSession
with system credentials- Throws:
javax.jcr.RepositoryException
- when thrown, the updater will not be run by the framework
-
firstNode
public javax.jcr.Node firstNode(javax.jcr.Session session) throws javax.jcr.RepositoryException
Initiates the retrieval of the nodes when using custom, instead of path or xpath (query) based, node selection/navigation, returning the first node to visit. Intended to be overridden, default implementation returns null.- Parameters:
session
-- Returns:
- first node to visit, or null if none found
- Throws:
javax.jcr.RepositoryException
-
nextNode
public javax.jcr.Node nextNode() throws javax.jcr.RepositoryException
Return a following node, when using custom, instead of path or xpath (query) based, node selection/navigation. Intended to be overridden, default implementation returns null.- Returns:
- next node to visit, or null if none left
- Throws:
javax.jcr.RepositoryException
-
destroy
public void destroy()
Description copied from interface:NodeUpdateVisitor
Allows cleanup of resources held by this updater. Called after an updater run was completed.- Specified by:
destroy
in interfaceNodeUpdateVisitor
-
-