public final class XmlRpcNotifier extends Object
This class create an XMLRPC client and provide methods to notify the external XMLRPC server if a failure occurs during processing an event.
Constructor and Description |
---|
XmlRpcNotifier(XmlrpcServer[] rpcServers,
int retries,
int elapseTime,
boolean verifyServer,
String localServer)
The constructor
|
Modifier and Type | Method and Description |
---|---|
void |
createConnection()
This method try to find an external xmlrpc server which is alive and and
can communicate with.
|
boolean |
notifyFailure(long txNo,
String uei,
String reason)
Notify the external xmlrpc server the occurance of failure during
processing an event.
|
boolean |
notifyReceivedEvent(long txNo,
String uei,
String message)
Notify the external xmlrpc server the request has been received.
|
boolean |
notifySuccess(long txNo,
String uei,
String message)
Notify the external xmlrpc server the success of processing an event.
|
boolean |
sendEvent(Event event)
Notify the external event xmlrpc server of the occurrence of a generic
event -- ie.
|
boolean |
sendInterfaceDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'interfaceDown'
event.
|
boolean |
sendInterfaceUpEvent(Event event)
Notify the external xmlrpc server the occurance of the 'interfaceUp'
event.
|
boolean |
sendNodeDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeDown' event.
|
boolean |
sendNodeUpEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeUp' event.
|
boolean |
sendServiceDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeLostService'
event.
|
boolean |
sendServiceUpEvent(Event event)
Notify the external xmlrpc server the occurance of the
'nodeRegainedService' event.
|
public XmlRpcNotifier(XmlrpcServer[] rpcServers, int retries, int elapseTime, boolean verifyServer, String localServer)
rpcServers
- an array of XmlrpcServer
objects.retries
- a int.elapseTime
- a int.verifyServer
- a boolean.localServer
- a String
object.public boolean notifySuccess(long txNo, String uei, String message)
Notify the external xmlrpc server the success of processing an event.
txNo
- the external transaction number for an event.uei
- the event uei.message
- the text message to indicate the success.public boolean notifyFailure(long txNo, String uei, String reason)
Notify the external xmlrpc server the occurance of failure during processing an event.
txNo
- the external transaction number for an event.uei
- the event uei.reason
- the text message to explain the reason of the failure to the
external xmlrpc server.public boolean notifyReceivedEvent(long txNo, String uei, String message)
Notify the external xmlrpc server the request has been received.
txNo
- the external transaction number for an event.uei
- the event uei.message
- text message to notify the external xmlrpc server.public boolean sendServiceDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeLostService' event.
event
- a Event
object.public boolean sendServiceUpEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeRegainedService' event.
event
- a Event
object.public boolean sendInterfaceDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'interfaceDown' event.
event
- a Event
object.public boolean sendInterfaceUpEvent(Event event)
Notify the external xmlrpc server the occurance of the 'interfaceUp' event.
event
- a Event
object.public boolean sendNodeDownEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeDown' event.
event
- a Event
object.public boolean sendNodeUpEvent(Event event)
Notify the external xmlrpc server the occurance of the 'nodeUp' event.
event
- a Event
object.public boolean sendEvent(Event event)
Notify the external event xmlrpc server of the occurrence of a generic event -- ie. an event that's been configured for XMLRPC forwarding, but which does not correspond to one of the specific event methods of this class
event
- a Event
object.public void createConnection()
This method try to find an external xmlrpc server which is alive and and can communicate with.
Note: If an xmlrpc server is found alive and could communicate with, an xmlrpc client is created to communicate with this server. The created xmlrpc client is kept for all the xmlrpc communications until the server is no longer available.
Copyright © 2015. All rights reserved.