com.nexaweb.server.pushconnection
Interface PushConnectionManager

All Superinterfaces:
Service

public interface PushConnectionManager
extends Service

The PushConnectionManager provides access to PushConnection objects and related functionality. There is only one PushConnectionManager available in a Nexaweb enabled application. It may be obtained from the static ServiceManager.getPushConnectionManager() method.


Method Summary
 void addPushConnectionListener(PushConnectionListener listener)
          Adds the specified listener to the list of listeners that will be notified when PushConnections are established or closed.
 void establishPushConnection(ServerSession session)
          Request that a PushConnection be established for the specified Session.
 void establishPushConnection(java.lang.String sessionId)
          Request that a PushConnection be established for the specified Session.
 PushConnection findById(java.lang.String sessionId)
          Returns the PushConnection associated with the specified session id.
 PushConnection findBySession(ServerSession session)
          Returns the PushConnection associated with the specified ServerSession.
 int getPushConnectionCount()
          Returns the number of PushConnection objects under management.
 boolean removePushConnectionListener(PushConnectionListener listener)
          Removes the specified listener to the list of listeners that will be notified when PushConnections are established or closed.
 
Methods inherited from interface com.nexaweb.server.services.Service
getDescription, getLog, getName, getPerformanceMeter, getStatus, getStatusReport, start, stop
 

Method Detail

findBySession

public PushConnection findBySession(ServerSession session)
                             throws InvalidSessionException
Returns the PushConnection associated with the specified ServerSession. If there is no PushConnection open for the specified ServerSession, this method returns null.

Parameters:
session - The ServerSession for which a PushConnection is desired.
Returns:
The PushConnection to the ServerSession's client or null if the client does not currently have a push connection.
Throws:
InvalidSessionException - Thrown if the specified ServerSession is no longer valid.

findById

public PushConnection findById(java.lang.String sessionId)
                        throws InvalidSessionException
Returns the PushConnection associated with the specified session id. If there is no PushConnection open for the ServerSession associated with the specified id, this method returns null.

Parameters:
sessionId - The id of a ServerSession for which a PushConnection is desired.
Returns:
The PushConnection to the ServerSession's client or null if the client does not currently have a push connection.
Throws:
InvalidSessionException - Thrown if the specified id does not correspond to a valid ServerSession.

establishPushConnection

public void establishPushConnection(ServerSession session)
                             throws InvalidSessionException
Request that a PushConnection be established for the specified Session. The PushConnection will be established when the client next connects to the server.

Parameters:
session - The Server for which a PushConnection is desired.
Throws:
InvalidSessionException - Thrown if the specified ServerSession is no longer valid.

establishPushConnection

public void establishPushConnection(java.lang.String sessionId)
                             throws InvalidSessionException
Request that a PushConnection be established for the specified Session. The PushConnection will be established when the client next connects to the server.

Parameters:
sessionId - The id of a ServerSession for which a PushConnection is desired.
Throws:
InvalidSessionException - Thrown if the specified id does not correspond to a valid ServerSession.

getPushConnectionCount

public int getPushConnectionCount()
Returns the number of PushConnection objects under management.

Returns:
The number of PushConnection objects under management.

addPushConnectionListener

public void addPushConnectionListener(PushConnectionListener listener)
Adds the specified listener to the list of listeners that will be notified when PushConnections are established or closed.

Parameters:
listener - The listener to be notified.

removePushConnectionListener

public boolean removePushConnectionListener(PushConnectionListener listener)
Removes the specified listener to the list of listeners that will be notified when PushConnections are established or closed.

Parameters:
listener - The listener that should no longer be notified.
Returns:
True if the listener was removed, false otherwise. Note that this return value was added in release 4.2.
Since:
4.0 - Method had void as return type., 4.2 - boolean type returned.


Copyright © 2005 Nexaweb Technologies, Inc. All Rights Reserved.