public final class SessionManager
extends java.lang.Object
implements org.jivesoftware.smack.ConnectionListener
Constructor and Description |
---|
SessionManager() |
Modifier and Type | Method and Description |
---|---|
void |
addPresenceListener(PresenceListener listener)
Adds a
PresenceListener to Spark. |
void |
authenticated(org.jivesoftware.smack.XMPPConnection xmppConnection,
boolean b) |
void |
changePresence(org.jivesoftware.smack.packet.Presence presence)
Update the current availability of the user
|
void |
connected(org.jivesoftware.smack.XMPPConnection xmppConnection) |
void |
connectionClosed()
Notify agent that the connection has been closed.
|
void |
connectionClosedOnError(java.lang.Exception ex)
Notify agent the connection was closed due to an exception.
|
java.lang.String |
getBareAddress()
Returns the users bare address.
|
org.jivesoftware.smack.XMPPConnection |
getConnection()
Returns the XMPPConnection used for this session.
|
org.jivesoftware.smackx.disco.packet.DiscoverItems |
getDiscoveredItems()
Returns the Discovered Items.
|
java.lang.String |
getJID()
Returns the jid of the Spark user.
|
java.lang.String |
getPassword()
Return the password associated with this session.
|
org.jivesoftware.smackx.iqprivate.PrivateDataManager |
getPersonalDataManager()
Returns the PrivateDataManager responsible for handling all private data for individual
agents.
|
java.lang.String |
getServerAddress()
Returns the host for this connection.
|
java.lang.String |
getUsername()
Return the username associated with this session.
|
void |
initializeSession(org.jivesoftware.smack.AbstractXMPPConnection connection,
java.lang.String username,
java.lang.String password)
Initializes session.
|
void |
reconnectingIn(int i) |
void |
reconnectionFailed(java.lang.Exception exception) |
void |
reconnectionSuccessful() |
void |
removePresenceListener(PresenceListener listener)
Remove a
PresenceListener from Spark. |
void |
setConnection(org.jivesoftware.smack.AbstractXMPPConnection con) |
void |
setJID(java.lang.String jid)
Sets the jid of the current Spark user.
|
void |
setServerAddress(java.lang.String address)
Set the server address
|
public void initializeSession(org.jivesoftware.smack.AbstractXMPPConnection connection, java.lang.String username, java.lang.String password)
connection
- the XMPPConnection used in this session.username
- the agents username.password
- the agents password.public org.jivesoftware.smack.XMPPConnection getConnection()
public org.jivesoftware.smackx.iqprivate.PrivateDataManager getPersonalDataManager()
public java.lang.String getServerAddress()
public void setServerAddress(java.lang.String address)
address
- the address of the server.public void connectionClosedOnError(java.lang.Exception ex)
connectionClosedOnError
in interface org.jivesoftware.smack.ConnectionListener
ex
- the Exception that took place.public void connected(org.jivesoftware.smack.XMPPConnection xmppConnection)
connected
in interface org.jivesoftware.smack.ConnectionListener
public void authenticated(org.jivesoftware.smack.XMPPConnection xmppConnection, boolean b)
authenticated
in interface org.jivesoftware.smack.ConnectionListener
public void connectionClosed()
connectionClosed
in interface org.jivesoftware.smack.ConnectionListener
public java.lang.String getUsername()
public java.lang.String getPassword()
public void changePresence(org.jivesoftware.smack.packet.Presence presence)
presence
- the current presence of the user.public java.lang.String getJID()
public void setJID(java.lang.String jid)
jid
- the jid of the current Spark user.public void addPresenceListener(PresenceListener listener)
PresenceListener
to Spark. PresenceListener's are used
to allow notification of when the Spark users changes their presence.listener
- the listener.public void removePresenceListener(PresenceListener listener)
PresenceListener
from Spark.listener
- the listener.public java.lang.String getBareAddress()
public org.jivesoftware.smackx.disco.packet.DiscoverItems getDiscoveredItems()
public void setConnection(org.jivesoftware.smack.AbstractXMPPConnection con)
public void reconnectingIn(int i)
reconnectingIn
in interface org.jivesoftware.smack.ConnectionListener
public void reconnectionSuccessful()
reconnectionSuccessful
in interface org.jivesoftware.smack.ConnectionListener
public void reconnectionFailed(java.lang.Exception exception)
reconnectionFailed
in interface org.jivesoftware.smack.ConnectionListener