Package de.espirit.firstspirit.server
Interface MaintenanceModeInfo
public interface MaintenanceModeInfo
Provides current information about an active
MaintenanceModeTask
.- Since:
- 5.2.518, 5.2.605
-
Method Summary
Modifier and TypeMethodDescriptionIndicates if other tasks may be executed while the maintenance mode is active.@Nullable MaintenanceModeTask.MaintenanceStage
A maintenance mode task consists of up to five stages, from an initial preparation period up to activating the actual maintenance mode.@NotNull String
The description of this maintenance mode.@NotNull MaintenanceModeTask.DisconnectMode
Indicates the handling of existing sessions once the stageMaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE
begins.long
getDurationOfStageInMillis
(@NotNull MaintenanceModeTask.MaintenanceStage stage) Each stage has a duration after which the next stage is started.long
getId()
The automatically assigned, internal id.@NotNull MaintenanceModeTask.MaintenanceScope
Indicates the scope of this maintenance task, i.e. if only certain projects or the whole server is affected.@NotNull String
The message which is displayed to all users once the task has been started.Indicates how the message is displayed to the users.All projects affected by the maintenance task.long
The id of the related schedule entry.@NotNull ZonedDateTime
getStartingTimeOfStage
(@NotNull MaintenanceModeTask.MaintenanceStage stage) EachMaintenanceModeTask.MaintenanceStage
is started at a particular time if the task is not stopped prematurely.@NotNull Date
getStartingTimeOfStageAsDate
(@NotNull MaintenanceModeTask.MaintenanceStage stage) Deprecated, for removal: This API element is subject to removal in a future version.This method may be used to determine the remaining duration of the currently active stage.long
Deprecated, for removal: This API element is subject to removal in a future version.since 5.2.180703 - useremainingDurationOfCurrentStage()
instead
-
Method Details
-
getId
long getId()The automatically assigned, internal id.- Returns:
- the id of the maintenance mode.
- Since:
- 5.2.518, 5.2.605
-
getScheduleEntryId
long getScheduleEntryId()The id of the related schedule entry.- Returns:
- the id of the related schedule entry.
- Since:
- 5.2.801
- See Also:
-
getDescription
The description of this maintenance mode.- Returns:
- the name of this maintenance mode, never
null
. - Since:
- 5.2.518, 5.2.605
-
getMessage
The message which is displayed to all users once the task has been started.- Returns:
- the message to display, never
null
. - Since:
- 5.2.518, 5.2.605
-
getCurrentStage
A maintenance mode task consists of up to five stages, from an initial preparation period up to activating the actual maintenance mode. This method returns the currently active stage.- Returns:
- the stage which is currently active or
null
if the maintenance mode has been completed or stopped. - Since:
- 5.2.518, 5.2.605
-
remainingDurationOfCurrentStage
This method may be used to determine the remaining duration of the currently active stage.- Returns:
- the remaining duration or an empty
Optional
if the maintenance mode has been finished or stopped. - Since:
- 5.2.180703
-
remainingDurationOfCurrentStageInMillis
Deprecated, for removal: This API element is subject to removal in a future version.since 5.2.180703 - useremainingDurationOfCurrentStage()
insteadThis method may be used to determine the remaining duration of the currently active stage.- Returns:
- the remaining duration in milliseconds or -1 if the maintenance mode has been finished or stopped.
- Since:
- 5.2.518, 5.2.605
-
getStartingTimeOfStageAsDate
@Deprecated(forRemoval=true) @NotNull @NotNull Date getStartingTimeOfStageAsDate(@NotNull @NotNull MaintenanceModeTask.MaintenanceStage stage) Deprecated, for removal: This API element is subject to removal in a future version.since 5.2.180703 - usegetStartingTimeOfStage(MaintenanceStage)
insteadEachMaintenanceModeTask.MaintenanceStage
is started at a particular time if the task is not stopped prematurely. This method returns the estimated starting time for future stages and past starting times for previous stages.- Parameters:
stage
- The stage for which the starting time should be returned, must not benull
.- Returns:
- the (estimated) starting time of the given stage, must not be
null
. - Since:
- 5.2.518, 5.2.605
-
getStartingTimeOfStage
@NotNull @NotNull ZonedDateTime getStartingTimeOfStage(@NotNull @NotNull MaintenanceModeTask.MaintenanceStage stage) EachMaintenanceModeTask.MaintenanceStage
is started at a particular time if the task is not stopped prematurely. This method returns the estimated starting time for future stages and past starting times for previous stages.- Parameters:
stage
- The stage for which the starting time should be returned, must not benull
.- Returns:
- the (estimated) starting time of the given stage, never
null
. - Since:
- 5.2.180703
-
getMessageDisplayType
Indicates how the message is displayed to the users.- Returns:
- The type of display, never
null
. - Since:
- 5.2.518, 5.2.605
-
getDisconnectMode
Indicates the handling of existing sessions once the stageMaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE
begins.- Returns:
- The disconnect mode, never
null
. - Since:
- 5.2.518, 5.2.605
-
getMaintenanceScope
Indicates the scope of this maintenance task, i.e. if only certain projects or the whole server is affected.- Returns:
- the maintenance scope, never
null
. - Since:
- 5.2.518, 5.2.605
-
getConcurrentTaskHandling
Indicates if other tasks may be executed while the maintenance mode is active.- Returns:
- an enum describing how concurrent tasks are handled, never
null
. - Since:
- 5.2.518, 5.2.605
-
getDurationOfStageInMillis
Each stage has a duration after which the next stage is started. This method returns the duration for a specific stage or 0 if the stage is disabled.- Parameters:
stage
- the stage for which to query the duration, must not benull
.- Returns:
- the duration in milliseconds or 0 if the stage is disabled.
- Since:
- 5.2.518, 5.2.605
-
getProjectIds
All projects affected by the maintenance task. May only be called if the task scope is not global.- Returns:
- an unmodifiable list of ids of all affected projects. Will never be empty or
null
. - Throws:
IllegalStateException
- if the scope isMaintenanceModeTask.MaintenanceScope.GLOBAL
- Since:
- 5.2.518, 5.2.605
- See Also:
-
getStartingTimeOfStage(MaintenanceStage)
instead