OpenNMS API 1.1.3

org.opennms.netmgt.outage
Class XmlRpcNotifier

java.lang.Object
  extended byorg.opennms.netmgt.outage.XmlRpcNotifier

public final class XmlRpcNotifier
extends java.lang.Object

This class create an XMLRPC client and provide methods to notify the external XMLRPC server for 'nodeLostService', 'nodeRegainedService', 'interfaceDown', 'interfaceUp', 'nodeDown' and 'nodeUp' events.

Author:
James Zuo, OpenNMS.org

Field Summary
private  Event m_event
          The event from which data is to be read
private  org.apache.xmlrpc.XmlRpcClient m_notifier
          The xmlrpc client to be used to notify the external xmlrpc server of the occurance of an event
 
Constructor Summary
XmlRpcNotifier(java.lang.String url, Event event)
          The constructor
 
Method Summary
private  java.lang.String getNodeLabel(long nodeId)
           This method retrieves the nodeLable from the database for a given nodeId.
 java.lang.String sendInterfaceDownEvent()
          Notify the external xmlrpc server the occurance of the 'interfaceDown' event.
 java.lang.String sendInterfaceUpEvent()
          Notify the external xmlrpc server the occurance of the 'interfaceUp' event.
 java.lang.String sendNodeDownEvent()
          Notify the external xmlrpc server the occurance of the 'nodeDown' event.
 java.lang.String sendNodeUpEvent()
          Notify the external xmlrpc server the occurance of the 'nodeUp' event.
 java.lang.String sendServiceDownEvent()
          Notify the external xmlrpc server the occurance of the 'nodeLostService' event.
 java.lang.String sendServiceUpEvent()
          Notify the external xmlrpc server the occurance of the 'nodeRegainedService' event.
private  java.lang.String sendXmlrpcRequest(java.lang.String command, java.util.Vector params)
          This method sends an xmlrpc request to an external xmlrpc server and gets the response from the xmlrpc server as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_event

private Event m_event
The event from which data is to be read


m_notifier

private org.apache.xmlrpc.XmlRpcClient m_notifier
The xmlrpc client to be used to notify the external xmlrpc server of the occurance of an event

Constructor Detail

XmlRpcNotifier

public XmlRpcNotifier(java.lang.String url,
                      Event event)
               throws java.net.MalformedURLException
The constructor

Parameters:
url - the xmlrpc server url
event - the event to be notified to the external xmlrpc server
Method Detail

sendServiceDownEvent

public java.lang.String sendServiceDownEvent()
                                      throws org.apache.xmlrpc.XmlRpcException,
                                             java.io.IOException

Notify the external xmlrpc server the occurance of the 'nodeLostService' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendServiceUpEvent

public java.lang.String sendServiceUpEvent()
                                    throws org.apache.xmlrpc.XmlRpcException,
                                           java.io.IOException

Notify the external xmlrpc server the occurance of the 'nodeRegainedService' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendInterfaceDownEvent

public java.lang.String sendInterfaceDownEvent()
                                        throws org.apache.xmlrpc.XmlRpcException,
                                               java.io.IOException

Notify the external xmlrpc server the occurance of the 'interfaceDown' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendInterfaceUpEvent

public java.lang.String sendInterfaceUpEvent()
                                      throws org.apache.xmlrpc.XmlRpcException,
                                             java.io.IOException

Notify the external xmlrpc server the occurance of the 'interfaceUp' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendNodeDownEvent

public java.lang.String sendNodeDownEvent()
                                   throws org.apache.xmlrpc.XmlRpcException,
                                          java.io.IOException

Notify the external xmlrpc server the occurance of the 'nodeDown' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendNodeUpEvent

public java.lang.String sendNodeUpEvent()
                                 throws org.apache.xmlrpc.XmlRpcException,
                                        java.io.IOException

Notify the external xmlrpc server the occurance of the 'nodeUp' event.

Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

sendXmlrpcRequest

private java.lang.String sendXmlrpcRequest(java.lang.String command,
                                           java.util.Vector params)
                                    throws org.apache.xmlrpc.XmlRpcException,
                                           java.io.IOException

This method sends an xmlrpc request to an external xmlrpc server and gets the response from the xmlrpc server as a String.

Parameters:
command - The server command to process the request.
params - a list of parameters need for the external server command to process the request.
Throws:
org.apache.xmlrpc.XmlRpcException
java.io.IOException

getNodeLabel

private java.lang.String getNodeLabel(long nodeId)

This method retrieves the nodeLable from the database for a given nodeId.

Parameters:
nodeId - the nodeId to retrieve the node label for.

OpenNMS API 1.1.3

Generated by root on August 18 2004 0350.