rj.tools.ccscrape
Class Monitor

java.lang.Object
  extended by rj.tools.ccscrape.Monitor

public class Monitor
extends java.lang.Object

Monitors a URL from a Cruise Control website and switches lamps on or off depending whether the build is ok or broken.

Version:
$Revision
Author:
jochamrm

Field Summary
static java.lang.String ACTIVE
           
static java.lang.String INACTIVE
           
 
Constructor Summary
Monitor(int seconds, java.lang.String comm, java.lang.String ok, java.lang.String fail, java.net.URL url, java.lang.String startTime, java.lang.String stopTime)
          Creates a new instance
 
Method Summary
 void addMonitorListener(MonitorListener listener)
           
 void allOff()
          switch off all lamps
 void allOn()
          switch on all lamps
 java.lang.String getRunStatus()
           
 boolean isBuildOk()
          Returns whether the current state of the build is ok.
static void main(java.lang.String[] args)
          Run startMonitor from the command line
 void removeMonitorListener(MonitorListener listener)
           
 void startMonitor()
          Start the monitoring for the URL and the ok and feil devices
 void stopMonitor()
          Stop the monitoring for the URL and the ok and feil devices
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INACTIVE

public static final java.lang.String INACTIVE
See Also:
Constant Field Values

ACTIVE

public static final java.lang.String ACTIVE
See Also:
Constant Field Values
Constructor Detail

Monitor

public Monitor(int seconds,
               java.lang.String comm,
               java.lang.String ok,
               java.lang.String fail,
               java.net.URL url,
               java.lang.String startTime,
               java.lang.String stopTime)
Creates a new instance

Parameters:
seconds - between checks
comm - port to use
ok - address
fail - address
url - to startMonitor
Method Detail

main

public static void main(java.lang.String[] args)
Run startMonitor from the command line

Parameters:
args -

addMonitorListener

public void addMonitorListener(MonitorListener listener)

removeMonitorListener

public void removeMonitorListener(MonitorListener listener)

allOff

public void allOff()
switch off all lamps


allOn

public void allOn()
switch on all lamps


startMonitor

public void startMonitor()
Start the monitoring for the URL and the ok and feil devices


stopMonitor

public void stopMonitor()
Stop the monitoring for the URL and the ok and feil devices


isBuildOk

public boolean isBuildOk()
Returns whether the current state of the build is ok. This is cached value from the last check which is run all n seconds.

Returns:
build status

getRunStatus

public java.lang.String getRunStatus()


(c) 1999-2005 by Ralph Jocham (rjocham72@netscape.net)
JCSC is released under the terms of the GNU General Public License