Class MaintenanceLink

java.lang.Object
hudson.model.ManagementLink
com.sap.prd.jenkins.plugins.agent_maintenance.MaintenanceLink
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject

@Extension public class MaintenanceLink extends ManagementLink
Link on manage Jenkins page to list all maintenance windows of all agents.
  • Constructor Details

    • MaintenanceLink

      public MaintenanceLink()
  • Method Details

    • getDescription

      public String getDescription()
      Overrides:
      getDescription in class ManagementLink
    • getDisplayName

      public String getDisplayName()
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
      Specified by:
      getIconFileName in class ManagementLink
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
      Specified by:
      getUrlName in class ManagementLink
    • getRequiredPermission

      public Permission getRequiredPermission()
      Overrides:
      getRequiredPermission in class ManagementLink
    • getAgents

      public List<MaintenanceAction> getAgents()
      List of actions.
      Returns:
      List of actions
    • getError

      public String getError()
      The message of the last error that occured.
      Returns:
      error message
    • hasError

      public boolean hasError()
    • getBadge

      public Badge getBadge()
      Overrides:
      getBadge in class ManagementLink
    • deleteMaintenance

      @JavaScriptMethod public boolean deleteMaintenance(String id, String computerName) throws IOException, javax.servlet.ServletException
      Delete given maintenance window.
      Parameters:
      id - The id of the maintenance to delete
      computerName - The name of the computer to which the maintenance belongs
      Throws:
      IOException
      javax.servlet.ServletException
    • deleteMultiple

      @JavaScriptMethod public String[] deleteMultiple(net.sf.json.JSONObject json) throws IOException, javax.servlet.ServletException
      Delete selected maintenance windows.
      Parameters:
      json - An json with maintenance ids to delete and corresponding computer names
      Throws:
      IOException
      javax.servlet.ServletException
    • getMaintenanceStatus

      @JavaScriptMethod public Map<String,Boolean> getMaintenanceStatus()
      UI method to fetch status about maintenance windows.
      Returns:
      A Map containing for each maintenance window whether it is active or not.
    • doCheckLabel

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public FormValidation doCheckLabel(@QueryParameter String value)
    • doAutoCompleteLabel

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public AutoCompletionCandidates doAutoCompleteLabel(@QueryParameter String value)
    • doAdd

      @POST public void doAdd(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
      Add a maintenance window to a list of machines.
      Parameters:
      req - StaplerRequest
      rsp - StaplerResponse
      Throws:
      IOException - when saving xml failed
      javax.servlet.ServletException - when reading the form failed
    • getMaintenanceWindowClass

      public Class<MaintenanceWindow> getMaintenanceWindowClass()