提交 e234c290 编写于 作者: O Oliver Gondža

Introduce MonitorOfflineCause

上级 e382bbae
......@@ -51,7 +51,7 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
* Value object that represents the disk space.
*/
@ExportedBean
public static final class DiskSpace extends OfflineCause implements Serializable {
public static final class DiskSpace extends MonitorOfflineCause implements Serializable {
private final String path;
@Exported
public final long size;
......@@ -119,6 +119,7 @@ public abstract class DiskSpaceMonitorDescriptor extends AbstractAsyncNodeMonito
this.triggered = triggered;
}
@Override
public Class<? extends AbstractDiskSpaceMonitor> getTrigger() {
return trigger;
}
......
/*
* The MIT License
*
* Copyright (c) 2014 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.node_monitors;
import hudson.slaves.OfflineCause;
/**
* Offline cause to denote it was node monitor what put computer offline.
*
* @author ogondza
* @since TODO
*/
public abstract class MonitorOfflineCause extends OfflineCause {
/**
* Identify monitor implementation that put computer offline.
*/
public abstract Class<? extends NodeMonitor> getTrigger();
}
......@@ -142,7 +142,7 @@ public class ResponseTimeMonitor extends NodeMonitor {
* Immutable representation of the monitoring data.
*/
@ExportedBean
public static final class Data extends OfflineCause implements Serializable {
public static final class Data extends MonitorOfflineCause implements Serializable {
/**
* Record of the past 5 times. -1 if time out. Otherwise in milliseconds.
* Old ones first.
......@@ -204,6 +204,11 @@ public class ResponseTimeMonitor extends NodeMonitor {
return getAverage()+"ms";
}
@Override
public Class<? extends NodeMonitor> getTrigger() {
return ResponseTimeMonitor.class;
}
private static final long serialVersionUID = 1L;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册