|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.androidpn.server.xmpp.session.Session
public abstract class Session
This is an abstract class for a session between the server and a client.
Field Summary | |
---|---|
static int |
STATUS_AUTHENTICATED
The session status when authenticated |
static int |
STATUS_CLOSED
The session status when closed |
static int |
STATUS_CONNECTED
The session status when connected |
Constructor Summary | |
---|---|
Session(java.lang.String serverName,
Connection conn,
java.lang.String streamID)
Constructor. |
Method Summary | |
---|---|
void |
close()
Close the session including associated socket connection. |
void |
deliver(org.xmpp.packet.Packet packet)
Delivers the packet to the associated connection. |
void |
deliverRawText(java.lang.String text)
Delivers raw text to the associated connection. |
org.xmpp.packet.JID |
getAddress()
Returns the address of the user in JID. |
abstract java.lang.String |
getAvailableStreamFeatures()
Returns a text with the available stream features. |
Connection |
getConnection()
Returns the connection associated with this session. |
java.util.Date |
getCreationDate()
Returns the creation date of this session. |
java.lang.String |
getHostAddress()
Returns the IP address. |
java.lang.String |
getHostName()
Gets the host name for the IP address. |
java.util.Date |
getLastActiveDate()
Returns the last activity time of this session. |
long |
getNumClientPackets()
Returns the number of packets sent from the client to the server. |
long |
getNumServerPackets()
Returns the number of packets sent from the server to the client. |
java.lang.String |
getServerName()
Returns the server name. |
int |
getStatus()
Returns the current status of this session. |
java.lang.String |
getStreamID()
Returns the stream ID associated with this sesison. |
void |
incrementClientPacketCount()
Increments the number of packets sent from the client to the server. |
void |
incrementServerPacketCount()
Increments the number of packets sent from the server to the client. |
boolean |
isClosed()
Returns true if the connection is closed. |
void |
process(org.xmpp.packet.Packet packet)
Process the packet. |
void |
setAddress(org.xmpp.packet.JID address)
Sets the new address of this session. |
void |
setStatus(int status)
Set the new status of this session. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STATUS_CLOSED
public static final int STATUS_CONNECTED
public static final int STATUS_AUTHENTICATED
Constructor Detail |
---|
public Session(java.lang.String serverName, Connection conn, java.lang.String streamID)
serverName
- the server nameconn
- the connectionstreamID
- the stream IDMethod Detail |
---|
public Connection getConnection()
public java.lang.String getServerName()
public java.lang.String getStreamID()
public org.xmpp.packet.JID getAddress()
public void setAddress(org.xmpp.packet.JID address)
address
- the new address of this sessionpublic int getStatus()
public void setStatus(int status)
status
- the new status of this sessionpublic java.util.Date getCreationDate()
public java.util.Date getLastActiveDate()
public void incrementClientPacketCount()
public void incrementServerPacketCount()
public long getNumClientPackets()
public long getNumServerPackets()
public void process(org.xmpp.packet.Packet packet)
packet
- the packet to processpublic 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 void close()
public boolean isClosed()
public java.lang.String getHostAddress() throws java.net.UnknownHostException
java.net.UnknownHostException
public java.lang.String getHostName() throws java.net.UnknownHostException
java.net.UnknownHostException
public abstract java.lang.String getAvailableStreamFeatures()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |