Interface MaintenanceModeInfo


public interface MaintenanceModeInfo
Provides current information about an active MaintenanceModeTask.
Since:
5.2.518, 5.2.605
  • 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

      @NotNull @NotNull String getDescription()
      The description of this maintenance mode.
      Returns:
      the name of this maintenance mode, never null.
      Since:
      5.2.518, 5.2.605
    • getMessage

      @NotNull @NotNull String 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

      @Nullable @Nullable MaintenanceModeTask.MaintenanceStage 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

      Optional<Duration> 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 long remainingDurationOfCurrentStageInMillis()
      Deprecated.
      since 5.2.180703 - use remainingDurationOfCurrentStage() instead
      This 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 @NotNull @NotNull Date getStartingTimeOfStageAsDate(@NotNull @NotNull MaintenanceModeTask.MaintenanceStage stage)
      Deprecated.
      since 5.2.180703 - use getStartingTimeOfStage(MaintenanceStage) instead
      Each MaintenanceModeTask.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 be null.
      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)
      Each MaintenanceModeTask.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 be null.
      Returns:
      the (estimated) starting time of the given stage, never null.
      Since:
      5.2.180703
    • getMessageDisplayType

      @NotNull @NotNull MaintenanceModeTask.MessageDisplayType 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

      @NotNull @NotNull MaintenanceModeTask.DisconnectMode getDisconnectMode()
      Indicates the handling of existing sessions once the stage MaintenanceModeTask.MaintenanceStage.MAINTENANCE_MODE_ACTIVE begins.
      Returns:
      The disconnect mode, never null.
      Since:
      5.2.518, 5.2.605
    • getMaintenanceScope

      @NotNull @NotNull MaintenanceModeTask.MaintenanceScope 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

      @NotNull @NotNull MaintenanceModeTask.ConcurrentTaskHandling 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

      long getDurationOfStageInMillis(@NotNull @NotNull MaintenanceModeTask.MaintenanceStage stage)
      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 be null.
      Returns:
      the duration in milliseconds or 0 if the stage is disabled.
      Since:
      5.2.518, 5.2.605
    • getProjectIds

      @NotNull @NotNull List<Long> 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 is MaintenanceModeTask.MaintenanceScope.GLOBAL
      Since:
      5.2.518, 5.2.605
      See Also: