Class ContinuationService
- java.lang.Object
-
- org.exoplatform.ws.frameworks.cometd.ContinuationService
-
public class ContinuationService extends Object
Created by The eXo Platform SAS.- Version:
- $Id: $
- Author:
- Vitaly Parfonov
-
-
Constructor Summary
Constructors Constructor Description ContinuationService(EXoContinuationBayeux bayeux)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.cometd.bayeux.server.ServerSessiongetClient(String id)org.cometd.bayeux.server.ServerSessiongetClientByExoId(String exoId)Collection<org.cometd.bayeux.server.ServerSession>getClients()longgetTimeout()StringgetUserToken(String eXoId)booleanhasChannel(String channel)booleanisPresent(String eXoID)booleanisSubscribe(String eXoId, String channel)Deprecated.voidsendBroadcastMessage(String channel, Object data)Send message to all client that listen channel.voidsendBroadcastMessage(String channel, Object data, String msgId)Send message to all client that listen channel.voidsendMessage(String eXoId, String channel, Object data)Send individual message to client.voidsendMessage(String eXoId, String channel, Object data, String id)Send individual message to client.
-
-
-
Constructor Detail
-
ContinuationService
public ContinuationService(EXoContinuationBayeux bayeux)
- Parameters:
bayeux-
-
-
Method Detail
-
sendMessage
public void sendMessage(String eXoId, String channel, Object data)
Send individual message to client.- Parameters:
eXoId- the user IDchannel- the channel you want to send the message. The client must listen to this channel to receive itdata- 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 IDchannel- the channel you want to send the message. The client must listen to this channel to receive itdata- the data you want to send to the clientid- 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.UseisPresent(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 messagedata- 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 messagedata- that sendmsgId- id of message
-
-