Class ContinuationService

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

public class ContinuationService extends Object
  • Constructor Details

  • Method Details

    • sendMessage

      public void sendMessage(String eXoId, String channel, 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(String eXoId, String channel, Object data, 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 org.cometd.bayeux.server.ServerSession getClientByExoId(String exoId)
      Parameters:
      exoId - the id of client (exoId).
      Returns:
      Get client by eXoId.
    • getClient

      public org.cometd.bayeux.server.ServerSession getClient(String id)
      Parameters:
      id - the id of client (cometd id)
      Returns:
      Get client by id (id generated by cometd service).
    • getClients

      public Collection<org.cometd.bayeux.server.ServerSession> getClients()
      Returns:
      all registered client.
    • hasChannel

      public boolean hasChannel(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

      @Deprecated public boolean isSubscribe(String eXoId, String channel)
      Deprecated.
      Use isPresent(String) instead. One user can have multiple session, it doesn't make sense to check if he has subscribed for one channel. This method can only check for channel subscribing status in non-clustering environment.
      Parameters:
      eXoId - the client id (as eXoId).
      channel - the id of channel.
      Returns:
      true if client subscribe to channel else false.
    • isPresent

      public boolean isPresent(String eXoID)
    • sendBroadcastMessage

      public void sendBroadcastMessage(String channel, 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(String channel, Object data, 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 String getUserToken(String eXoId)
      Parameters:
      eXoId - the client id (as eXoId).
      Returns:
      Return userToken for the client.