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
Modifier and TypeClassDescriptionstatic enum
Task types -
Field Summary
Modifier and TypeFieldDescriptionprotected static MaintenanceTaskManager.MaintenanceTaskType
The maintenance running taskprotected static AbstractMaintenanceTask
The maintenance running taskThe maintenance running task typeprotected SystemStatus
System status providerstatic final String
The maintenance task ended system statusstatic final String
The maintenance task running system statusstatic final String
The repository unavailable system statusstatic final String
The avalon role. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractMaintenanceTask
Initialize the tasks.void
contextualize
(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 taskboolean
isJndi()
Determines if the repository is obtained through JNDIboolean
Indicates is the Ametys repository is started or has been shut down.boolean
Indicates if a maintenance task is running.boolean
Launch a maintenance taskvoid
service
(ServiceManager manager) protected void
Shutdown the Ametys repository instanceMethods 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
-
-
Constructor Details
-
MaintenanceTaskManager
public MaintenanceTaskManager()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
launch
Launch a maintenance task- Parameters:
type
- The maintenance task type- Returns:
- true if a task has been launched
-
isJndi
Determines if the repository is obtained through JNDI- Returns:
- true if the repository is obtained through JNDI
-
shutdownRepository
Shutdown the Ametys repository instance- Throws:
javax.jcr.RepositoryException
- If the repository cannot be shutdown
-
_createTask
protected AbstractMaintenanceTask _createTask(MaintenanceTaskManager.MaintenanceTaskType type) throws javax.jcr.RepositoryException Initialize the tasks.- Parameters:
type
- MaintenanceTaskType- Returns:
- the task.
- Throws:
javax.jcr.RepositoryException
- If an error occurs during the task creation
-
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
-