protected Set<Future<Void>> send(String channelId,Object message){
  Collection<Session> sessions=(channelId != null) ? socketSessions.get(channelId) : null;
  if (sessions != null && !sessions.isEmpty()) {
    Set<Future<Void>> results=new HashSet<>(sessions.size());
    String json=Json.encode(message);
    for (    Session session : sessions) {
      if (session.isOpen()) {
        send(session,json,results);
      }
    }
    return results;
  }
  return emptySet();
}

protected Set < Future < Void > > send ( String channelId , Object message ) { Collection < Session > sessions = ( channelId != null ) ? socketSessions . get ( channelId ) : null ; if ( sessions != null && ! sessions . isEmpty ( ) ) { Set < Future < Void > > results = new HashSet < > ( sessions . size ( ) ) ; String json = Json . encode ( message ) ; for ( Session session : sessions ) { if ( session . isOpen ( ) ) { send ( session , json , results ) ; } } return results ; } return emptySet ( ) ; }
encode the given message object as json and send it to all open web socket sessions associated with given web socket channel identifier .
