Class MaintenanceTaskManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.workspaces.repository.maintenance.MaintenanceTaskManager
- All Implemented Interfaces:
 Component,Contextualizable,LogEnabled,Serviceable
- Direct Known Subclasses:
 MaintenanceTaskManager
public class MaintenanceTaskManager
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
The MaintenanceTaskManager Component
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTask types - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static MaintenanceTaskManager.MaintenanceTaskTypeThe maintenance running taskprotected RepositoryProviderThe repository provider.protected static AbstractMaintenanceTaskThe maintenance running taskThe maintenance running task typeprotected SystemStatusSystem status providerstatic final StringThe maintenance task ended system statusstatic final StringThe maintenance task running system statusstatic final StringThe repository unavailable system statusstatic final StringThe avalon role. - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected RepositoryConfigCreate a repository configprotected AbstractMaintenanceTaskInitialize the tasks.protected Pair<RepositoryConfig,RepositoryContext> Retrieve the repository config if no repository is available or the repository context of the available repositoryvoidcontextualize(Context context) Retrieves the type of the previous running task, if no task is currently running.Get progress information.Retrieves the type of the running taskbooleanIndicates is the Ametys repository is started or has been shut down.booleanIndicates if a maintenance task is running.booleanLaunch a maintenance taskvoidservice(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger 
- 
Field Details
- 
ROLE
The avalon role. - 
REPOSITORY_UNAVAILABLE
The repository unavailable system status- See Also:
 
 - 
MAINTENANCE_TASK_RUNNING
The maintenance task running system status- See Also:
 
 - 
MAINTENANCE_TASK_ENDED
The maintenance task ended system status- See Also:
 
 - 
_runningTask
The maintenance running task - 
_lastRunningTaskType
The maintenance running task - 
_runningTaskType
The maintenance running task type - 
_systemStatus
System status provider - 
_repositoryProvider
The repository provider. 
 - 
 - 
Constructor Details
- 
MaintenanceTaskManager
public MaintenanceTaskManager() 
 - 
 - 
Method Details
- 
contextualize
- Specified by:
 contextualizein interfaceContextualizable- Throws:
 ContextException
 - 
service
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 - 
launch
Launch a maintenance task- Parameters:
 type- The maintenance task type- Returns:
 - true if a task has been launched
 - Throws:
 Exception- when an error occurred
 - 
_getRepositoryInfo
protected Pair<RepositoryConfig,RepositoryContext> _getRepositoryInfo() throws ConfigurationException, javax.jcr.UnsupportedRepositoryOperationExceptionRetrieve the repository config if no repository is available or the repository context of the available repository- Returns:
 - Either the config or the context depending if the repository is available. The other one will be null.
 - Throws:
 ConfigurationException- if an error occurred while generating the configjavax.jcr.UnsupportedRepositoryOperationException- if the repository doesn't support retrieving the context
 - 
_createRepositoryConfig
Create a repository config- Returns:
 - the repository config
 - Throws:
 ConfigurationException- if an error occurred
 - 
_createTask
Initialize the tasks.- Parameters:
 type- MaintenanceTaskType- Returns:
 - the task.
 
 - 
isTaskRunning
Indicates if a maintenance task is running.- Returns:
 - true if a task is running.
 
 - 
getProgressInfo
Get progress information.- Returns:
 - a map containing information on the progress status.
 
 - 
getRunningTaskType
Retrieves the type of the running task- Returns:
 - the type of the running task or null.
 
 - 
getLastRunningTaskType
Retrieves the type of the previous running task, if no task is currently running. Otherwise, the current task type will be return.- Returns:
 - the type or null
 
 - 
isRepositoryStarted
Indicates is the Ametys repository is started or has been shut down.- Returns:
 - true is the repository is started
 
 
 -