Package org.apache.jackrabbit.core.query
Class OnWorkspaceInconsistency
- java.lang.Object
-
- org.apache.jackrabbit.core.query.OnWorkspaceInconsistency
-
public abstract class OnWorkspaceInconsistency extends Object
OnWorkspaceInconsistency
defines an interface to handle workspace inconsistencies.
-
-
Field Summary
Fields Modifier and Type Field Description static 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.protected static Map<String,OnWorkspaceInconsistency>
INSTANCES
static OnWorkspaceInconsistency
LOG
An handler that simply logs the path of the parent node and the name of the missing child node
-
Constructor Summary
Constructors Modifier Constructor Description protected
OnWorkspaceInconsistency(String name)
Protected constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static OnWorkspaceInconsistency
fromString(String name)
Returns theOnWorkspaceInconsistency
with the givenname
.String
getName()
abstract void
handleMissingChildNode(NoSuchItemStateException exception, QueryHandler handler, Path path, NodeState node, ChildNodeEntry child)
Handle a missing child node state.void
logError(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 theOnWorkspaceInconsistency
with the givenname
.- Parameters:
name
- the name of aOnWorkspaceInconsistency
.- Returns:
- the
OnWorkspaceInconsistency
with the givenname
. - Throws:
IllegalArgumentException
- ifname
is not a well-knownOnWorkspaceInconsistency
name.
-
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 passedexception
instance.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.
-
-