Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.multiplex
Class ClientSessionConnection

java.lang.Object
  extended by org.jivesoftware.wildfire.net.VirtualConnection
      extended by org.jivesoftware.wildfire.multiplex.ClientSessionConnection
All Implemented Interfaces:
Connection

public class ClientSessionConnection
extends VirtualConnection

Represents a connection of a Client Session that was established to a Connection Manager. Connection Managers have their own physical connections to the server that are multiplexed among connected clients. Each created ClientSession will use an instance of this class as its connection.

Author:
Gaston Dombiak

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jivesoftware.wildfire.Connection
Connection.CompressionPolicy, Connection.TLSPolicy
 
Field Summary
 
Fields inherited from class org.jivesoftware.wildfire.net.VirtualConnection
session
 
Constructor Summary
ClientSessionConnection(String connectionManagerName)
           
 
Method Summary
 void closeVirtualConnection()
          If the Connection Manager or the Client requested to close the connection then just do nothing.
 void deliver(Packet packet)
          Delivers the packet to the Connection Manager that in turn will forward it to the target user.
 void deliverRawText(String text)
          Delivers the stanza to the Connection Manager that in turn will forward it to the target user.
 InetAddress getInetAddress()
          Returns the InetAddress describing the connection.
 void systemShutdown()
          Notification message indicating that the server is being shutdown.
 
Methods inherited from class org.jivesoftware.wildfire.net.VirtualConnection
close, getCompressionPolicy, getLanguage, getMajorXMPPVersion, getMinorXMPPVersion, getPacketDeliverer, getTlsPolicy, init, isClosed, isCompressed, isFlashClient, isSecure, registerCloseListener, removeCloseListener, setCompressionPolicy, setFlashClient, setLanaguage, setTlsPolicy, setXMPPVersion, startCompression, startTLS, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSessionConnection

public ClientSessionConnection(String connectionManagerName)
Method Detail

deliver

public void deliver(Packet packet)
Delivers the packet to the Connection Manager that in turn will forward it to the target user. Connection Managers may have one or many connections to the server so just get any connection to the Connection Manager (uses a random) and use it.

If the packet to send does not have a TO attribute then wrap the packet with a special IQ packet. The wrapper IQ packet will be sent to the Connection Manager and the stream ID of this Client Session will be used for identifying that the wrapped packet must be sent to the connected user. Since some packets can be exchanged before the user has a binded JID we need to use the stream ID as the unique identifier.

Parameters:
packet - the packet to send to the user.

deliverRawText

public void deliverRawText(String text)
Delivers the stanza to the Connection Manager that in turn will forward it to the target user. Connection Managers may have one or many connections to the server so just get any connection to the Connection Manager (uses a random) and use it.

The stanza to send wrapped with a special IQ packet. The wrapper IQ packet will be sent to the Connection Manager and the stream ID of this Client Session will be used for identifying that the wrapped stanza must be sent to the connected user.

Parameters:
text - the stanza to send to the user.

getInetAddress

public InetAddress getInetAddress()
                           throws UnknownHostException
Description copied from interface: Connection
Returns the InetAddress describing the connection.

Returns:
the InetAddress describing the underlying connection properties.
Throws:
UnknownHostException - if IP address of host could not be determined.

systemShutdown

public void systemShutdown()
Description copied from interface: Connection
Notification message indicating that the server is being shutdown. Implementors should send a stream error whose condition is system-shutdown before closing the connection.


closeVirtualConnection

public void closeVirtualConnection()
If the Connection Manager or the Client requested to close the connection then just do nothing. But if the server originated the request to close the connection then we need to send to the Connection Manager a packet letting him know that the Client Session needs to be terminated.

Specified by:
closeVirtualConnection in class VirtualConnection

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.