Class MaintenanceWindow

java.lang.Object
hudson.model.AbstractDescribableImpl<MaintenanceWindow>
com.sap.prd.jenkins.plugins.agent_maintenance.MaintenanceWindow
All Implemented Interfaces:
Describable<MaintenanceWindow>, Comparable<MaintenanceWindow>

public class MaintenanceWindow extends AbstractDescribableImpl<MaintenanceWindow> implements Comparable<MaintenanceWindow>
Describes a maintenance window.
  • Field Details

  • Constructor Details

    • MaintenanceWindow

      @Deprecated public MaintenanceWindow(String startTime, String endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, int maxWaitMinutes, String userid, String id)
      Deprecated.
      Create a new maintenance window.
      Parameters:
      startTime - Start time
      endTime - End time
      reason - Reason
      takeOnline - Take online at end of maintenance
      keepUpWhenActive - Keep up while builds are running
      maxWaitMinutes - Max waiting time before canceling running builds.
      userid - Userid that created the maintenance window
      id - ID of the maintenance, use null to generate a new id
    • MaintenanceWindow

      @DataBoundConstructor public MaintenanceWindow(String startTime, String endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, String maxWaitMinutes, String userid, String id)
      Create a new maintenance window.
      Parameters:
      startTime - Start time
      endTime - End time
      reason - Reason
      takeOnline - Take online at end of maintenance
      keepUpWhenActive - Keep up while builds are running
      maxWaitMinutes - Max waiting time before canceling running builds. Can be a number or a string with a timespan, e.g. "1d 2h 15m"
      userid - Userid that created the maintenance window
      id - ID of the maintenance, use null to generate a new id
    • MaintenanceWindow

      public MaintenanceWindow(LocalDateTime startTime, LocalDateTime endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, String maxWaitMinutes, String userid, String id)
      Create a new maintenance window.
      Parameters:
      startTime - Start time
      endTime - End time
      reason - Reason
      takeOnline - Take online at end of maintenance
      keepUpWhenActive - Keep up while builds are running
      maxWaitMinutes - Max waiting time before canceling running builds. Can be a number or a string with a timespan, e.g. "1d 2h 15m"
      userid - Userid that created the maintenance window
      id - ID of the maintenance, use null to generate a new id
  • Method Details

    • getId

      public String getId()
    • getUserid

      public String getUserid()
    • isKeepUpWhenActive

      public boolean isKeepUpWhenActive()
    • buildsHaveBeenAborted

      public boolean buildsHaveBeenAborted()
    • setAborted

      public void setAborted(boolean aborted)
    • getMaxWaitMinutes

      public int getMaxWaitMinutes()
    • isTakeOnline

      public boolean isTakeOnline()
    • readResolve

      protected Object readResolve()
    • getStartTime

      public String getStartTime()
    • getEndTime

      public String getEndTime()
    • getReason

      public String getReason()
    • isMaxWaitTimeFinished

      public boolean isMaxWaitTimeFinished()
      Checks if max waiting time is finished.
      Returns:
      true when waiting is finished
    • isMaintenanceScheduled

      public boolean isMaintenanceScheduled()
      Return the status of the maintenance.
      Returns:
      true if the maintenance is active, false otherwise.
    • isMaintenanceOver

      public boolean isMaintenanceOver()
    • getOfflineCause

      public OfflineCause getOfflineCause(String computerName)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(MaintenanceWindow other)
      Specified by:
      compareTo in interface Comparable<MaintenanceWindow>