Connection Manager 3.4.2 Javadoc

org.jivesoftware.multiplexer
Class ServerSurrogate

java.lang.Object
  extended by org.jivesoftware.multiplexer.ServerSurrogate

public class ServerSurrogate
extends java.lang.Object

Surrogate of the main server where the Connection Manager is routing client packets. This class is responsible for keeping a pool of working threads to processing incoming clients traffic and forward it to the main server. Each working thread uses its own connection to the server. By default 5 threads/connections are established to the server. Use the system property xmpp.manager.connections to modify the default value.

ServerSurrogate is also responsible for caching the server configuration such as if non-sasl authentication or in-band registration are available.

Each connection to the server has its own ServerPacketReader to read incoming traffic from the server. Incoming server traffic is then handled by ServerPacketHandler.

Author:
Gaston Dombiak

Method Summary
 void clientSessionClosed(java.lang.String streamID)
          Notification message indication that a client session has been closed.
 void clientSessionCreated(java.lang.String streamID)
          Notification message indication that a new client session has been created.
 void deliveryFailed(org.dom4j.Element stanza, java.lang.String streamID)
          Notification message indicating that delivery of a stanza to a client has failed.
 Connection.CompressionPolicy getCompressionPolicy()
          Returns whether compression is optional or is disabled.
 java.lang.String getSASLMechanisms(Session session)
          Returns the SASL mechanisms supported by the server for client authentication.
 org.dom4j.Element getSASLMechanismsElement(Session session)
           
 Connection.TLSPolicy getTlsPolicy()
          Returns whether TLS is mandatory, optional or is disabled.
 boolean isInbandRegEnabled()
          Returns true if in-band registration is supported by the server.
 boolean isNonSASLAuthEnabled()
          Returns true if non-sasl authentication is supported by the server.
 void send(java.lang.String stanza, java.lang.String streamID)
          Forwards the specified stanza to the server.
 void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)
          Sets whether compression is enabled or is disabled.
 void setInbandRegEnabled(boolean inbandRegEnabled)
          Sets if in-band registration is supported by the server.
 void setNonSASLAuthEnabled(boolean nonSASLEnabled)
          Sets if non-sasl authentication is supported by the server.
 void setSASLMechanisms(org.dom4j.Element mechanisms)
          Returns the SASL mechanisms supported by the server for client authentication.
 void setTlsPolicy(Connection.TLSPolicy tlsPolicy)
          Sets whether TLS is mandatory, optional or is disabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

clientSessionCreated

public void clientSessionCreated(java.lang.String streamID)
Notification message indication that a new client session has been created. Send a notification to the main server.

Parameters:
streamID - the stream ID assigned by the connection manager to the new session.

clientSessionClosed

public void clientSessionClosed(java.lang.String streamID)
Notification message indication that a client session has been closed. Send a notification to the main server.

Parameters:
streamID - the stream ID assigned by the connection manager to the session.

deliveryFailed

public void deliveryFailed(org.dom4j.Element stanza,
                           java.lang.String streamID)
Notification message indicating that delivery of a stanza to a client has failed.

Parameters:
stanza - the stanza that was not sent to the client.
streamID - the stream ID assigned by the connection manager to the no longer available session.

send

public void send(java.lang.String stanza,
                 java.lang.String streamID)
Forwards the specified stanza to the server. The client that is sending the stanza is specified by the streamID parameter.

Parameters:
stanza - the stanza to send to the server.
streamID - the stream ID assigned by the connection manager to the session.

getSASLMechanisms

public java.lang.String getSASLMechanisms(Session session)
Returns the SASL mechanisms supported by the server for client authentication.

Parameters:
session - the session connecting to the connection manager.
Returns:
the SASL mechanisms supported by the server for client authentication.

getSASLMechanismsElement

public org.dom4j.Element getSASLMechanismsElement(Session session)

setSASLMechanisms

public void setSASLMechanisms(org.dom4j.Element mechanisms)
Returns the SASL mechanisms supported by the server for client authentication.

Parameters:
mechanisms - the SASL mechanisms supported by the server for client authentication.

getTlsPolicy

public Connection.TLSPolicy getTlsPolicy()
Returns whether TLS is mandatory, optional or is disabled. When TLS is mandatory clients are required to secure their connections or otherwise their connections will be closed. On the other hand, when TLS is disabled clients are not allowed to secure their connections using TLS. Their connections will be closed if they try to secure the connection. in this last case.

Returns:
whether TLS is mandatory, optional or is disabled.

setTlsPolicy

public void setTlsPolicy(Connection.TLSPolicy tlsPolicy)
Sets whether TLS is mandatory, optional or is disabled. When TLS is mandatory clients are required to secure their connections or otherwise their connections will be closed. On the other hand, when TLS is disabled clients are not allowed to secure their connections using TLS. Their connections will be closed if they try to secure the connection. in this last case.

Parameters:
tlsPolicy - whether TLS is mandatory, optional or is disabled.

getCompressionPolicy

public Connection.CompressionPolicy getCompressionPolicy()
Returns whether compression is optional or is disabled.

Returns:
whether compression is optional or is disabled.

setCompressionPolicy

public void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)
Sets whether compression is enabled or is disabled.

Note: Connection managers share the same code from Openfire so the same compression algorithms will be offered. // TODO When used with other server we need to store the available algorithms.

Parameters:
compressionPolicy - whether Compression is enabled or is disabled.

isNonSASLAuthEnabled

public boolean isNonSASLAuthEnabled()
Returns true if non-sasl authentication is supported by the server.

Returns:
true if non-sasl authentication is supported by the server.

setNonSASLAuthEnabled

public void setNonSASLAuthEnabled(boolean nonSASLEnabled)
Sets if non-sasl authentication is supported by the server.

Parameters:
nonSASLEnabled - if non-sasl authentication is supported by the server.

isInbandRegEnabled

public boolean isInbandRegEnabled()
Returns true if in-band registration is supported by the server.

Returns:
true if in-band registration is supported by the server.

setInbandRegEnabled

public void setInbandRegEnabled(boolean inbandRegEnabled)
Sets if in-band registration is supported by the server.

Parameters:
inbandRegEnabled - if in-band registration is supported by the server.

Connection Manager 3.4.2 Javadoc

Copyright © 2003-2006 Jive Software.