- java.lang.Object
- 
- org.omnifaces.cdi.push.SocketSessionManager
 
- 
 @ApplicationScoped public class SocketSessionManager extends Object This web socket session manager holds all web socket sessions by their channel identifier. - Since:
- 2.3
- Author:
- Bauke Scholtz
- See Also:
- SocketEndpoint
 
- 
- 
Constructor SummaryConstructors Constructor Description SocketSessionManager()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanadd(Session session)On open, add given web socket session to the mapping associated with its channel identifier and returnstrueif it's accepted (i.e.protected voidderegister(Iterable<String> channelIds)Deregister given channel identifiers and explicitly close all open web socket sessions associated with it.protected voidregister(Iterable<String> channelIds)Register given channel identifiers.protected voidregister(String channelId)Register given channel identifier.protected voidremove(Session session, CloseReason reason)On close, remove given web socket session from the mapping.protected Set<Future<Void>>send(String channelId, String message)Send the given message to all open web socket sessions associated with given web socket channel identifier.
 
- 
- 
- 
Method Detail- 
registerprotected void register(String channelId) Register given channel identifier.- Parameters:
- channelId- The channel identifier to register.
 
 - 
registerprotected void register(Iterable<String> channelIds) Register given channel identifiers.- Parameters:
- channelIds- The channel identifiers to register.
 
 - 
addprotected boolean add(Session session) On open, add given web socket session to the mapping associated with its channel identifier and returnstrueif it's accepted (i.e. the channel identifier is known) and the same session hasn't been added before, otherwisefalse.- Parameters:
- session- The opened web socket session.
- Returns:
- trueif given web socket session is accepted and is new, otherwise- false.
 
 - 
sendprotected Set<Future<Void>> send(String channelId, String message) Send the given message to all open web socket sessions associated with given web socket channel identifier.- Parameters:
- channelId- The web socket channel identifier.
- message- The push message string.
- Returns:
- The results of the send operation. If it returns an empty set, then there was no open session associated
 with given channel identifier. The returned futures will return nullonFuture.get()if the message was successfully delivered and otherwise throwExecutionException.
 
 - 
removeprotected void remove(Session session, CloseReason reason) On close, remove given web socket session from the mapping.- Parameters:
- session- The closed web socket session.
- reason- The close reason.
 
 
- 
 
-