edu.internet2.middleware.grouper.xmpp
Class XmppConnectionBean

java.lang.Object
  extended by edu.internet2.middleware.grouper.xmpp.XmppConnectionBean

public class XmppConnectionBean
extends Object

represents a connection to an XMPP server. There is one connection per server/port/user/resource

Author:
mchyzer

Constructor Summary
XmppConnectionBean()
          default constructor
XmppConnectionBean(String theResource)
          constructor with default everything and different resource
XmppConnectionBean(String theServer, int thePort, String theUser, String theResource, String thePass)
          constructor with different stuff than the default
 
Method Summary
 org.jivesoftware.smack.Chat chat(String jabberId, org.jivesoftware.smack.MessageListener messageListener)
          get or make a chat
 boolean equals(Object other)
           
 int hashCode()
           
 void sendMessage(String jabberIds, String payload)
          get a chat for a jabber id.
 org.jivesoftware.smack.XMPPConnection xmppConnection()
          get a connection object
 String xmppPass()
          xmpp pass (decrypted if file)
 int xmppPort()
          port to connect to, or 1522 as default
 String xmppResource()
          xmpp resource
 String xmppServer()
          xpp server to connect to
 String xmppUser()
          xmpp user
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmppConnectionBean

public XmppConnectionBean()
default constructor


XmppConnectionBean

public XmppConnectionBean(String theResource)
constructor with default everything and different resource

Parameters:
theResource -

XmppConnectionBean

public XmppConnectionBean(String theServer,
                          int thePort,
                          String theUser,
                          String theResource,
                          String thePass)
constructor with different stuff than the default

Parameters:
theServer -
thePort -
theUser -
theResource -
thePass -
Method Detail

equals

public boolean equals(Object other)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

sendMessage

public void sendMessage(String jabberIds,
                        String payload)
get a chat for a jabber id. Note this doesnt listen on the channel

Parameters:
jabberIds -
payload - of the message

xmppConnection

public org.jivesoftware.smack.XMPPConnection xmppConnection()
get a connection object

Returns:
the connection object

xmppPass

public String xmppPass()
xmpp pass (decrypted if file)

Returns:
the pass

xmppPort

public int xmppPort()
port to connect to, or 1522 as default

Returns:
port

xmppResource

public String xmppResource()
xmpp resource

Returns:
the resource

xmppServer

public String xmppServer()
xpp server to connect to

Returns:
xmpp server

xmppUser

public String xmppUser()
xmpp user

Returns:
the user

chat

public org.jivesoftware.smack.Chat chat(String jabberId,
                                        org.jivesoftware.smack.MessageListener messageListener)
get or make a chat

Parameters:
jabberId - to chat with
messageListener - to get callbacks on messages or null to just send. Note if there is already one registered, this one wont be used
Returns:
the chat