uk.org.iscream.cms.server.client.alerters
Class IRC__Alerter

java.lang.Object
  extended byjava.lang.Thread
      extended byuk.org.iscream.cms.server.client.AlerterSkeleton
          extended byuk.org.iscream.cms.server.client.alerters.IRC__Alerter
All Implemented Interfaces:
PluginAlerter, Runnable

public class IRC__Alerter
extends AlerterSkeleton

This Alert sends an IRC message. Clean shutdown could be achieved by stopping the run() method in the IRCBot inner class.

Version:
$Id: IRC__Alerter.java,v 1.36 2004/08/01 10:40:43 tdb Exp $
Author:
$Author: tdb $

Nested Class Summary
(package private)  class IRC__Alerter.IRCBot
           
 
Field Summary
private  boolean _active
          Are we "active"
private  int _alertCount
          Number of alerts sent
private  int _ignoredCount
          Number of alerts ignored when in "stopped" mode
private  IRC__Alerter.IRCBot _ircbot
          A reference to the IRCBot
private  String _lastAlert
          The last alert that was sent
private  long _lastAlertTime
          The time of the last alert
protected  Logger _logger
          This holds a reference to the system logger that is being used.
private  String _name
          This is the friendly identifier of the component this class is running in.
private  long _startTime
          Time of IRCBot startup
 String DESC
          A description of this alerter
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class uk.org.iscream.cms.server.client.AlerterSkeleton
_cp, _qID, _running, DEFAULT_LEVEL, NOT_CONFIGURED
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
IRC__Alerter()
           
 
Method Summary
 String getDescription()
          Return the String representation of what the alerter does
protected  String getFName()
          Returns the "friendly" name of this class.
 void sendAlert(Alert alert)
          Implements the abstract method from the skeleton class.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class uk.org.iscream.cms.server.client.AlerterSkeleton
getQueue, getQueueId, processAlertMessage, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

DESC

public final String DESC
A description of this alerter

See Also:
Constant Field Values

_ircbot

private IRC__Alerter.IRCBot _ircbot
A reference to the IRCBot


_active

private boolean _active
Are we "active"


_lastAlert

private String _lastAlert
The last alert that was sent


_lastAlertTime

private long _lastAlertTime
The time of the last alert


_alertCount

private int _alertCount
Number of alerts sent


_ignoredCount

private int _ignoredCount
Number of alerts ignored when in "stopped" mode


_startTime

private long _startTime
Time of IRCBot startup


_logger

protected Logger _logger
This holds a reference to the system logger that is being used.


_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.

Constructor Detail

IRC__Alerter

public IRC__Alerter()
Method Detail

sendAlert

public void sendAlert(Alert alert)
Implements the abstract method from the skeleton class. This method will attempt to send an alert message over the IRC channel.

Specified by:
sendAlert in class AlerterSkeleton
Parameters:
alert - the alert to send

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.NameFormat class to format the toString()

Returns:
the name of this class and its CVS revision

getDescription

public String getDescription()
Return the String representation of what the alerter does

Specified by:
getDescription in interface PluginAlerter
Specified by:
getDescription in class AlerterSkeleton
Returns:
the description

getFName

protected String getFName()
Returns the "friendly" name of this class. This is simply an accessor for _name, required due to inheritance issues with extending AlerterSkeleton.

Specified by:
getFName in class AlerterSkeleton
Returns:
the friendly name


Copyright © 2000-2003 i-scream. All Rights Reserved.