public interface Session extends RoutableChannelHandler
Obtain object managers from the session in order to access server resources.
Modifier and Type | Field and Description |
---|---|
static int |
MAJOR_VERSION
Version of the XMPP spec supported as MAJOR_VERSION.MINOR_VERSION (e.g.
|
static int |
MINOR_VERSION |
static int |
STATUS_AUTHENTICATED |
static int |
STATUS_CLOSED |
static int |
STATUS_CONNECTED |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this session including associated socket connection.
|
void |
deliverRawText(String text)
Delivers raw text to this connection.
|
org.xmpp.packet.JID |
getAddress()
Obtain the address of the user.
|
String |
getCipherSuiteName()
Returns the TLS cipher suite name, if any.
|
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.
|
int |
getStatus()
Obtain the current status of this session.
|
StreamID |
getStreamID()
Obtain the stream ID associated with this sesison.
|
boolean |
isClosed()
Returns true if the connection/session is closed.
|
boolean |
isSecure()
Returns true if this connection is secure.
|
void |
process(org.xmpp.packet.Packet packet)
Process an XMPP packet.
|
boolean |
validate()
Verifies that the connection is still live.
|
static final int MAJOR_VERSION
static final int MINOR_VERSION
static final int STATUS_CLOSED
static final int STATUS_CONNECTED
static final int STATUS_AUTHENTICATED
org.xmpp.packet.JID getAddress()
getAddress
in interface RoutableChannelHandler
int getStatus()
StreamID getStreamID()
String getServerName()
Date getCreationDate()
Date getLastActiveDate()
long getNumClientPackets()
long getNumServerPackets()
void close()
boolean isClosed()
boolean isSecure()
String getHostAddress() throws UnknownHostException
UnknownHostException
- if IP address of host could not be determined.String getHostName() throws UnknownHostException
If 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.
UnknownHostException
- if IP address of host could not be determined.InetAddress.getCanonicalHostName()
,
SecurityManager.checkConnect(java.lang.String, int)
void process(org.xmpp.packet.Packet packet)
ChannelHandler
process
in interface ChannelHandler
packet
- a packet to process.void deliverRawText(String text)
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.
text
- the XML stanzas represented kept in a String.boolean validate()
String getCipherSuiteName()
Copyright © 2003-2008 Jive Software.