Package hudson.node_monitors
Class AbstractNodeMonitorDescriptor<T>
- Type Parameters:
T
- represents the result of the monitoring.
- Direct Known Subclasses:
AbstractAsyncNodeMonitorDescriptor
Convenient base class for common
NodeMonitor
implementation
where the "monitoring" consists of executing something periodically on every node
and taking some action based on its result.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.protected
AbstractNodeMonitorDescriptor
(long interval) Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
protected
AbstractNodeMonitorDescriptor
(Class<? extends NodeMonitor> clazz) Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
protected
AbstractNodeMonitorDescriptor
(Class<? extends NodeMonitor> clazz, long interval) Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates if this monitor is capable to take agents offline in case it detects a problem.Obtains the monitoring result currently available, or null if no data is available.protected long
Controls the time out of monitoring.long
The timestamp that indicates when the last round of the monitoring has completed.boolean
Is this monitor currently ignored?protected boolean
Deprecated.as of 1.320 UsemarkOffline(Computer, OfflineCause)
to specify the cause.protected boolean
markOffline
(Computer c, OfflineCause oc) Utility method to mark the computer offline for derived classes.protected boolean
Utility method to mark the computer online for derived classes.monitor()
Performs monitoring across the board.protected abstract T
Performs monitoring of the given computer object.Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
AbstractNodeMonitorDescriptor
Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
-
AbstractNodeMonitorDescriptor
Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
-
AbstractNodeMonitorDescriptor
Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
-
AbstractNodeMonitorDescriptor
@Deprecated protected AbstractNodeMonitorDescriptor(Class<? extends NodeMonitor> clazz, long interval) Deprecated.as of 1.522 Extend fromAbstractAsyncNodeMonitorDescriptor
-
-
Method Details
-
canTakeOffline
public boolean canTakeOffline()Indicates if this monitor is capable to take agents offline in case it detects a problem. If true, this will enable the configuration option to ignore the monitor. Defaults totrue
so plugins that do not override this method behave as before. Plugins that do implement a monitor that will not take agents offline should override this method and return false.- Returns:
- true if this monitor might take agents offline
- Since:
- 2.437
-
getConfigPage
- Overrides:
getConfigPage
in classDescriptor<NodeMonitor>
-
monitor
Performs monitoring of the given computer object. This method is invoked periodically to perform the monitoring of the computer.- Returns:
- Application-specific value that represents the observed monitoring value
on the given node. This value will be returned from the
get(Computer)
method. If null is returned, it will be interpreted as "no observed value." This is convenient way of abandoning the observation on a particular computer, whereasIOException
is useful for indicating a hard error that needs to be corrected. - Throws:
IOException
InterruptedException
-
monitor
Performs monitoring across the board.- Returns:
- For all the computers, report the monitored values.
- Throws:
InterruptedException
-
get
Obtains the monitoring result currently available, or null if no data is available.If no data is available, a background task to collect data will be started.
-
getTimestamp
public long getTimestamp()The timestamp that indicates when the last round of the monitoring has completed. -
getTimestampString
-
isIgnored
public boolean isIgnored()Is this monitor currently ignored? -
markOnline
Utility method to mark the computer online for derived classes.- Returns:
- true if the node was actually taken online by this act (as opposed to us deciding not to do it, or the computer was already online.)
-
markOffline
Utility method to mark the computer offline for derived classes.- Returns:
- true if the node was actually taken offline by this act (as opposed to us deciding not to do it, or the computer already marked offline.)
-
markOffline
Deprecated.as of 1.320 UsemarkOffline(Computer, OfflineCause)
to specify the cause. -
getMonitoringTimeOut
protected long getMonitoringTimeOut()Controls the time out of monitoring.
-
AbstractAsyncNodeMonitorDescriptor