Exemplo n.º 1
0
 public void onUnsubscribe(String sessionId, WampUnsubscribeMessage wampUnsubscribeMessage) {
   EventAction e = eventMapping.getAction(wampUnsubscribeMessage.getTopicId());
   if (e != null) e.unsubscribe(sessionId);
   else if (log.isDebugEnabled())
     log.debug(
         "unable to unsubscribe : action name doesn't not exist "
             + wampUnsubscribeMessage.getTopicId());
 }
Exemplo n.º 2
0
  // TODO new publish
  public void onPublish(String sessionId, WampPublishMessage wampPublishMessage)
      throws SerializationException {
    EventAction e = eventMapping.getAction(wampPublishMessage.getTopicId());
    if (e != null) {
      OutputWampEventMessage msg = new OutputWampEventMessage();
      msg.setTopicId(wampPublishMessage.getTopicId());
      msg.setEvent(wampPublishMessage.getEvent());

      // e.publishTo think about it
      List<String> publishList =
          e.publishTo(getPublishList(e, sessionId, wampPublishMessage), wampPublishMessage, msg);
      if (publishList != null) for (String s : publishList) sendEvent(s, msg);

    } else if (log.isDebugEnabled())
      log.debug(
          "unable to publish : action name doesn't not exist " + wampPublishMessage.getTopicId());
  }