|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.androidpn.server.xmpp.session.Session
org.androidpn.server.xmpp.session.ClientSession
public class ClientSession
This class represents a session between the server and a client.
Field Summary |
---|
Fields inherited from class org.androidpn.server.xmpp.session.Session |
---|
STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED |
Constructor Summary | |
---|---|
ClientSession(java.lang.String serverName,
Connection connection,
java.lang.String streamID)
Constructor. |
Method Summary | |
---|---|
static ClientSession |
createSession(java.lang.String serverName,
Connection connection,
org.xmlpull.v1.XmlPullParser xpp)
Creates a new session between the server and a client, and returns it. |
AuthToken |
getAuthToken()
Returns the authentication token associated with this session. |
java.lang.String |
getAvailableStreamFeatures()
Returns a text with the available stream features. |
org.xmpp.packet.Presence |
getPresence()
Returns the presence of this session. |
java.lang.String |
getUsername()
Returns the username associated with this session. |
boolean |
isInitialized()
Indicates if the session has been initialized. |
void |
setAuthToken(AuthToken authToken,
java.lang.String resource)
Initialize the session with an authentication token and resource name. |
void |
setInitialized(boolean initialized)
Sets the initialization state of the session. |
void |
setPresence(org.xmpp.packet.Presence presence)
Sets the presence of this session. |
java.lang.String |
toString()
|
boolean |
wasAvailable()
Indicates if the session was available ever. |
Methods inherited from class org.androidpn.server.xmpp.session.Session |
---|
close, deliver, deliverRawText, getAddress, getConnection, getCreationDate, getHostAddress, getHostName, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getStatus, getStreamID, incrementClientPacketCount, incrementServerPacketCount, isClosed, process, setAddress, setStatus |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClientSession(java.lang.String serverName, Connection connection, java.lang.String streamID)
serverName
- the server nameconnection
- the connectionstreamID
- the stream IDMethod Detail |
---|
public static ClientSession createSession(java.lang.String serverName, Connection connection, org.xmlpull.v1.XmlPullParser xpp) throws org.xmlpull.v1.XmlPullParserException
serverName
- the server nameconnection
- the connectionxpp
- the XML parser to handle incoming data
org.xmlpull.v1.XmlPullParserException
- if an error occurs while parsing incoming datapublic java.lang.String getUsername() throws UserNotFoundException
UserNotFoundException
- if a user has not authenticated yetpublic AuthToken getAuthToken()
public void setAuthToken(AuthToken authToken, java.lang.String resource)
authToken
- the authentication tokenresource
- the resourcepublic boolean isInitialized()
public void setInitialized(boolean initialized)
initialized
- true if the session has been initializedpublic boolean wasAvailable()
public org.xmpp.packet.Presence getPresence()
public void setPresence(org.xmpp.packet.Presence presence)
presence
- the presencepublic java.lang.String getAvailableStreamFeatures()
getAvailableStreamFeatures
in class Session
public java.lang.String toString()
toString
in class Session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |