Examples of SessionInfo


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, Constants.ENCODING_NONE,
                        ((XmlBlasterAccess) connection).getDispatchStatistic().toXml("")));
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

         if (xmlKey.isRemoteProperties()) { // "__sys__remoteProperties"
            // Example usage
            //java javaclients.HelloWorldPublish -oid __sys__remoteProperties -connect/qos/clientProperty[__remoteProperties] true -connect/qos/clientProperty[myProperty] AAAAAA -session.name OTHER/1
            //java javaclients.HelloWorldGet -clientProperty[__sessionName] OTHER/1 -oid __sys__remoteProperties
            String sessionName = getQos.getData().getClientProperty("__sessionName", (String)null);
            SessionInfo otherSessionInfo = (sessionName == null) ? sessionInfo : getAuthenticate().getSessionInfo(new SessionName(glob, sessionName));
            if (otherSessionInfo == null) {
              log.warning(xmlKey.getOid() + " failed, sessionName not known: " + sessionName);
              return new MsgUnit[0];
            }
            //if (sessionName != null) getQos.getData().getClientProperties().remove("__sessionName");
            String prefix = getQos.getData().getClientProperty("__prefix", (String)null);
            //if (prefix != null) publishQos.getData().getClientProperties().remove("__prefix");
            if (log.isLoggable(Level.FINE)) log.fine("Get " + xmlKey.getOid() + " prefix=" + prefix + " on session=" + otherSessionInfo.getSessionName().getRelativeName());
            ClientProperty[] props = otherSessionInfo.getRemotePropertyArr();
            GetReturnQosServer retQos = new GetReturnQosServer(glob, null, null);
            for (int i=0; i<props.length; i++)
               retQos.getData().getClientProperties().put(props[i].getName(), props[i]);
            MsgUnit[] msgUnitArr = new MsgUnit[1];
            GetKey gk = new GetKey(glob, xmlKey.getOid());
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

    *        false The callee is a subscribe() thread from a client
    */
   private void subscribeToOid(SubscriptionInfo subs, boolean calleeIsXPathMatchCheck) throws XmlBlasterException {
      if (log.isLoggable(Level.FINER)) log.finer("Entering subscribeToOid(subId="+subs.getSubscriptionId()+", oid="+subs.getKeyData().getOid()+", queryType="+subs.getKeyData().getQueryType()+") ...");
      String uniqueKey = subs.getKeyData().getOid();
      SessionInfo publisherSessionInfo = null; // subs.getSessionInfo() is the wrong one
      TopicHandler topicHandler = this.glob.getTopicAccessor().findOrCreate(publisherSessionInfo, uniqueKey);
      try {
         subs.incrSubscribeCounter();

         fireSubscribeEvent(subs)// inform all listeners about this new subscription
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

            }
            if (glob.useCluster() && otherSessionName != null && otherSessionName.getNodeId() != null && !glob.getNodeId().equals(otherSessionName.getNodeId())) {
               isForOtherClusterNode = true; // TODO: Create a PtP destination which routes to node
            }
            if (!isForOtherClusterNode) {
               SessionInfo otherSessionInfo = (otherSessionName == null) ? sessionInfo : getAuthenticate().getSessionInfo(otherSessionName);
               if (otherSessionInfo == null) {
                  if ("clearLastError".equals(command) || "clearLastWarning".equals(command)) {
                     otherSessionInfo = sessionInfo; // global action, just use the login sessionInf
                  }
                  else {
                     log.warning(msgKeyData.getOid() + " failed, sessionName not known: " + (otherSessionName == null ? "" : otherSessionName.getAbsoluteName()));
                     return Constants.RET_WARN;
                  }
               }
               if (__sessionNameStr != null) publishQos.getData().getClientProperties().remove("__sessionName");
               String prefix = publishQos.getData().getClientProperty("__prefix", (String)null);
               if (prefix != null) publishQos.getData().getClientProperties().remove("__prefix");
               if (log.isLoggable(Level.FINE)) log.fine("Processing " + msgKeyData.getOid() + " command=" + str + " on session=" + otherSessionInfo.getSessionName().getRelativeName());
               if ("set".equals(command)) {
                  otherSessionInfo.setRemoteProperties(publishQos.getData().getClientProperties());
               }
               else if ("clearLastError".equals(command)) {
                  clearLastError();
               }
               else if ("clearLastWarning".equals(command)) {
                  clearLastWarning();
               }
               else if ("clear".equals(command)) {
                  otherSessionInfo.clearRemoteProperties(prefix);
               }
               else // "merge"
                  otherSessionInfo.mergeRemoteProperties(publishQos.getData().getClientProperties());
               I_RemotePropertiesListener[] arr = getRemotePropertiesListenerArr();
               for (int i=0; i<arr.length; i++)
                  arr[i].update(otherSessionInfo, publishQos.getData().getClientProperties());
               return Constants.RET_OK;
            }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

    *    &lt;/key>
    * </pre>
    */
   public void sessionAdded(ClientEvent e) throws XmlBlasterException
   {
      SessionInfo sessionInfo = e.getSessionInfo();
      if (log.isLoggable(Level.FINE)) log.fine("Login event for client " + sessionInfo.toString());

      this.glob.sendNotification(this, "Client '" + sessionInfo.getSessionName().getAbsoluteName() + "' logged in",
         "clientNew", "java.lang.String", "", sessionInfo.getSessionName().getAbsoluteName());

      if (this.publishLoginEvent) {
         this.publishQosLoginEvent.clearRoutes();
         MsgQosData msgQosData = (MsgQosData)this.publishQosLoginEvent.getData().clone();
         // __sessionId is deprecated, please use __publicSessionId
         msgQosData.addClientProperty("__sessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__publicSessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__absoluteName", sessionInfo.getSessionName().getAbsoluteName());

         MsgUnit msgUnit = new MsgUnit(this.xmlKeyLoginEvent,
                                  sessionInfo.getLoginName().getBytes(),
                                  msgQosData);
         publish(this.unsecureSessionInfo, msgUnit); // publish that this client has logged in
         this.publishQosLoginEvent.getData().setTopicProperty(null); // only the first publish needs to configure the topic
      }

      if (log.isLoggable(Level.FINE)) log.fine(" client added:"+sessionInfo.getLoginName());
   }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

    *    &lt;/key>
    * </pre>
    */
   public void sessionRemoved(ClientEvent e) throws XmlBlasterException
   {
      SessionInfo sessionInfo = e.getSessionInfo();

      this.glob.sendNotification(this, "Client '" + sessionInfo.getSessionName().getAbsoluteName() + "' logged out",
         "clientRemoved", "java.lang.String", sessionInfo.getSessionName().getAbsoluteName(), "");

      if (this.publishLogoutEvent) {
         if (log.isLoggable(Level.FINE)) log.fine("Logout event for client " + sessionInfo.toString());
         this.publishQosLogoutEvent.clearRoutes();

         MsgQosData msgQosData = (MsgQosData)this.publishQosLogoutEvent.getData().clone();
         // __sessionId is deprecated, please use __publicSessionId
         msgQosData.addClientProperty("__sessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__publicSessionId", sessionInfo.getPublicSessionId());
         msgQosData.addClientProperty("__absoluteName", sessionInfo.getSessionName().getAbsoluteName());

         MsgUnit msgUnit = new MsgUnit(this.xmlKeyLogoutEvent, sessionInfo.getLoginName().getBytes(), msgQosData);
         publish(this.unsecureSessionInfo, msgUnit); // publish that this client logged out
         this.publishQosLogoutEvent.getData().setTopicProperty(null); // only the first publish needs to configure the topic
      }

      if (log.isLoggable(Level.FINE)) log.fine("Client session '" + sessionInfo.getId() + "' removed");
   }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

   public String[] getAliveCallbackClients() {
      SessionInfo[] arr = this.authenticate.getSessionInfoArr();
      if (arr == null || arr.length == 0) return new String[0];
      ArrayList list = new ArrayList(arr.length);
      for (int i=0; i<arr.length; i++) {
         SessionInfo info = arr[i];
         org.xmlBlaster.util.dispatch.DispatchManager manager = info.getDispatchManager();
         if (manager != null && manager.getDispatchConnectionsHandler().isAlive()) {
            list.add(info.getSessionName().getAbsoluteName());
         }
      }
      return (String[])list.toArray(new String[list.size()]);
   }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

                           //final long refId = callbackEntry.getMsgUnitWrapperUniqueId();
                           // TODO: extract if negative sessionId
                           SessionName sessionName = callbackEntry.getReceiver();
                           long publicSessionId = sessionName.getPublicSessionId();
                           if (publicSessionId < 0) {
                              SessionInfo sessionInfo = authenticate.getSessionInfoByName(sessionName);
                              if (sessionInfo == null) {
                                 leakedEntries.add(ent);
                                 out.write(("Found leak entry '" + ent.getLogId() + "' of unknown session " + sessionName.getAbsoluteName() + "\n").getBytes());
                              }
                           }
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

         out.write(("\n"+XmlBlasterException.createVersionInfo()+"\n").getBytes());


         SessionInfo[] ses = authenticate.getSessionInfoArr();
         for (int i=0; i<ses.length; i++) {
            SessionInfo s = ses[i];
            if (s == null) continue;
            out.write(("\n <SessionInfo id='"+s.getSessionName().getAbsoluteName()+"'>").getBytes("UTF-8"));
            out.write(("\n   <queue relating='callback' entries='"+s.getCbQueueNumMsgs()
                  +"' entriesCache='"+s.getCbQueueNumMsgsCache()+"' bytes='"+s.getCbQueueBytes()+"' bytesCache='"+s.getCbQueueBytesCache()+"'/>").getBytes("UTF-8"));
            out.write(("\n </SessionInfo>").getBytes("UTF-8"));
         }

         out.write(("\n").getBytes("UTF-8"));
View Full Code Here

Examples of org.xmlBlaster.authentication.SessionInfo

                     if (manager == null) { // fallback if raw access failed
                        // Process the callback queue of each loaded client (we won't find transient clients with positive session id and not yet re-connected)
                        SessionInfo[] arr = authenticate.getSessionInfoArr();
                        for (int i=0; i<arr.length; i++) {
                           SessionInfo sessionInfo = arr[i];
                           I_Queue callbackQueue = sessionInfo.getSessionQueue();
                           if (callbackQueue != null) {
                              callbackQueue.getEntries(new I_EntryFilter() {
                                 public I_Entry intercept(I_Entry ent, I_Storage storage) {
                                    try {
                                       ReferenceEntry callbackEntry = (ReferenceEntry)ent;
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.