Package org.apache.jackrabbit.core.query
Class OnWorkspaceInconsistency
- java.lang.Object
-
- org.apache.jackrabbit.core.query.OnWorkspaceInconsistency
-
public abstract class OnWorkspaceInconsistency extends Object
OnWorkspaceInconsistencydefines an interface to handle workspace inconsistencies.
-
-
Field Summary
Fields Modifier and Type Field Description static OnWorkspaceInconsistencyFAILAn handler that simply logs the path of the parent node and the name of the missing child node and then re-throws the exception.protected static Map<String,OnWorkspaceInconsistency>INSTANCESstatic OnWorkspaceInconsistencyLOGAn handler that simply logs the path of the parent node and the name of the missing child node
-
Constructor Summary
Constructors Modifier Constructor Description protectedOnWorkspaceInconsistency(String name)Protected constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static OnWorkspaceInconsistencyfromString(String name)Returns theOnWorkspaceInconsistencywith the givenname.StringgetName()abstract voidhandleMissingChildNode(NoSuchItemStateException exception, QueryHandler handler, Path path, NodeState node, ChildNodeEntry child)Handle a missing child node state.voidlogError(ItemStateException exception, QueryHandler handler, Path path, NodeState node, ChildNodeEntry child)Logs a generic workspace inconsistency error.
-
-
-
Field Detail
-
FAIL
public static final OnWorkspaceInconsistency FAIL
An handler that simply logs the path of the parent node and the name of the missing child node and then re-throws the exception.
-
LOG
public static final OnWorkspaceInconsistency LOG
An handler that simply logs the path of the parent node and the name of the missing child node
-
INSTANCES
protected static final Map<String,OnWorkspaceInconsistency> INSTANCES
-
-
Constructor Detail
-
OnWorkspaceInconsistency
protected OnWorkspaceInconsistency(String name)
Protected constructor.- Parameters:
name- a unique name for this handler.
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name of this
OnWorkspaceInconsistency.
-
fromString
public static OnWorkspaceInconsistency fromString(String name) throws IllegalArgumentException
Returns theOnWorkspaceInconsistencywith the givenname.- Parameters:
name- the name of aOnWorkspaceInconsistency.- Returns:
- the
OnWorkspaceInconsistencywith the givenname. - Throws:
IllegalArgumentException- ifnameis not a well-knownOnWorkspaceInconsistencyname.
-
handleMissingChildNode
public abstract void handleMissingChildNode(NoSuchItemStateException exception, QueryHandler handler, Path path, NodeState node, ChildNodeEntry child) throws ItemStateException, RepositoryException
Handle a missing child node state.- Parameters:
exception- the exception that was thrown when the query handler tried to load the child node state.handler- the query handler.path- the path of the parent node.node- the parent node state.child- the child node entry, for which no node state could be found.- Throws:
ItemStateException- if an error occurs while handling the missing child node state. This may also be the passedexceptioninstance.RepositoryException- if another error occurs not related to item state reading.
-
logError
public void logError(ItemStateException exception, QueryHandler handler, Path path, NodeState node, ChildNodeEntry child) throws RepositoryException
Logs a generic workspace inconsistency error.- Parameters:
exception- the exception that was thrown when working on the workspacehandler- the query handler.path- the path of the parent node.node- the parent node state.child- the child node entry, for which no node state could be found.- Throws:
RepositoryException- if another error occurs not related to item state reading.
-
-