org.exoplatform.ws.frameworks.cometd
Class ContinuationService

java.lang.Object
  extended by org.exoplatform.ws.frameworks.cometd.ContinuationService

public class ContinuationService
extends java.lang.Object

Created by The eXo Platform SAS.

Version:
$Id: $
Author:
Vitaly Parfonov

Constructor Summary
ContinuationService(EXoContinuationBayeux bayeux)
           
 
Method Summary
 EXoContinuationClient getClient(java.lang.String id)
           
 EXoContinuationClient getClientByExoId(java.lang.String exoId)
           
 java.util.Collection<dojox.cometd.Client> getClients()
           
 long getTimeout()
           
 java.lang.String getUserToken(java.lang.String eXoId)
           
 boolean hasChannel(java.lang.String channel)
           
 boolean isSubscribe(java.lang.String eXoId, java.lang.String channel)
           
 void sendBroadcastMessage(java.lang.String channel, java.lang.Object data)
          Send message to all client that listen channel.
 void sendBroadcastMessage(java.lang.String channel, java.lang.Object data, java.lang.String msgId)
          Send message to all client that listen channel.
 void sendMessage(java.lang.String eXoId, java.lang.String channel, java.lang.Object data)
          Send individual message to client.
 void sendMessage(java.lang.String eXoId, java.lang.String channel, java.lang.Object data, java.lang.String id)
          Send individual message to client.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContinuationService

public ContinuationService(EXoContinuationBayeux bayeux)
Parameters:
bayeux -
Method Detail

sendMessage

public void sendMessage(java.lang.String eXoId,
                        java.lang.String channel,
                        java.lang.Object data)
Send individual message to client.

Parameters:
eXoId - the user ID
channel - the channel you want to send the message. The client must listen to this channel to receive it
data - the data you want to send to the client

sendMessage

public void sendMessage(java.lang.String eXoId,
                        java.lang.String channel,
                        java.lang.Object data,
                        java.lang.String id)
Send individual message to client.

Parameters:
eXoId - the user ID
channel - the channel you want to send the message. The client must listen to this channel to receive it
data - the data you want to send to the client
id - the id of message if you set null will be generate automatically

getClientByExoId

public EXoContinuationClient getClientByExoId(java.lang.String exoId)
Parameters:
exoId - the id of client (exoId).
Returns:
Get client by eXoId.

getClient

public EXoContinuationClient getClient(java.lang.String id)
Parameters:
id - the id of client (cometd id)
Returns:
Get client by id (id generated by cometd service).

getClients

public java.util.Collection<dojox.cometd.Client> getClients()
Returns:
all registered client.

hasChannel

public boolean hasChannel(java.lang.String channel)
Parameters:
channel - the channel id.
Returns:
Return true if channel exist else false.

getTimeout

public long getTimeout()
Returns:
timeout of client reconnect.

isSubscribe

public boolean isSubscribe(java.lang.String eXoId,
                           java.lang.String channel)
Parameters:
eXoId - the client id (as eXoId).
channel - the id of channel.
Returns:
true if client subscribe to channel else false.

sendBroadcastMessage

public void sendBroadcastMessage(java.lang.String channel,
                                 java.lang.Object data)
Send message to all client that listen channel.

Parameters:
channel - the id of channel that need send message
data - that send

sendBroadcastMessage

public void sendBroadcastMessage(java.lang.String channel,
                                 java.lang.Object data,
                                 java.lang.String msgId)
Send message to all client that listen channel.

Parameters:
channel - the id of channel that need send message
data - that send
msgId - id of message

getUserToken

public java.lang.String getUserToken(java.lang.String eXoId)
Parameters:
eXoId - the client id (as eXoId).
Returns:
Return userToken for the client.


Copyright © 2011 eXo Platform SAS. All Rights Reserved.