Class ConsistencyCheckTask
- java.lang.Object
-
- org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
-
- org.ametys.workspaces.repository.maintenance.ConsistencyCheckTask
-
- All Implemented Interfaces:
LogEnabled,ConsistencyCheckListener
public class ConsistencyCheckTask extends AbstractMaintenanceTask implements ConsistencyCheckListener
ConsistencyCheckTask
-
-
Field Summary
Fields Modifier and Type Field Description private IterablePersistenceManager[]_pmListprotected RepositoryContext_repositoryContextThe JackRabbit RepositoryImpl Contextprotected Session_sessionThe JCR Session bound to this task.-
Fields inherited from class org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
_logger, _progress, _repositoryConfig, _repositoryProvider
-
-
Constructor Summary
Constructors Constructor Description ConsistencyCheckTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapply()Apply the tasks (within the execute method()).protected voidclose()Close the tasksvoiderror(String id, String message)private static ObjectfindAndInvokeMethod(Object obj, String name, Object[] parameters)protected PersistenceManagergetPM(String workspaceName)Retrieves JackRabbit Persistence Manager for currently opened repository.voidinfo(String id, String message)protected voidinitialize()Initialize the tasks.voidreport(ReportItem item)protected voidsetLogger()Set the tasks logger.voidstartCheck(String id)-
Methods inherited from class org.ametys.workspaces.repository.maintenance.AbstractMaintenanceTask
_getFormattedDuration, execute, getProgressInfo, isFinished, setLogger
-
-
-
-
Field Detail
-
_repositoryContext
protected RepositoryContext _repositoryContext
The JackRabbit RepositoryImpl Context
-
_pmList
private IterablePersistenceManager[] _pmList
-
-
Constructor Detail
-
ConsistencyCheckTask
public ConsistencyCheckTask()
-
-
Method Detail
-
initialize
protected void initialize() throws RepositoryException
Description copied from class:AbstractMaintenanceTaskInitialize the tasks. This method can also create theTaskProgressobject bounded to the task.- Overrides:
initializein classAbstractMaintenanceTask- Throws:
RepositoryException- If a repository exception
-
setLogger
protected void setLogger()
Description copied from class:AbstractMaintenanceTaskSet the tasks logger.- Specified by:
setLoggerin classAbstractMaintenanceTask
-
apply
protected void apply() throws RepositoryException
Description copied from class:AbstractMaintenanceTaskApply the tasks (within the execute method()).- Specified by:
applyin classAbstractMaintenanceTask- Throws:
RepositoryException- If a repository exception
-
close
protected void close()
Description copied from class:AbstractMaintenanceTaskClose the tasks- Overrides:
closein classAbstractMaintenanceTask
-
getPM
protected PersistenceManager getPM(String workspaceName)
Retrieves JackRabbit Persistence Manager for currently opened repository. This method uses Privileged access and will fail with security exception if used in environment with enabled security manager.- Parameters:
workspaceName- The workspace name- Returns:
- Persistence manager used by repository.
-
findAndInvokeMethod
private static Object findAndInvokeMethod(Object obj, String name, Object[] parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
-
startCheck
public void startCheck(String id)
- Specified by:
startCheckin interfaceConsistencyCheckListener
-
report
public void report(ReportItem item)
- Specified by:
reportin interfaceConsistencyCheckListener
-
error
public void error(String id, String message)
- Specified by:
errorin interfaceConsistencyCheckListener
-
info
public void info(String id, String message)
- Specified by:
infoin interfaceConsistencyCheckListener
-
-