示例#1
0
  @Override
  public void push(Session session, String callback, Map<String, Object> m) {
    Set<Binding> bindings = pushBindingsMap.get(callback);
    if (bindings == null) return;
    for (Binding binding : bindings) {
      if (binding.sessionId.equals(session.getGuid())) {
        String orgDomain = session.getOrgDomain();

        Message msg = createMessage(orgDomain, binding, callback, m);
        if (logger.isTraceEnabled()) tracePush(orgDomain, callback, m, binding.sessionId, binding);
        msgbus.send(msg);
      }
    }
  }
示例#2
0
  @Override
  public void push(String orgDomain, String callback, Map<String, Object> m) {
    Set<String> sessions = orgSessionMap.get(orgDomain);
    if (sessions == null) return;

    Set<Binding> bindings = pushBindingsMap.get(callback);
    if (bindings == null) return;

    for (Binding binding : bindings) {
      if (sessions.contains(binding.sessionId)) {
        Message msg = createMessage(orgDomain, binding, callback, m);
        if (logger.isTraceEnabled()) tracePush(orgDomain, callback, m, binding.sessionId, binding);
        msgbus.send(msg);
      }
    }
  }