|
Openfire 3.8.1 Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.openfire.session.LocalSession
public abstract class LocalSession
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 static String |
CHARSET
The utf-8 charset for decoding and encoding Jabber packet streams. |
protected Connection |
conn
The connection that this session represents. |
protected SessionManager |
sessionManager
|
protected int |
status
The current session status. |
| Fields inherited from interface org.jivesoftware.openfire.session.Session |
|---|
MAJOR_VERSION, MINOR_VERSION, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED |
| Constructor Summary | |
|---|---|
LocalSession(String serverName,
Connection connection,
StreamID streamID)
Creates a session with an underlying connection and permission protection. |
|
| Method Summary | |
|---|---|
void |
close()
Close this session including associated socket connection. |
protected static int[] |
decodeVersion(String version)
|
void |
deliverRawText(String text)
Delivers raw text to this connection. |
org.xmpp.packet.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. |
String |
getHostAddress()
Returns the IP address string in textual presentation. |
String |
getHostName()
Gets the host name for this IP address. |
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. |
boolean |
isClosed()
Returns true if the connection/session is closed. |
boolean |
isSecure()
Returns true if this connection is secure. |
boolean |
isUsingSelfSignedCertificate()
Returns true if the other peer of this session presented a self-signed certificate. |
void |
process(org.xmpp.packet.Packet packet)
Process an XMPP packet. |
void |
removeSessionData(String key)
Removes session data. |
void |
setAddress(org.xmpp.packet.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()
|
boolean |
validate()
Verifies that the connection is still live. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static String CHARSET
protected int status
protected Connection conn
protected SessionManager sessionManager
| Constructor Detail |
|---|
public LocalSession(String serverName,
Connection connection,
StreamID streamID)
serverName - domain of the XMPP server where the new session belongs.connection - The connection we are proxying.streamID - unique identifier for this session.| Method Detail |
|---|
public org.xmpp.packet.JID getAddress()
getAddress in interface RoutableChannelHandlergetAddress in interface Sessionpublic void setAddress(org.xmpp.packet.JID address)
address - the new address of this session.public Connection getConnection()
public int getStatus()
getStatus in interface Sessionpublic void setStatus(int status)
status - The new status code for this sessionpublic StreamID getStreamID()
getStreamID in interface Sessionpublic String getServerName()
getServerName in interface Sessionpublic Date getCreationDate()
getCreationDate in interface Sessionpublic Date getLastActiveDate()
getLastActiveDate in interface Sessionpublic void incrementClientPacketCount()
public void incrementServerPacketCount()
public long getNumClientPackets()
getNumClientPackets in interface Sessionpublic long getNumServerPackets()
getNumServerPackets in interface Session
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(org.xmpp.packet.Packet packet)
ChannelHandler
process in interface ChannelHandlerprocess in interface Sessionpacket - a packet to process.public void deliverRawText(String text)
SessionSession.process(Packet).This method avoids having to get the writer of this connection and mess directly with the writer. Therefore, this method ensures a correct delivery of the stanza even if other threads were sending data concurrently.
deliverRawText in interface Sessiontext - the XML stanzas represented kept in a String.public abstract String getAvailableStreamFeatures()
public void close()
Session
close in interface Sessionpublic boolean validate()
Session
validate in interface Sessionpublic boolean isSecure()
Session
isSecure in interface Sessionpublic boolean isClosed()
Session
isClosed in interface Session
public String getHostAddress()
throws UnknownHostException
Session
getHostAddress in interface SessionUnknownHostException - if IP address of host could not be determined.
public String getHostName()
throws UnknownHostException
SessionIf this InetAddress was created with a host name,
this host name will be remembered and returned;
otherwise, a reverse name lookup will be performed
and the result will be returned based on the system
configured name lookup service. If a lookup of the name service
is required, call
getCanonicalHostName.
If there is a security manager, its
checkConnect method is first called
with the hostname and -1
as its arguments to see if the operation is allowed.
If the operation is not allowed, it will return
the textual representation of the IP address.
getHostName in interface SessionUnknownHostException - if IP address of host could not be determined.InetAddress.getCanonicalHostName(),
SecurityManager.checkConnect(java.lang.String, int)public String toString()
toString in class Objectprotected static int[] decodeVersion(String version)
public boolean isUsingSelfSignedCertificate()
|
Openfire 3.8.1 Javadoc | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||