Interface ConsistencyChecker
-
- All Known Implementing Classes:
AbstractBundlePersistenceManager
,BundleDbPersistenceManager
,BundleFsPersistenceManager
,DerbyPersistenceManager
,H2PersistenceManager
,InMemBundlePersistenceManager
,MSSqlPersistenceManager
,MySqlPersistenceManager
,Oracle9PersistenceManager
,OraclePersistenceManager
,PostgreSQLPersistenceManager
public interface ConsistencyChecker
Optional interface for Persistence Managers. Allows running consistency checks similar to the base one (seeAbstractBundlePersistenceManager.checkConsistency(String[], boolean, boolean)
) but providing a result that can be acted upon.Beware: this interface is designed for unit tests only.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConsistencyReport
check(String[] uuids, boolean recursive, boolean fix, String lostNFoundId, ConsistencyCheckListener listener)
Perform a consistency check of the data.void
setEventChannel(UpdateEventChannel eventChannel)
Set the update event channel.
-
-
-
Method Detail
-
setEventChannel
void setEventChannel(UpdateEventChannel eventChannel)
Set the update event channel. Needed to inform the cluster of any changes made during repairs.- Parameters:
eventChannel
- the update event channel
-
check
ConsistencyReport check(String[] uuids, boolean recursive, boolean fix, String lostNFoundId, ConsistencyCheckListener listener) throws RepositoryException
Perform a consistency check of the data. An example are non-existent nodes referenced in a child node entry. The existence of this feature and the scope of the implementation can vary in different PersistenceManager implementations.- Parameters:
uuids
- list of UUIDs of nodes to be checked. if null, all nodes will be checkedrecursive
- if true, the tree(s) below the given node(s) will be traversed and checked as wellfix
- if true, any problems found that can be repaired will be repaired. if false, no data will be modified, instead all inconsistencies will only get loggedlostNFoundId
- node to which to attach orphaned nodes (ornull
, in which case orphaned nodes will not get moved); this node should be of a node type that allows adding arbitrary child nodeslistener
- to be called on each node that was checked (may benull
)- Throws:
RepositoryException
-
-