Examples of SessionInfo


Examples of org.xmlBlaster.authentication.SessionInfo

      SubscriptionInfo subscriptionInfo = e.getSubscriptionInfo();
      if (subscriptionInfo.getSubscribeCounter() > 1) {
         if (log.isLoggable(Level.FINE)) log.fine("Ignoring multisubscribe instance " + subscriptionInfo.getSubscribeCounter());
         return;
      }
      SessionInfo sessionInfo = subscriptionInfo.getSessionInfo();
      if (log.isLoggable(Level.FINE)) log.fine("Subscription add event " + e);
      KeyData keyData = subscriptionInfo.getKeyData();

      String uniqueKey = sessionInfo.getSessionName().getRelativeName();

      // Insert into first map:
      Object obj;
      Map subMap;
      synchronized(clientSubscriptionMap) {
         obj = clientSubscriptionMap.get(uniqueKey);
         if (obj == null) {
            subMap = Collections.synchronizedMap(new HashMap());
            clientSubscriptionMap.put(uniqueKey, subMap);
         }
         else {
            subMap = (Map)obj;
         }
         subMap.put(subscriptionInfo.getSubscriptionId(), subscriptionInfo);
         if (log.isLoggable(Level.FINE)) log.fine("Adding subscriptionId=" + subscriptionInfo.getSubscriptionId() + " to subMap of client " + sessionInfo.getId());
      }


      // Insert into second map:
      if (keyData.isQuery()) {
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

         if (log.isLoggable(Level.FINE)) log.fine("Ignoring multisubscribe instance " + subscriptionInfo.getSubscribeCounter());
         return;
      }

      String subscriptionInfoUniqueKey = subscriptionInfo.getSubscriptionId();
      SessionInfo sessionInfo = subscriptionInfo.getSessionInfo();

      if (log.isLoggable(Level.FINE)) log.fine("Subscription remove event " + e.toString());

      try {
         removeFromClientSubscriptionMap(sessionInfo, subscriptionInfoUniqueKey);
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

                    }
                  }
               }
               else {
                  log.fine("Register callback session state event = " + event);
                  SessionInfo sessionInfo = this.requestBroker.getAuthenticate().getSessionInfo(sessionName);
                  DispatchManager mgr = null;
                  if (sessionInfo != null)
                     mgr = sessionInfo.getDispatchManager();
                  if (mgr != null) {
                     mgr.addConnectionStatusListener(this);
                  }
                  else {
                     if (this.pendingCallbackSessionInfoSet == null) this.pendingCallbackSessionInfoSet = new TreeSet();
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

         SubjectInfo subjectInfo = clients[c];
         if (subjectInfo.getLoginName().startsWith("__")) continue;// Ignore internal sessions
         buf.append("\n  ").append("<client id='").appendEscaped(subjectInfo.getLoginName()).append("'>");
         SessionInfo[] sessions = subjectInfo.getSessions();
         for (int s=0; s<sessions.length; s++) {
            SessionInfo sessionInfo = sessions[s];
            buf.append("\n   ").append("<session id='").append(sessionInfo.getPublicSessionId()).append("'>");
            buf.append("\n    ").append("<state>").append(sessionInfo.getConnectionState()).append("</state>");
            ClientProperty[] props = sessionInfo.getRemotePropertyArr();
            for (int p=0; p<props.length; p++)
               buf.append(props[p].toXml("   ", "remoteProperty", true));
            I_Queue sessionQueue = sessionInfo.getSessionQueue();
            if (sessionQueue != null) {
               buf.append("\n    <queue relating='callback'");
               buf.append(" numOfEntries='").append(sessionQueue.getNumOfEntries()).append("'");
               buf.append(" numOfBytes='").append(sessionQueue.getNumOfBytes()).append("'");
               buf.append("/>");
               //buf.append(sessionQueue.toXml("\n    "));
            }
            buf.append(sessionInfo.getDispatchStatistic().toXml("   "));
            buf.append("\n   ").append("</session>");
         }
         buf.append("\n  ").append("</client>");
      }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

                     found = this.pendingCallbackSessionInfoSet.contains(currSessionName.getRelativeWildcard());
                  }
               }
               if (found) {
                  SessionName sessionName = new SessionName(this.engineGlob, name);
                  SessionInfo sessionInfo = this.requestBroker.getAuthenticate().getSessionInfo(sessionName);
                  DispatchManager mgr = null;
                  if (sessionInfo != null)
                     mgr = sessionInfo.getDispatchManager();
                  if (mgr != null) {
                     mgr.addConnectionStatusListener(this, true); // true: fire initial event
                     // done already:
                     //if (this.callbackSessionStateSet == null) this.callbackSessionStateSet = new TreeSet();
                     //this.callbackSessionStateSet.add(sessionName.getRelativeName());
                  }
                  else
                     System.err.println("EventPlugin.sessionAdded: Unexpected missing of " + name);
               }
            } catch (Throwable e) {
               e.printStackTrace();
            }
         }
      }

      if (this.clientSet == null) return;

      SessionInfo sessionInfo = clientEvent.getSessionInfo();
      SessionName sessionName = sessionInfo.getSessionName();

      try {
         ConnectQosData cd = sessionInfo.getConnectQos().getData();
         // A client can on connect send a event/connect=false clientProperty to suppress the event fired
         if (cd.getClientProperty(ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "connect", true) == false) {
            if (log.isLoggable(Level.FINE)) log.fine("Found " + ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "connect=true for "+sessionName.toString());
          return;
         }
      }
      catch (Throwable e) {
        e.printStackTrace();
        log.warning("Accessing connectQos failed: " + e.toString());
      }
     
      String relativeName = sessionName.getRelativeName();

      String event = ContextNode.SEP + ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "connect";
      String foundEvent = relativeName + event;  // "client/joe/session/1/event/connect"
      if (!this.clientSet.contains(foundEvent)) {
         // "client/joe/session/*/event/connect"
         foundEvent = sessionName.getRelativePubSessionIdWildcard() + event;
         if (!this.clientSet.contains(foundEvent)) {
            // "client/*/session/1/event/connect"
            foundEvent = sessionName.getRelativeSubjectIdWildcard() + event;
            if (!this.clientSet.contains(foundEvent)) {
               // "client/*/session/*/event/connect"
               foundEvent = sessionName.getRelativeWildcard() + event;
               if (!this.clientSet.contains(foundEvent)) {
                  return;
               }
            }
         }
      }

      try {
         //PublishKey(glob, Constants.EVENT_OID_LOGIN/*"__sys__Login"*/, "text/plain");
         // Key '__sys__UserList' for login/logout event
         // PublishKey(glob, Constants.EVENT_OID_USERLIST/*"__sys__UserList"*/, "text/plain");
         String summary = "Login of client " + sessionName.getAbsoluteName();
         String description = sessionInfo.toXml();
         String eventType = foundEvent;
         String errorCode = null;

         if (this.smtpDestinationHelper != null) {
            sendEmail(summary, description, eventType, null, sessionName, false);
         }

         if (this.publishDestinationHelper != null) {
            sendMessage(summary, description,
                  eventType, errorCode, sessionName, sessionInfo.getRemotePropertyArr());
         }

         if (this.jmxDestinationHelper != null) {
            sendJmxNotification(summary, description, eventType, null, false);
         }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

               if (!isNew)
                  System.err.println("EventPlugin.sessionPreRemoved: Unexpected occurrence of " + name);

               // Remove the listener for now
               SessionName sessionName = new SessionName(this.engineGlob, name);
               SessionInfo sessionInfo = this.requestBroker.getAuthenticate().getSessionInfo(sessionName);
               DispatchManager mgr = null;
               if (sessionInfo != null)
                  mgr = sessionInfo.getDispatchManager();
               if (mgr != null) {
                  mgr.removeConnectionStatusListener(this);
                  // this.callbackSessionStateSet does not change as the client could login again
               }
            } catch (Throwable e) {
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

      // Key '__sys__UserList' for login/logout event
      // PublishKey(glob, Constants.EVENT_OID_USERLIST/*"__sys__UserList"*/, "text/plain");

      if (this.clientSet == null) return;

      SessionInfo sessionInfo = clientEvent.getSessionInfo();
      SessionName sessionName = sessionInfo.getSessionName();
     
      try {
         ConnectQosData cd = sessionInfo.getConnectQos().getData();
         // A client can on connect send a event/disconnect=false clientProperty to suppress the event fired
         if (cd.getClientProperty(ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "disconnect", true) == false) {
            if (log.isLoggable(Level.FINE))  log.fine("Found " + ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "disconnect=true for "+sessionName.toString());
          return;
         }
      }
      catch (Throwable e) {
        e.printStackTrace();
        log.warning("Accessing connectQos failed: " + e.toString());
      }
     
      String relativeName = sessionName.getRelativeName();

      String event = ContextNode.SEP + ContextNode.EVENT_MARKER_TAG + ContextNode.SEP + "disconnect";
      String foundEvent = relativeName + event;  // "client/joe/session/1/event/disconnect"
      if (!this.clientSet.contains(foundEvent)) {
         // "client/joe/session/*/event/disconnect"
         foundEvent = sessionName.getRelativePubSessionIdWildcard() + event;
         if (!this.clientSet.contains(foundEvent)) {
            // "client/*/session/1/event/disconnect"
            foundEvent = sessionName.getRelativeSubjectIdWildcard() + event;
            if (!this.clientSet.contains(foundEvent)) {
               // "client/*/session/*/event/disconnect"
               foundEvent = sessionName.getRelativeWildcard() + event;
               if (!this.clientSet.contains(foundEvent)) {
                  return;
               }
            }
         }
      }

      try {
         String summary = "Logout of client " + sessionName.getAbsoluteName();
         String description = summary;
         String eventType = foundEvent;
         String errorCode = null;

         if (this.smtpDestinationHelper != null) {
            sendEmail(summary, description, eventType, null, sessionName, false);
         }

         if (this.publishDestinationHelper != null) {
            sendMessage(summary, description,
                    eventType, errorCode, sessionName, sessionInfo.getRemotePropertyArr());
         }

         if (this.jmxDestinationHelper != null) {
            sendJmxNotification(summary, description, eventType, null, false);
         }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

    */
   public void subscriptionAdd(SubscriptionEvent subscriptionEvent) throws XmlBlasterException {
      if (this.topicSet == null && this.clientSet == null) return;

      SubscriptionInfo subscriptionInfo = subscriptionEvent.getSubscriptionInfo();
      SessionInfo sessionInfo = subscriptionInfo.getSessionInfo();
      SessionName sessionName = sessionInfo.getSessionName();
      String oid = subscriptionInfo.getKeyOid(); // is null for XPATH
      String url = subscriptionInfo.getKeyData().getUrl();

      // EXACT subscription recursion detection
      if (this.publishDestinationHelper != null && oid != null && oid.equals(this.publishDestinationHelper.getKeyOid())) {
         log.info("Ignoring subscribe event on topic '" + oid + "' from '" + sessionName.getRelativeName() + "' to avoid recursion");
         return;
      }

      // "/event/subscribe"
      String event = ContextNode.SEP + "event" + ContextNode.SEP + "subscribe";

      // "topic/hello/event/subscribe"
      String foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + oid + event;
      boolean found = true;
      if (this.topicSet != null) {
         if (!this.topicSet.contains(foundEvent)) {
            // "topic/*/event/subscribe"
            foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + "*" + event;
            if (!this.topicSet.contains(foundEvent)) {
               found = false;
            }
         }
      }
      /*
      if (found) {
         if (subscriptionInfo.isQuery() && wouldMatcheOurSysEventOid) {
            log.info("Ignoring XPATH subscribe event on topic '" + oid + "' from '" + sessionName.getRelativeName() + "' to avoid recursion");
            return;
         }
      }
      */
      if (!found) {
         if (this.clientSet == null) return;
         if (!this.clientSet.contains(foundEvent)) {
            // "client/joe/session/*/event/subscribe"
            foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + sessionName.getLoginName() + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
            if (!this.clientSet.contains(foundEvent)) {
               // "client/*/session/*/event/subscribe"
               foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + "*" + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
               if (!this.clientSet.contains(foundEvent)) {
                  return;
               }
            }
         }
      }

      try {
         String summary = "New subscription of client "
             + sessionInfo.getSessionName().getAbsoluteName()
             + " on topic " + url;
         String description = subscriptionInfo.toXml();
         String eventType = foundEvent;
         String errorCode = null;

View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

    */
   public void subscriptionRemove(SubscriptionEvent subscriptionEvent) throws XmlBlasterException {
      if (this.topicSet == null && this.clientSet == null) return;

      SubscriptionInfo subscriptionInfo = subscriptionEvent.getSubscriptionInfo();
      SessionInfo sessionInfo = subscriptionInfo.getSessionInfo();
      SessionName sessionName = sessionInfo.getSessionName();
      String oid = subscriptionInfo.getKeyOid(); // is null for XPATH
      String url = subscriptionInfo.getKeyData().getUrl();

      // EXACT subscription recursion detection
      if (this.publishDestinationHelper != null && oid != null && oid.equals(this.publishDestinationHelper.getKeyOid())) {
         log.info("Ignoring unSubscribe event on topic '" + oid + "' from '" + sessionName.getRelativeName() + "' to avoid recursion");
         return;
      }

      // "/event/unSubscribe"
      String event = ContextNode.SEP + "event" + ContextNode.SEP + "unSubscribe";

      // "topic/hello/event/unSubscribe"
      String foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + oid + event;
      boolean found = true;
      if (this.topicSet != null) {
         if (!this.topicSet.contains(foundEvent)) {
            // "topic/*/event/unSubscribe"
            foundEvent = ContextNode.TOPIC_MARKER_TAG + ContextNode.SEP + "*" + event;
            if (!this.topicSet.contains(foundEvent)) {
               found = false;
            }
         }
      }
      if (!found) {
         if (this.clientSet == null) return;
         if (!this.clientSet.contains(foundEvent)) {
            // "client/joe/session/*/event/unSubscribe"
            foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + sessionName.getLoginName() + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
            if (!this.clientSet.contains(foundEvent)) {
               // "client/*/session/*/event/unSubscribe"
               foundEvent = ContextNode.SUBJECT_MARKER_TAG + ContextNode.SEP + "*" + ContextNode.SEP + ContextNode.SESSION_MARKER_TAG + ContextNode.SEP + "*" + event;
               if (!this.clientSet.contains(foundEvent)) {
                  return;
               }
            }
         }
      }

      try {
         String summary = "unSubscribe of client "
             + sessionInfo.getSessionName().getAbsoluteName()
             + " on topic " + url;
         String description = subscriptionInfo.toXml();
         String eventType = foundEvent;
         String errorCode = null;

View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

         }

         if (this.publishDestinationHelper != null) {
            ClientProperty[] clientProperties = null;
            if (newState == ConnectionStateEnum.ALIVE) {
               SessionInfo sessionInfo = this.requestBroker.getAuthenticate().getSessionInfo(sessionName);
               if (sessionInfo != null) {
                  clientProperties = sessionInfo.getRemotePropertyArr();
                  ArrayList list = new ArrayList();
                  for (int i=0; i<clientProperties.length; i++)
                    list.add(clientProperties[i]);
                  list.add(new ClientProperty("_DispatchStatistic",
                      Constants.TYPE_STRING,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.