Examples of MsgQueueConnectEntry


Examples of org.xmlBlaster.client.queuemsg.MsgQueueConnectEntry

   /**
    * Encrypt and send a connect request, decrypt the returned data
    */
   private void connect(MsgQueueEntry entry) throws XmlBlasterException {
      MsgQueueConnectEntry connectEntry = (MsgQueueConnectEntry)entry;
      this.sessionName = connectEntry.getConnectQosData().getSessionName();

      String encryptedConnectQos = getEncryptedConnectQos(connectEntry.getConnectQosData());

      // TODO: pass connectEntry.getConnectQosData().getSender().getLoginName(); as this is used by SOCKET:requestId
      String rawReturnVal = this.driver.connect(encryptedConnectQos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumConnect(1);
     
      if (securityInterceptor != null) { // decrypt return value ...
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.CONNECT, new MsgUnitRaw(null, (byte[])null, rawReturnVal));
         dataHolder.setReturnValue(true);
         rawReturnVal = securityInterceptor.importMessage(dataHolder).getQos();
      }

      try {
         this.connectReturnQos = new ConnectReturnQos(glob, rawReturnVal);
         setCheckpointContext(this.connectReturnQos);
      }
      catch (XmlBlasterException e) {
         log.severe("Can't parse returned connect QoS value '" + rawReturnVal + "': " + e.getMessage());
         throw e;
      }

      if (!connectEntry.getConnectQosData().getSessionName().isSession()) {
         // We need to remember the server side assigned public session id for reconnect polling
         // If do we should probably take a clone:
         //ConnectQos connectQos = new ConnectQos(this.glob, this.connectReturnQos.getData());
         ConnectQosData connectQos = connectEntry.getConnectQosData();
         connectQos.setSessionName(this.connectReturnQos.getSessionName());
         this.sessionName = this.connectReturnQos.getSessionName();
         connectQos.getSessionQos().setSecretSessionId(this.connectReturnQos.getSecretSessionId());
         this.connectQosData = connectQos;
      }

      if (connectEntry.wantReturnObj()) {
         connectEntry.setReturnObj(this.connectReturnQos);
      }
      this.driver.setConnectReturnQos(this.connectReturnQos);
   }
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueConnectEntry

      try {
         StorageId storageId = new StorageId(glob, Constants.RELATING_CLIENT, "connectEntry");

         int step = 1000;
         int numCreate = 1000000;
         MsgQueueConnectEntry entryArr[] = new MsgQueueConnectEntry[numCreate];
         log.info("Hit a key for new MsgQueueConnectEntry RAM size test ...");
         try { System.in.read(); } catch(java.io.IOException e) {}
         for(int i=0; i<numCreate; i++) {
            ConnectQos connectQos = new ConnectQos(glob);
            entryArr[i] = new MsgQueueConnectEntry(glob, storageId, connectQos.getData());
            if (i > 0 && (i % step) == 0) {
               log.info("Overall created #" + i + ": Created " + step + " new MsgQueueConnectEntry instances, connectQosSize=" + connectQos.size() + ", hit a key to create more ...");
               try { System.in.read(); } catch(java.io.IOException e) {}
            }
            if (log.isLoggable(Level.FINE)) log.fine("Dump publis meat: " + entryArr[i].toXml());
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueConnectEntry

   /**
    * Sends the current connectQos to xmlBlaster and stores the connectReturnQos.
    * @throws XmlBlasterException
    */
   private void sendConnectQos() throws XmlBlasterException {
      MsgQueueConnectEntry entry = new MsgQueueConnectEntry(this.glob, this.clientQueue.getStorageId(), this.connectQos.getData());
      // Try to connect to xmlBlaster ...
      this.connectReturnQos = (ConnectReturnQos)queueMessage(entry);
      this.connectReturnQos.getData().setInitialConnectionState(this.dispatchManager.getDispatchConnectionsHandler().getState());
   }
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueConnectEntry

               tmpList.add("  "+pe.getMsgUnit().getKeyData().toXml());
               tmpList.add("  "+pe.getMsgUnit().getContentStr());
               tmpList.add("  "+pe.getMsgUnit().getQosData().toXml());
            }
            else if (entry instanceof MsgQueueConnectEntry) {
              MsgQueueConnectEntry pe = (MsgQueueConnectEntry)entry;
                tmpList.add("  "+pe.getConnectQosData().toXml());
            }
            else if (entry instanceof MsgQueueDisconnectEntry) {
              MsgQueueDisconnectEntry pe = (MsgQueueDisconnectEntry)entry;
                tmpList.add("  "+pe.getDisconnectQos().toXml());
            }
            else if (entry instanceof MsgQueueEraseEntry) {
              MsgQueueEraseEntry pe = (MsgQueueEraseEntry)entry;
                tmpList.add("  "+pe.getEraseKey().toXml());
                tmpList.add("  "+pe.getEraseQos().toXml());
            }
            else if (entry instanceof MsgQueueGetEntry) {
              MsgQueueGetEntry pe = (MsgQueueGetEntry)entry;
                tmpList.add("  "+pe.getGetKey().toXml());
                tmpList.add("  "+pe.getGetQos().toXml());
            }
            else if (entry instanceof MsgQueueSubscribeEntry) {
              MsgQueueSubscribeEntry pe = (MsgQueueSubscribeEntry)entry;
                tmpList.add("  "+pe.getSubscribeKeyData().toXml());
                tmpList.add("  "+pe.getSubscribeQosData().toXml());
            }
            else if (entry instanceof MsgQueueUnSubscribeEntry) {
              MsgQueueUnSubscribeEntry pe = (MsgQueueUnSubscribeEntry)entry;
                tmpList.add("  "+pe.getUnSubscribeKey().toXml());
                tmpList.add("  "+pe.getUnSubscribeQos().toXml());
            }
            else {
               tmpList.add("Unsupported message queue entry '" + entry.getClass().getName() + "'");
            }
         }
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.