OpenNMS API 1.2.9

org.opennms.netmgt.notifd
Class XMPPNotificationManager

java.lang.Object
  extended byorg.opennms.netmgt.notifd.XMPPNotificationManager

public class XMPPNotificationManager
extends java.lang.Object

Singleton class used to send messages to an XMPP Server. Used by XMPPNotificationStragetgy and XMPPGroupNotificationStrategy

Author:
Jonathan Sartin

Field Summary
private  org.jivesoftware.smack.ConnectionListener conlistener
           
private static XMPPNotificationManager instance
           
private static java.lang.String LOG4J_CATEGORY
           
private  java.util.Properties props
           
private  java.util.HashMap rooms
           
private  boolean useSSL
           
private static org.jivesoftware.smack.XMPPConnection xmpp
           
private static int XMPP_PORT
           
private static java.lang.String XMPP_RESOURCE
           
private  java.lang.String xmppPassword
           
private  int xmppPort
           
private  java.lang.String xmppServer
           
private  java.lang.String xmppUser
           
 
Constructor Summary
protected XMPPNotificationManager()
           
 
Method Summary
static XMPPNotificationManager getInstance()
          get an instance of the XMPPNotificationManager
 boolean isLoggedIn()
          Check if manager is logged in to xmpp server.
protected  org.apache.log4j.Category log()
           
private  void login()
           
 boolean sendGroupChat(java.lang.String xmppChatRoom, java.lang.String xmppMessage)
          send an xmpp message to a specified Chat Room.
 boolean sendMessage(java.lang.String xmppTo, java.lang.String xmppMessage)
          send an xmpp message to a specified recipient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

props

private java.util.Properties props

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
See Also:
Constant Field Values

XMPP_RESOURCE

private static final java.lang.String XMPP_RESOURCE
See Also:
Constant Field Values

XMPP_PORT

private static final int XMPP_PORT
See Also:
Constant Field Values

xmpp

private static org.jivesoftware.smack.XMPPConnection xmpp

xmppServer

private java.lang.String xmppServer

xmppUser

private java.lang.String xmppUser

xmppPassword

private java.lang.String xmppPassword

xmppPort

private int xmppPort

useSSL

private boolean useSSL

rooms

private java.util.HashMap rooms

instance

private static XMPPNotificationManager instance

conlistener

private org.jivesoftware.smack.ConnectionListener conlistener
Constructor Detail

XMPPNotificationManager

protected XMPPNotificationManager()
Method Detail

getInstance

public static XMPPNotificationManager getInstance()
get an instance of the XMPPNotificationManager

Returns:
instance of XMPPNotificationManager

login

private void login()

isLoggedIn

public boolean isLoggedIn()
Check if manager is logged in to xmpp server.

Returns:
true if logged in, false otherwise

sendMessage

public boolean sendMessage(java.lang.String xmppTo,
                           java.lang.String xmppMessage)
send an xmpp message to a specified recipient.

Parameters:
xmppTo - recipient of the xmpp message
xmppMessage - text to be sent in the body of the message
Returns:
true if message is sent, false otherwise

sendGroupChat

public boolean sendGroupChat(java.lang.String xmppChatRoom,
                             java.lang.String xmppMessage)
send an xmpp message to a specified Chat Room.

Parameters:
xmppChatRoom - room to send message to.
xmppMessage - text to be sent in the body of the message
Returns:
true if message is sent, false otherwise

log

protected org.apache.log4j.Category log()

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.