Examples of MsgQueueGetEntry


Examples of org.xmlBlaster.client.queuemsg.MsgQueueGetEntry

   /**
    * Encrypt and send a synchronous get request, decrypt the returned data
    */
   private void get(MsgQueueEntry entry) throws XmlBlasterException {
      MsgQueueGetEntry getEntry = (MsgQueueGetEntry)entry;

      String key = getEntry.getGetKey().toXml();
      String qos = getEntry.getGetQos().toXml();
      if (this.securityInterceptor != null) {  // We export/encrypt the message (call the interceptor)
         CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, new MsgUnitRaw(key, (byte[])null, qos));
         MsgUnitRaw msgUnitRaw = securityInterceptor.exportMessage(dataHolder);
         key = msgUnitRaw.getKey();
         qos = msgUnitRaw.getQos();
         if (log.isLoggable(Level.FINE)) log.fine("Exported/encrypted get request.");
      }
      else {
         log.warning("No session security context, get request is not encrypted");
      }

      MsgUnitRaw[] rawReturnValArr = this.driver.get(key, qos); // Invoke remote server

      connectionsHandler.getDispatchStatistic().incrNumGet(1);
     
      MsgUnit[] msgUnitArr = new MsgUnit[rawReturnValArr.length];
      if (getEntry.wantReturnObj()) {
         for (int ii=0; ii<rawReturnValArr.length; ii++) {
            if (this.securityInterceptor != null) { // decrypt return value ...
               CryptDataHolder dataHolder = new CryptDataHolder(MethodName.GET, rawReturnValArr[ii]);
               dataHolder.setReturnValue(true);
               rawReturnValArr[ii] = securityInterceptor.importMessage(dataHolder);
            }
            // NOTE: We use PUBLISH here instead of GET_RETURN to have the whole MsgUnit stored
            msgUnitArr[ii] = new MsgUnit(glob, rawReturnValArr[ii], MethodName.PUBLISH);
         }

         getEntry.setReturnObj(msgUnitArr);
      }
   }
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueGetEntry

         else if (MethodName.DISCONNECT == msgQueueEntry.getMethodName()) {
            if (log.isLoggable(Level.FINE)) log.fine("disconnect returns void, nothing to do");
         }

         else if (MethodName.GET == msgQueueEntry.getMethodName()) {
            MsgQueueGetEntry entry = (MsgQueueGetEntry)msgQueueEntry;
            throw new XmlBlasterException(glob, ErrorCode.USER_CONFIGURATION, ME,
               "Synchronous GET on oid='" + entry.getGetKey().getOid() + "' is not possible in offline/polling mode. " +
               "See 'http://www.xmlBlaster.org/xmlBlaster/doc/requirements/client.failsafe.html' for more details.");
         }

         else {
            log.severe("Internal problem, MsgQueueEntry '" + msgQueueEntry.getEmbeddedType() + "' not expected here");
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueGetEntry

    */
   public MsgUnit[] get(GetKey getKey, GetQos getQos) throws XmlBlasterException {
      if (!this.isValid)
         throw new XmlBlasterException(this.glob, ErrorCode.RESOURCE_UNAVAILABLE, ME, "get");
      if (!isConnected()) throw new XmlBlasterException(glob, ErrorCode.USER_NOT_CONNECTED, ME);
      MsgQueueGetEntry entry  = new MsgQueueGetEntry(glob,
                                      this.clientQueue.getStorageId(), getKey, getQos);
      MsgUnit[] arr = (MsgUnit[])queueMessage(entry);
      return (arr == null) ? new MsgUnit[0] : arr;
   }
View Full Code Here

Examples of org.xmlBlaster.client.queuemsg.MsgQueueGetEntry

              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.