org.coweb
Interface SessionHandlerDelegate


public interface SessionHandlerDelegate


Method Summary
 void init(SessionHandler sessionHandler, boolean cacheState, UpdaterTypeMatcher updaterTypeMatcher)
          Called when a session is first being initialized.
 void onClientJoin(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a client joins a prepared session.
 boolean onClientRemove(org.cometd.bayeux.server.ServerSession client)
          Called when a client leaves a session.
 boolean onEndSession()
          Called when a session is ending.
 boolean onServiceRequest(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a user attempts to send a request to a service in a session.
 void onSubscribeService(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a user attempts to join a coweb session.
 boolean onSync(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a client sends a sync message.
 void onUnsubscribeService(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a user attempts to unsubscribe from a service in a session.
 void onUpdaterSendState(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called when a client sends it's state to the server after a send state request.
 void onUpdaterSubscribe(org.cometd.bayeux.server.ServerSession client, org.cometd.bayeux.Message message)
          Called after a client has been updated and is ready to be an updater.
 

Method Detail

init

void init(SessionHandler sessionHandler,
          boolean cacheState,
          UpdaterTypeMatcher updaterTypeMatcher)
Called when a session is first being initialized.

Parameters:
sessionHandler - The org.coweb.SessionHandler object which invokes this delegate.
cacheState - boolean indicating if state should be cached.

onServiceRequest

boolean onServiceRequest(org.cometd.bayeux.server.ServerSession client,
                         org.cometd.bayeux.Message message)
Called when a user attempts to send a request to a service in a session.

Returns:
true if the user can send the request or false if not.

onSync

boolean onSync(org.cometd.bayeux.server.ServerSession client,
               org.cometd.bayeux.Message message)
Called when a client sends a sync message. Implementations should forward sync events to the bots.

Parameters:
client - Client who sent the sync.
message - Message containg sync event.
Returns:
true if this sync event should forwarded to the bots

onClientJoin

void onClientJoin(org.cometd.bayeux.server.ServerSession client,
                  org.cometd.bayeux.Message message)
Called when a client joins a prepared session.


onSubscribeService

void onSubscribeService(org.cometd.bayeux.server.ServerSession client,
                        org.cometd.bayeux.Message message)
Called when a user attempts to join a coweb session.


onUnsubscribeService

void onUnsubscribeService(org.cometd.bayeux.server.ServerSession client,
                          org.cometd.bayeux.Message message)
Called when a user attempts to unsubscribe from a service in a session.


onUpdaterSendState

void onUpdaterSendState(org.cometd.bayeux.server.ServerSession client,
                        org.cometd.bayeux.Message message)
Called when a client sends it's state to the server after a send state request.

Parameters:
client - The client sending the state
message - Message containing the state in the data field.

onUpdaterSubscribe

void onUpdaterSubscribe(org.cometd.bayeux.server.ServerSession client,
                        org.cometd.bayeux.Message message)
Called after a client has been updated and is ready to be an updater.

Parameters:
client - The client who is ready to be an updater.
message - Message associated with the subscribe.

onClientRemove

boolean onClientRemove(org.cometd.bayeux.server.ServerSession client)
Called when a client leaves a session.

Returns:
true if client was successfully removed.

onEndSession

boolean onEndSession()
Called when a session is ending.

Returns:
true if session ended properly.


Copyright © 2011-2012 The Dojo Foundation. All Rights Reserved.