Examples of SessionEntry


Examples of org.xmlBlaster.engine.queuemsg.SessionEntry

      HashMap sessionIds = new HashMap();
      for (int i=0; i < entries.length; i++) {
       try {
           if (entries[i] instanceof SessionEntry) {
              // do connect
              SessionEntry entry = (SessionEntry)entries[i];
              ConnectQosData data = this.global.getConnectQosFactory().readObject(entry.getQos());

              this.addressServer = new AddressServer(this.global, "NATIVE", this.global.getId(), (java.util.Properties)null);

              ConnectQosServer qos = new ConnectQosServer(this.global, data);
              qos.isFromPersistenceRecovery(true);
              qos.setPersistenceUniqueId(entry.getUniqueId());
              qos.setAddressServer(this.addressServer);

              SessionName sessionName = data.getSessionName();
              String sessionId = data.getSessionQos().getSecretSessionId();
              sessionIds.put(sessionName.getAbsoluteName(), sessionId);
              if (log.isLoggable(Level.FINE))
                 log.fine("recoverSessions: store in map session='" + sessionName.getAbsoluteName() + "' has secret sessionId='" + sessionId + "' and persistenceUniqueId=" + entry.getUniqueId());
              // if (log.isLoggable(Level.FINE)) log.trace(ME, "recoverSessions: session: '" + data.getSessionName() + "' secretSessionId='" + qos.getSessionQos().getSecretSessionId() + "' qos='" + qos.toXml() + "'");
              ConnectReturnQosServer ret = this.global.getAuthenticate().connect(qos);
              if (log.isLoggable(Level.FINEST))
                 log.finest("recoverSessions: return of connect: returnConnectQos='" + ret.toXml() + "'");
           }
View Full Code Here

Examples of org.xmlBlaster.engine.queuemsg.SessionEntry

      // Persist it
      StorageId storageId = null;
      if (sessionInfo.getPersistenceUniqueId() == 0) {
         long uniqueId = new Timestamp().getTimestamp(); // new session
         SessionEntry entry = new SessionEntry(connectQosData.toXml(), uniqueId, connectQosData.size(), storageId);
         if (log.isLoggable(Level.FINE)) log.fine("addSession (persistent) for NEW uniqueId: '" + entry.getUniqueId() + "'");
         sessionInfo.setPersistenceUniqueId(uniqueId);
         this.sessionStore.put(entry);
      }
      else {
         // session exists? -> update
         final long uniqueId = sessionInfo.getPersistenceUniqueId();
         this.sessionStore.change(uniqueId, new I_ChangeCallback() {
            public I_MapEntry changeEntry(I_MapEntry mapEntry)
                  throws XmlBlasterException {
               SessionEntry sessionEntry = new SessionEntry(connectQosData.toXml(), uniqueId, connectQosData.size(),
                     null);
               if (log.isLoggable(Level.FINE)) log.fine("changeSession (persistent) for uniqueId: '" + sessionEntry.getUniqueId() + "'");
               return sessionEntry;
            }
         });
      }
   }
View Full Code Here

Examples of org.xmlBlaster.engine.queuemsg.SessionEntry

      // TODO add a method I_Queue.removeRandom(long uniqueId)
      long uniqueId = sessionInfo.getPersistenceUniqueId();
      if (log.isLoggable(Level.FINE)) log.fine("sessionRemoved (persistent) for uniqueId: '" + uniqueId + "'");
      // String sessionId = getOriginalSessionId(connectQosData.getSessionQos().getSecretSessionId());
      SessionEntry entry = new SessionEntry(connectQosData.toXml(), uniqueId, 0L, null);
      int num = this.sessionStore.remove(entry);
      if (num != 1) {
         XmlBlasterException ex = sessionInfo.getTransportConnectFail();
         if (ex != null)
            log.fine("sessionRemoved (persistent) for uniqueId: '" + uniqueId + "' failed, entry not found.");
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.