com.cisco.services.alarm
Class DefaultAlarmWriter

java.lang.Object
  extended by com.cisco.services.alarm.DefaultAlarmWriter
All Implemented Interfaces:
AlarmWriter

public class DefaultAlarmWriter
extends java.lang.Object
implements AlarmWriter

DefaultAlarmWriter implementation of the AlarmWriter interface.
DefaultAlarmWriter maintains a queue of a fixed size to which the alarms are written. The sending of the alarms to the alarm service takes place on a seperate thread. The queue is fixed size.


Constructor Summary
DefaultAlarmWriter(int port, java.lang.String alarmServiceName)
          Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and a queue size of fifty (50).
DefaultAlarmWriter(int port, java.lang.String alarmServiceName, int queueSize)
          Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue size.
DefaultAlarmWriter(int port, java.lang.String alarmServiceName, int queueSize, ConditionalTrace debugTrace_, UnconditionalTrace errorTrace_)
          Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue size.
 
Method Summary
 void close()
          Shutdown the send thread and close the socket
 java.lang.String getDescription()
           
 boolean getEnabled()
           
 java.lang.String getName()
           
static void main(java.lang.String[] args)
           
 void send(java.lang.String alarmMessage)
          send the Alarm to the alarm service
 void setEnabled(boolean enable)
          Applications can dynamically enable or disable the AlarmWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAlarmWriter

public DefaultAlarmWriter(int port,
                          java.lang.String alarmServiceName,
                          int queueSize)
                   throws java.net.UnknownHostException
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue size. The AlarmService is listening on this port for Alarm messages.

Parameters:
port - port on which the alarm service is listening
alarmServiceName - The host name of the machine with the Alarm service
queueSize - the size of the queue to be maintained in the alarm writer
Throws:
java.net.UnknownHostException

DefaultAlarmWriter

public DefaultAlarmWriter(int port,
                          java.lang.String alarmServiceName)
                   throws java.net.UnknownHostException
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and a queue size of fifty (50). The AlarmService is listening on this port for Alarm messages.

Parameters:
port - port on which the alarm service is listening
alarmServiceName - The host name of the machine with the Alarm service
Throws:
java.net.UnknownHostException

DefaultAlarmWriter

public DefaultAlarmWriter(int port,
                          java.lang.String alarmServiceName,
                          int queueSize,
                          ConditionalTrace debugTrace_,
                          UnconditionalTrace errorTrace_)
                   throws java.net.UnknownHostException
Constructor for the DefaultAlarmWriter which takes the AlarmService hostname, port and queue size. The AlarmService is listening on this port for Alarm messages.

Parameters:
port - port on which the alarm service is listening
alarmServiceName - The host name of the machine with the Alarm service
queueSize - the size of the queue to be maintained in the alarm writer
Throws:
java.net.UnknownHostException
Method Detail

send

public void send(java.lang.String alarmMessage)
send the Alarm to the alarm service

Specified by:
send in interface AlarmWriter
Parameters:
alarmMessage - The Alarm to be sent

close

public void close()
Shutdown the send thread and close the socket

Specified by:
close in interface AlarmWriter

getName

public java.lang.String getName()
Specified by:
getName in interface AlarmWriter
Returns:
the name of the AlarmWriter

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface AlarmWriter
Returns:
a short description of the AlarmWriter

getEnabled

public boolean getEnabled()
Specified by:
getEnabled in interface AlarmWriter
Returns:
the enabled state of the AlarmWriter

setEnabled

public void setEnabled(boolean enable)
Applications can dynamically enable or disable the AlarmWriter

Specified by:
setEnabled in interface AlarmWriter
Parameters:
enable - Enable or disable the AlarmWriter

main

public static void main(java.lang.String[] args)