|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.wildfire.session.Session
public abstract class Session
The session represents a connection between the server and a client (c2s) or another server (s2s) as well as a connection with a component. Authentication and user accounts are associated with c2s connections while s2s has an optional authentication association but no single user user.
Obtain object managers from the session in order to access server resources.
Field Summary | |
---|---|
protected AuthToken |
authToken
The authentication token for this session. |
protected static String |
CHARSET
The utf-8 charset for decoding and encoding Jabber packet streams. |
protected Connection |
conn
The connection that this session represents. |
static int |
MAJOR_VERSION
Version of the XMPP spec supported as MAJOR_VERSION.MINOR_VERSION (e.g. |
static int |
MINOR_VERSION
|
protected SessionManager |
sessionManager
|
protected int |
status
The current session status. |
static int |
STATUS_AUTHENTICATED
|
static int |
STATUS_CLOSED
|
static int |
STATUS_CONNECTED
|
static int |
STATUS_STREAMING
|
Constructor Summary | |
---|---|
Session(String serverName,
Connection connection,
StreamID streamID)
Creates a session with an underlying connection and permission protection. |
Method Summary | |
---|---|
protected static int[] |
decodeVersion(String version)
|
JID |
getAddress()
Obtain the address of the user. |
abstract String |
getAvailableStreamFeatures()
Returns a text with the available stream features. |
Connection |
getConnection()
Returns the connection associated with this Session. |
Date |
getCreationDate()
Obtain the date the session was created. |
Date |
getLastActiveDate()
Obtain the time the session last had activity. |
long |
getNumClientPackets()
Obtain the number of packets sent from the client to the server. |
long |
getNumServerPackets()
Obtain the number of packets sent from the server to the client. |
String |
getServerName()
Obtain the name of the server this session belongs to. |
Object |
getSessionData(String key)
Retrieves session data. |
int |
getStatus()
Obtain the current status of this session. |
StreamID |
getStreamID()
Obtain 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. |
void |
process(Packet packet)
Process an XMPP packet. |
void |
removeSessionData(String key)
Removes session data. |
void |
setAddress(JID address)
Sets the new address of this session. |
void |
setSessionData(String key,
Object value)
Saves given session data. |
void |
setStatus(int status)
Set the new status of this session. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAJOR_VERSION
public static final int MINOR_VERSION
protected static String CHARSET
public static final int STATUS_CLOSED
public static final int STATUS_CONNECTED
public static final int STATUS_STREAMING
public static final int STATUS_AUTHENTICATED
protected int status
protected Connection conn
protected AuthToken authToken
protected SessionManager sessionManager
Constructor Detail |
---|
public Session(String serverName, Connection connection, StreamID streamID)
connection
- The connection we are proxyingMethod Detail |
---|
public JID getAddress()
getAddress
in interface RoutableChannelHandler
public void setAddress(JID address)
public Connection getConnection()
public int getStatus()
public void setStatus(int status)
status
- The new status code for this sessionpublic StreamID getStreamID()
public String getServerName()
public Date getCreationDate()
public Date getLastActiveDate()
public void incrementClientPacketCount()
public void incrementServerPacketCount()
public long getNumClientPackets()
public long getNumServerPackets()
public void setSessionData(String key, Object value)
key
- a String
value of stored data key ID.value
- a Object
value of data stored in session.getSessionData(String)
public Object getSessionData(String key)
setSessionData(String, Object)
description for more details.
key
- a String
value of stored data ID.
Object
value of data for given key.setSessionData(String, Object)
public void removeSessionData(String key)
setSessionData(String, Object)
description
for more details.
key
- a String
value of stored data ID.setSessionData(String, Object)
public void process(Packet packet)
ChannelHandler
process
in interface ChannelHandler
packet
- a packet to process.public abstract String getAvailableStreamFeatures()
public String toString()
toString
in class Object
protected static int[] decodeVersion(String version)
|
Wildfire 3.2.4 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |