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 protected RepositoryContext
_repositoryContext
The JackRabbit RepositoryImpl Contextprotected Session
_session
The 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 Instance Methods Concrete Methods Modifier and Type Method Description protected void
apply()
Apply the tasks (within the execute method()).protected void
close()
Close the tasksvoid
error(String id, String message)
protected PersistenceManager
getPM(String workspaceName)
Retrieves JackRabbit Persistence Manager for currently opened repository.void
info(String id, String message)
protected void
initialize()
Initialize the tasks.void
report(ReportItem item)
protected void
setLogger()
Set the tasks logger.void
startCheck(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
-
-
Constructor Detail
-
ConsistencyCheckTask
public ConsistencyCheckTask()
-
-
Method Detail
-
initialize
protected void initialize() throws RepositoryException
Description copied from class:AbstractMaintenanceTask
Initialize the tasks. This method can also create theTaskProgress
object bounded to the task.- Overrides:
initialize
in classAbstractMaintenanceTask
- Throws:
RepositoryException
- If a repository exception
-
setLogger
protected void setLogger()
Description copied from class:AbstractMaintenanceTask
Set the tasks logger.- Specified by:
setLogger
in classAbstractMaintenanceTask
-
apply
protected void apply() throws RepositoryException
Description copied from class:AbstractMaintenanceTask
Apply the tasks (within the execute method()).- Specified by:
apply
in classAbstractMaintenanceTask
- Throws:
RepositoryException
- If a repository exception
-
close
protected void close()
Description copied from class:AbstractMaintenanceTask
Close the tasks- Overrides:
close
in 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.
-
startCheck
public void startCheck(String id)
- Specified by:
startCheck
in interfaceConsistencyCheckListener
-
report
public void report(ReportItem item)
- Specified by:
report
in interfaceConsistencyCheckListener
-
error
public void error(String id, String message)
- Specified by:
error
in interfaceConsistencyCheckListener
-
info
public void info(String id, String message)
- Specified by:
info
in interfaceConsistencyCheckListener
-
-