Class MaintenanceAction
java.lang.Object
com.sap.prd.jenkins.plugins.agent_maintenance.MaintenanceAction
- All Implemented Interfaces:
Action
,ModelObject
Action to display link to maintenance window configuration.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
UI method to delete a maintenance window.String[]
deleteMultiple
(String[] ids) UI method to delete multiple maintenance windows.String[]
deleteMultipleRecurring
(String[] ids) UI method to delete multiple recurring maintenance windows.boolean
UI method to delete a recurring maintenance window.org.kohsuke.stapler.HttpResponse
doAdd
(org.kohsuke.stapler.StaplerRequest req) UI method to add a maintenance window.void
doAddRecurring
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) UI method to add a recurring maintenance window.org.kohsuke.stapler.HttpResponse
doConfigSubmit
(org.kohsuke.stapler.StaplerRequest req) UI method to submit the configuration.void
doDisable
(org.kohsuke.stapler.StaplerResponse rsp) UI method to remove the retention strategy.void
doEnable
(org.kohsuke.stapler.StaplerResponse rsp) UI method to enable the retention strategy.static String
The default end time shown in the UI when adding a new maintenance windows.static String
The default start time shown in the UI when adding a new maintenance windows.UI method to fetch status about maintenance windows.Returns a list of maintenance windows.Returns a list of recurring maintenance windows.boolean
Return whether there are active maintenance windows.boolean
Return whether there are maintenance windows defined.boolean
boolean
-
Field Details
-
CONFIGURE_AND_DISCONNECT
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final Permission[] CONFIGURE_AND_DISCONNECT
-
-
Constructor Details
-
MaintenanceAction
-
-
Method Details
-
getComputer
-
isVisible
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isVisible() -
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-
getMaintenanceWindowClass
-
getRecurringMaintenanceWindowClass
-
isEnabled
public boolean isEnabled() -
getDefaultStartTime
The default start time shown in the UI when adding a new maintenance windows. Current time.- Returns:
- end time
-
getDefaultEndTime
The default end time shown in the UI when adding a new maintenance windows. Current time + 1 day.- Returns:
- end time
-
hasMaintenanceWindows
public boolean hasMaintenanceWindows()Return whether there are maintenance windows defined.- Returns:
- true when there are maintenance windows defined.
-
hasActiveMaintenanceWindows
public boolean hasActiveMaintenanceWindows()Return whether there are active maintenance windows.- Returns:
- true when there are active maintenance windows defined.
-
getMaintenanceWindows
Returns a list of maintenance windows.- Returns:
- A list of maintenance windows
-
getRecurringMaintenanceWindows
Returns a list of recurring maintenance windows.- Returns:
- A list of recurring maintenance windows
-
doAdd
@POST public org.kohsuke.stapler.HttpResponse doAdd(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException UI method to add a maintenance window.- Parameters:
req
- Stapler Request- Returns:
- Response containing the result of the add
- Throws:
IOException
- when writing failsjavax.servlet.ServletException
- if an error occurs reading the form
-
doAddRecurring
@POST public void doAddRecurring(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException UI method to add a recurring maintenance window.- Parameters:
req
- Stapler Requestrsp
- Stapler Response- Throws:
IOException
- when writing failsjavax.servlet.ServletException
- if an error occurs reading the form
-
deleteMultiple
UI method to delete multiple maintenance windows.- Parameters:
ids
- A list of maintenance window ids to delete
-
getMaintenanceStatus
UI method to fetch status about maintenance windows.- Returns:
- A Map containing for each maintenance window whether it is active or not.
-
deleteMultipleRecurring
UI method to delete multiple recurring maintenance windows.- Parameters:
ids
- A list of recurring maintenance window ids to delete
-
deleteMaintenance
UI method to delete a maintenance window.- Parameters:
id
- The id of the maintenance to delete
-
deleteRecurringMaintenance
UI method to delete a recurring maintenance window.- Parameters:
id
- The id of the maintenance to delete
-
doConfigSubmit
@POST public org.kohsuke.stapler.HttpResponse doConfigSubmit(org.kohsuke.stapler.StaplerRequest req) throws IOException, javax.servlet.ServletException UI method to submit the configuration.- Parameters:
req
- Stapler Request- Returns:
- Response containing the result of the add
- Throws:
IOException
- when writing failsjavax.servlet.ServletException
- if an error occurs reading the form
-
doEnable
UI method to enable the retention strategy.- Parameters:
rsp
- Stapler Response- Throws:
IOException
- when something goes wrong
-
doDisable
UI method to remove the retention strategy.- Parameters:
rsp
- Stapler Response- Throws:
IOException
- when something goes wrong
-