@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class MaintenanceHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addMaintenanceWindow(String computerName,
MaintenanceWindow mw)
Adds a maintenance window to a computer.
|
void |
createAgent(String nodeName) |
void |
deleteAgent(String computerName) |
void |
deleteMaintenanceWindow(String computerName,
String id)
Delete maintenance window from computer.
|
static MaintenanceHelper |
getInstance() |
MaintenanceWindow |
getMaintenance(String computerName)
Returns the first maintenance that is currently active or
null
if configured maintenance windows are not active. |
SortedSet<MaintenanceWindow> |
getMaintenanceWindows(String computerName)
Returns the list of all configured maintenance windows for the computer with
the given name.
|
boolean |
hasMaintenanceWindows(String computerName) |
boolean |
injectRetentionStrategy(Computer c)
Inject the agent maintenance retention strategy from the given computer.
|
boolean |
removeRetentionStrategy(Computer c)
Remove the agent maintenance retention strategy from the given computer.
|
void |
renameAgent(String oldName,
String newName)
Keeps track of agent renames.
|
void |
saveMaintenanceWindows(String computerName,
SortedSet<MaintenanceWindow> maintenanceWindows)
Save maintenance window for computer.
|
public boolean hasMaintenanceWindows(String computerName) throws IOException
IOExceptionpublic void addMaintenanceWindow(String computerName, MaintenanceWindow mw) throws IOException
computerName - Name of the computer for which to add the maintenance
windowmw - The maintance windowsIOException - when writing the xml failedpublic void deleteMaintenanceWindow(String computerName, String id) throws IOException
computerName - Name of the computerid - Id of the maintenance windowIOException - when writing the xml failed@NonNull public SortedSet<MaintenanceWindow> getMaintenanceWindows(String computerName) throws IOException
computerName - name of the agent for which to return maintenance windowsIOException - when an error occured reading the xml@CheckForNull public MaintenanceWindow getMaintenance(String computerName)
null
if configured maintenance windows are not active. All maintenance windows
that are finished are removed.computerName - Name of computerpublic static MaintenanceHelper getInstance()
public void saveMaintenanceWindows(String computerName, SortedSet<MaintenanceWindow> maintenanceWindows) throws IOException
computerName - Name of computermaintenanceWindows - A set of maintenance windowsIOException - when writing the xml failedpublic void deleteAgent(String computerName)
public void renameAgent(String oldName, String newName)
oldName - Old name of the agentnewName - new name of the agentpublic void createAgent(String nodeName)
public boolean injectRetentionStrategy(Computer c)
c - The computer for which to inject the strategypublic boolean removeRetentionStrategy(Computer c)
c - The computer for which to remove the strategyCopyright © 2016–2022. All rights reserved.