public interface MaintenanceModeTask extends ScheduleTask
stages
like displaying a warning messageor rejecting new sessions. Each state may have a different duration. Use ScheduleEntry#createTask(MaintenanceModeTask.class)
to create a maintenancemode task for a specific schedule entry
Modifier and Type | Interface and Description |
---|---|
static class |
MaintenanceModeTask.ConcurrentTaskHandling
Describes if other tasks may be executed while the maintenance mode is active.
|
static class |
MaintenanceModeTask.DisconnectMode
When the maintenance mode starts, existing sessions may be quit or kept alive.
|
static class |
MaintenanceModeTask.MaintenanceScope
The maintenance mode may only affect certain projects or the whole FirstSpirit server.
|
static class |
MaintenanceModeTask.MaintenanceStage
A maintenance mode task consists of up to five stages, from an initial preparation period up to activating the actual maintenance mode.
|
static class |
MaintenanceModeTask.MessageDisplayType
The notification that a maintenance is imminent may be displayed to the users in different ways.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getAllowedGroupNames()
The server administrator may always connect to the server, even if the maintenance mode is active.
|
List<User> |
getAllowedUsers()
The server administrator may always connect to the server, even if the maintenance mode is active.
|
MaintenanceModeTask.ConcurrentTaskHandling |
getConcurrentTaskHandling()
Indicates if other tasks may be executed while the maintenance mode is active.
|
MaintenanceModeTask.DisconnectMode |
getDisconnectMode()
Indicates the handling of existing sessions once the stage
MaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE begins. |
long |
getDurationOfStage(MaintenanceModeTask.MaintenanceStage stage)
Each stage has a duration after which the next stage is started.
|
String |
getMaintenanceName()
The descriptive name of the maintenance mode started by this task.
|
List<Project> |
getMaintenanceProjects()
All projects affected by the maintenance task.
|
MaintenanceModeTask.MaintenanceScope |
getMaintenanceScope()
Indicates the scope of this maintenance task, i.e. if only certain projects or the whole server is affected.
|
String |
getMessage()
The message which is displayed to all users once the task has been started.
|
MaintenanceModeTask.MessageDisplayType |
getMessageDisplayType()
Indicates how the message is displayed to the users.
|
void |
setAllowedGroupNames(Collection<String> groupNames)
Specifies the names of all groups who are allowed to connect to the server even if the maintenance mode is active.
|
void |
setAllowedUsers(Collection<User> allowedUsers)
Specifies all users who are allowed to connect to the server even if the maintenance mode is active.
|
void |
setConcurrentTaskHandling(MaintenanceModeTask.ConcurrentTaskHandling concurrentTaskHandling)
Defines if other tasks may be executed while the maintenance mode is active.
|
void |
setDisconnectMode(MaintenanceModeTask.DisconnectMode disconnectMode)
Defines how existing sessions are handled once the stage
MaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE begins. |
void |
setDurationOfStage(long durationInMilliseconds,
MaintenanceModeTask.MaintenanceStage stage)
Each stage has a duration after which the next stage is started.
|
void |
setMaintenanceName(String name)
Set descriptive name of the maintenance mode started by this task.
|
void |
setMaintenanceProjects(Collection<Project> projects)
Specifies the projects which are affected by the maintenance task.
|
void |
setMaintenanceScope(MaintenanceModeTask.MaintenanceScope maintenanceScope)
Defines the scope of this maintenance task.
|
void |
setMessage(String message)
Set the message which is included in all messages regarding this maintenance task.
|
void |
setMessageDisplayType(MaintenanceModeTask.MessageDisplayType messageDisplayType)
Define how the message of this task should be displayed to the users.
|
checkParams, getClusterNodeName, getDescription, getExecuteInFault, getExecuteParallel, getName, getRemoteTaskType, getScheduleEntry, getTemplate, hasTemplate, isActive, isExecuteOnClusterNode, isProjectTask, setActive, setClusterNodeName, setDescription, setExecuteInFault, setExecuteOnClusterNode, setExecuteParallel, setName, setTemplate, test
@NotNull String getMaintenanceName()
null
.void setMaintenanceName(@NotNull String name)
name
- the name to set, must not be null
.@NotNull String getMessage()
null
.void setMessage(@NotNull String message)
message
- the message to display, must not be null
.@NotNull MaintenanceModeTask.MessageDisplayType getMessageDisplayType()
null
.void setMessageDisplayType(@NotNull MaintenanceModeTask.MessageDisplayType messageDisplayType)
messageDisplayType
- The type of display, must not be null
.long getDurationOfStage(@NotNull MaintenanceModeTask.MaintenanceStage stage)
stage
- the stage for which to query the duration, must not be null
.setDurationOfStage(long,MaintenanceStage)
void setDurationOfStage(long durationInMilliseconds, @NotNull MaintenanceModeTask.MaintenanceStage stage)
durationInMilliseconds
- the duration for the stage or 0 to disable it completely if allowed for the givenstage.stage
- the stage to set the timeout for, must not be null
.IllegalArgumentException
- if an unknown stage has been specified or the duration is negative.getDurationOfStage(MaintenanceStage)
@NotNull MaintenanceModeTask.DisconnectMode getDisconnectMode()
MaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE
begins.null
. Default is KEEP_SESSIONS_ALIVE
void setDisconnectMode(@NotNull MaintenanceModeTask.DisconnectMode disconnectMode)
MaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE
begins.disconnectMode
- The disconnect mode, must not be null
.@NotNull MaintenanceModeTask.MaintenanceScope getMaintenanceScope()
null
. Default is GLOBAL
void setMaintenanceScope(@NotNull MaintenanceModeTask.MaintenanceScope maintenanceScope)
maintenanceScope
- the maintenance scope, must not be null
.@NotNull MaintenanceModeTask.ConcurrentTaskHandling getConcurrentTaskHandling()
null
. Default is ALLOW_OTHER_TASKS
void setConcurrentTaskHandling(@NotNull MaintenanceModeTask.ConcurrentTaskHandling concurrentTaskHandling)
concurrentTaskHandling
- the enum describing how concurrent tasks should be handled, must not be null
.@NotNull List<Project> getMaintenanceProjects()
null
.getMaintenanceScope()
,
setMaintenanceProjects(Collection)
void setMaintenanceProjects(@NotNull Collection<Project> projects)
setMaintenanceScope(MaintenanceScope)
to MaintenanceModeTask.MaintenanceScope.PROJECT_LOCAL
.projects
- All projects affected be the maintenance task. Must not be null
.setMaintenanceScope(MaintenanceScope)
,
getMaintenanceProjects()
@NotNull List<User> getAllowedUsers()
null
.setAllowedUsers(Collection)
void setAllowedUsers(@NotNull Collection<User> allowedUsers)
allowedUsers
- all users who may connect despite an active maintenance mode.Must not be null
.getAllowedUsers()
@NotNull List<String> getAllowedGroupNames()
null
.setAllowedGroupNames(Collection)
void setAllowedGroupNames(@NotNull Collection<String> groupNames)
groupNames
- names of all groups who may connect despite an active maintenance mode.Must not be null
.getAllowedGroupNames()
Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210