|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.androidpn.server.xmpp.net.Connection
public class Connection
This class represents a XMPP connection on the server.
Constructor Summary | |
---|---|
Connection(org.apache.mina.core.session.IoSession ioSession)
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes the session including associated socket connection, notifing all listeners that the channel is shutting down. |
void |
deliver(org.xmpp.packet.Packet packet)
Delivers the packet to this connection (without checking the recipient). |
void |
deliverRawText(java.lang.String text)
Delivers raw text to this connection (in asynchronous mode). |
java.lang.String |
getHostAddress()
Returns the IP address. |
java.lang.String |
getHostName()
Gets the host name for the IP address. |
java.lang.String |
getLanguage()
Returns the language code that should be used for this connection. |
int |
getMajorXMPPVersion()
Returns the major version of XMPP being used by this connection. |
int |
getMinorXMPPVersion()
Returns the minor version of XMPP being used by this connection. |
void |
init(Session session)
Initializes the connection with it's owning session. |
boolean |
isClosed()
Returns true if the connection is closed. |
void |
registerCloseListener(ConnectionCloseListener listener)
Registers a listener for close event notification. |
void |
setLanaguage(java.lang.String language)
Sets the language code that should be used for this connection. |
void |
setXMPPVersion(int majorVersion,
int minorVersion)
Sets the XMPP version information. |
void |
systemShutdown()
Sends notification message indicating that the server is being shutdown. |
void |
unregisterCloseListener(ConnectionCloseListener listener)
Removes a registered close event listener. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Connection(org.apache.mina.core.session.IoSession ioSession)
ioSession
- the IoSessionMethod Detail |
---|
public void close()
public void systemShutdown()
public void init(Session session)
session
- the session that owns this connectionpublic boolean isClosed()
public void registerCloseListener(ConnectionCloseListener listener)
listener
- the listener to register for close events.public void unregisterCloseListener(ConnectionCloseListener listener)
listener
- the listener to unregister for close events.public void deliver(org.xmpp.packet.Packet packet)
packet
- the packet to deliverpublic void deliverRawText(java.lang.String text)
text
- the XML stanza string to deliverpublic java.lang.String getHostAddress() throws java.net.UnknownHostException
java.net.UnknownHostException
- if IP address of host could not be determined.public java.lang.String getHostName() throws java.net.UnknownHostException
java.net.UnknownHostException
- if IP address of host could not be determined.public int getMajorXMPPVersion()
public int getMinorXMPPVersion()
public void setXMPPVersion(int majorVersion, int minorVersion)
majorVersion
- the major versionminorVersion
- the minor versionpublic java.lang.String getLanguage()
public void setLanaguage(java.lang.String language)
language
- the language code
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |