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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Descriptor for UI only. -
Field Summary
-
Constructor Summary
ConstructorDescriptionMaintenanceWindow
(String startTime, String endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, int maxWaitMinutes, String userid, String id) Deprecated.MaintenanceWindow
(String startTime, String endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, String maxWaitMinutes, String userid, String id) Create a new maintenance window.MaintenanceWindow
(LocalDateTime startTime, LocalDateTime endTime, String reason, boolean takeOnline, boolean keepUpWhenActive, String maxWaitMinutes, String userid, String id) Create a new maintenance window. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
compareTo
(MaintenanceWindow other) boolean
getId()
int
getOfflineCause
(String computerName) int
hashCode()
boolean
boolean
boolean
Return the status of the maintenance.boolean
Checks if max waiting time is finished.boolean
protected Object
void
setAborted
(boolean aborted) Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Field Details
-
DATE_FORMATTER
-
DATE_INPUT_FORMATTER
-
-
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 timeendTime
- End timereason
- ReasontakeOnline
- Take online at end of maintenancekeepUpWhenActive
- Keep up while builds are runningmaxWaitMinutes
- Max waiting time before canceling running builds.userid
- Userid that created the maintenance windowid
- ID of the maintenance, usenull
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 timeendTime
- End timereason
- ReasontakeOnline
- Take online at end of maintenancekeepUpWhenActive
- Keep up while builds are runningmaxWaitMinutes
- 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 windowid
- ID of the maintenance, usenull
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 timeendTime
- End timereason
- ReasontakeOnline
- Take online at end of maintenancekeepUpWhenActive
- Keep up while builds are runningmaxWaitMinutes
- 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 windowid
- ID of the maintenance, usenull
to generate a new id
-
-
Method Details
-
getId
-
getUserid
-
isKeepUpWhenActive
public boolean isKeepUpWhenActive() -
buildsHaveBeenAborted
public boolean buildsHaveBeenAborted() -
setAborted
public void setAborted(boolean aborted) -
getMaxWaitMinutes
public int getMaxWaitMinutes() -
isTakeOnline
public boolean isTakeOnline() -
readResolve
-
getStartTime
-
getEndTime
-
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
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<MaintenanceWindow>
-