Class ConnectionMultiplexerManager
java.lang.Object
org.jivesoftware.openfire.multiplex.ConnectionMultiplexerManager
- All Implemented Interfaces:
SessionEventListener
A ConnectionMultiplexerManager is responsible for keeping track of the connected
Connection Managers and the sessions that were established with the Connection
Managers. Moreover, a ConnectionMultiplexerManager is able to create, get and close
client sessions based on Connection requests.
- Author:
- Gaston Dombiak
-
Method Summary
Modifier and TypeMethodDescriptionvoidanonymousSessionCreated(Session session) Notification event indicating that an anonymous user has authenticated with the server.voidanonymousSessionDestroyed(Session session) An authenticated session of an anonymous user was destroyed.voidcloseClientSession(String connectionManagerDomain, StreamID streamID) Closes an existing client session that was established through a connection manager.booleancreateClientSession(String connectionManagerDomain, StreamID streamID, String hostName, String hostAddress) Creates a new client session that was established to the specified connection manager.getClientSession(String connectionManagerDomain, StreamID streamID) Returns the ClientSession with the specified stream ID that is being hosted by the specified connection manager.static StringReturns the default secret key that connection managers should present while trying to establish a new connection.static ConnectionMultiplexerManagerReturns the unique instance of this class.Returns the names of the connected connection managers to this server.getMultiplexerSession(String connectionManagerDomain) Returns aConnectionMultiplexerSessionfor the specified connection manager domain ornullif none was found.getMultiplexerSession(String connectionManagerDomain, StreamID streamID) Returns aConnectionMultiplexerSessionfor the specified connection manager domain ornullif none was found.intgetNumConnectedClients(String managerName) Returns the number of connected clients to a specific connection manager.voidmultiplexerAvailable(String connectionManagerName) A connection manager has become available.voidmultiplexerUnavailable(String connectionManagerName) A connection manager has gone unavailable.voidresourceBound(Session session) A session has finished resource binding.voidsessionCreated(Session session) Notification event indicating that a user has authenticated with the server.voidsessionDestroyed(Session session) An authenticated session of a non anonymous user was destroyed.static voidsetDefaultSecret(String defaultSecret) Sets the default secret key that connection managers should present while trying to establish a new connection.
-
Method Details
-
getInstance
Returns the unique instance of this class.- Returns:
- the unique instance of this class.
-
getDefaultSecret
Returns the default secret key that connection managers should present while trying to establish a new connection.- Returns:
- the default secret key that connection managers should present while trying to establish a new connection.
-
setDefaultSecret
Sets the default secret key that connection managers should present while trying to establish a new connection.- Parameters:
defaultSecret- the default secret key that connection managers should present while trying to establish a new connection.
-
createClientSession
public boolean createClientSession(String connectionManagerDomain, StreamID streamID, String hostName, String hostAddress) Creates a new client session that was established to the specified connection manager. The new session will not be findable through its stream ID.- Parameters:
connectionManagerDomain- the connection manager that is handling the connection of the session.streamID- the stream ID created by the connection manager for the new session.hostName- the address's hostname of the client or null if using old connection manager.hostAddress- the textual representation of the address of the client or null if using old CM.- Returns:
- true if a session was created or false if the client should disconnect.
-
closeClientSession
Closes an existing client session that was established through a connection manager.- Parameters:
connectionManagerDomain- the connection manager that is handling the connection of the session.streamID- the stream ID created by the connection manager for the session.
-
multiplexerAvailable
A connection manager has become available. Clients can now connect to the server through the connection manager.- Parameters:
connectionManagerName- the connection manager that has become available.
-
getClientSession
Returns the ClientSession with the specified stream ID that is being hosted by the specified connection manager.- Parameters:
connectionManagerDomain- the connection manager that is handling the connection of the session.streamID- the stream ID created by the connection manager for the session.- Returns:
- the ClientSession with the specified stream ID.
-
getMultiplexerSession
public ConnectionMultiplexerSession getMultiplexerSession(String connectionManagerDomain, StreamID streamID) Returns aConnectionMultiplexerSessionfor the specified connection manager domain ornullif none was found. If a StreamID is passed in, the same connection will always be used for that StreamID. Otherwise, if the connection manager has many connections established with the server then one of them will be selected randomly.- Parameters:
connectionManagerDomain- the domain of the connection manager to get a session.streamID- if provided, the same connection will always be used for a given streamID- Returns:
- a session to the specified connection manager domain or null if none was found.
-
getMultiplexerSession
Returns aConnectionMultiplexerSessionfor the specified connection manager domain ornullif none was found. In case the connection manager has many connections established with the server then one of them will be selected randomly.- Parameters:
connectionManagerDomain- the domain of the connection manager to get a session.- Returns:
- a session to the specified connection manager domain or null if none was found.
-
getMultiplexers
Returns the names of the connected connection managers to this server.- Returns:
- the names of the connected connection managers to this server.
-
getNumConnectedClients
Returns the number of connected clients to a specific connection manager.- Parameters:
managerName- the name of the connection manager.- Returns:
- the number of connected clients to a specific connection manager.
-
anonymousSessionCreated
Description copied from interface:SessionEventListenerNotification event indicating that an anonymous user has authenticated with the server.- Specified by:
anonymousSessionCreatedin interfaceSessionEventListener- Parameters:
session- the authenticated session of an anonymous user.
-
anonymousSessionDestroyed
Description copied from interface:SessionEventListenerAn authenticated session of an anonymous user was destroyed.- Specified by:
anonymousSessionDestroyedin interfaceSessionEventListener- Parameters:
session- the authenticated session of an anonymous user.
-
sessionCreated
Description copied from interface:SessionEventListenerNotification event indicating that a user has authenticated with the server. The authenticated user is not an anonymous user.- Specified by:
sessionCreatedin interfaceSessionEventListener- Parameters:
session- the authenticated session of a non anonymous user.
-
sessionDestroyed
Description copied from interface:SessionEventListenerAn authenticated session of a non anonymous user was destroyed.- Specified by:
sessionDestroyedin interfaceSessionEventListener- Parameters:
session- the authenticated session of a non anonymous user.
-
resourceBound
Description copied from interface:SessionEventListenerA session has finished resource binding.- Specified by:
resourceBoundin interfaceSessionEventListener- Parameters:
session- the session on which resource binding was performed.
-