Package org.xmlBlaster.client.qos

Examples of org.xmlBlaster.client.qos.GetQos


   private String invokeSyncQuery(XmlDbMessageWrapper wrap, int numResultRowsExpected, String token) {
      try {
         if (log.isLoggable(Level.FINE)) log.fine("Sending command string:\n" + wrap.toXml()); // Junit report does not like it
         GetKey key = new GetKey(glob, "__sys__jdbc");
         key.wrap(wrap.toXml());
         GetQos qos = new GetQos(glob);
         MsgUnit[] msgUnitArr = con.get(key.toXml(), qos.toXml());
         if (msgUnitArr.length > 0) {
            String result = new String(msgUnitArr[0].getContent());
            if (log.isLoggable(Level.FINE)) log.fine(result);
            if (token != null && result.indexOf(token) < 0)
               fail("Token " + token + " not found in result");
View Full Code Here


         }
      }
      if ((long)msg.length != exLimit*2) {
         try {
            GetKey getKey = new GetKey(this.glob, "__cmd?dump");
            GetQos getQos = new GetQos(this.glob);
            MsgUnit[] tmp = this.glob.getXmlBlasterAccess().get(getKey, getQos);
            if (tmp.length > 0)
               log.info(tmp[0].getContentStr());
         }
         catch (XmlBlasterException ex) {
View Full Code Here

         MsgUnit msgUnit = new MsgUnit(pk, "<news type='sport'/>".getBytes(), pq);
         con.publish(msgUnit);


         GetKey gk = new GetKey(glob, "HelloWorldMime");
         GetQos gq = new GetQos(glob);
         gq.addAccessFilter(new AccessFilterQos(glob, "XPathFilter", "1.0", "/news[@type='sport']"));
         MsgUnit[] msgs = con.get(gk, gq);

         log.info("Accessed xmlBlaster message synchronous with get() with content '" + new String(msgs[0].getContent()) + "'");

View Full Code Here

         throw new IllegalStateException(ME + ".receive: you have set a messageListener for this session so synchronous message consumption is currently not allowed");
      try {
         this.session.setSyncMode(XBSession.MODE_SYNC); // to disallow invocation of updates
         // query with a given GetQos ...        
         // TODO cache the queryKey here
         GetQos getQos = new GetQos(this.global);
         QuerySpecQos querySpecQos = new QuerySpecQos(this.global, "QueueQuery", "1.0", "maxEntries=1&maxSize=-1&consumable=true&waitingDelay=" + delay + "&subscriptionId=" + this.subscribeReturnQos.getSubscriptionId());
         getQos.addQuerySpec(querySpecQos);
         String getOid = "__cmd:" + this.session.sessionName + "/?callbackQueueEntries";
         MsgUnit[] mu = this.global.getXmlBlasterAccess().get(new GetKey(this.global, getOid), getQos);
         if (mu == null || mu.length < 1 || mu[0] == null) return null;
         String sender = mu[0].getQosData().getSender().getAbsoluteName();
         return MessageHelper.convertFromMsgUnit(this.session, sender, mu[0]);
View Full Code Here

         log.severe(e.toString());
         e.printStackTrace();
      }

      GetKey xmlKeyWr = new GetKey(glob, xmlKey, queryType);
      GetQos xmlQos = new GetQos(glob);
      MsgUnit[] msgs = xmlBlasterConnection.get(xmlKeyWr.toXml(), xmlQos.toXml());
      log.info("Got " + msgs.length + " messages for '" + xmlKey + "'");
      for (int ii=0; ii<msgs.length; ii++) {
         System.out.println("\n" + msgs[ii].toXml());
      }
View Full Code Here

   /**
    * @see I_XmlBlasterAccess#refreshSession()
    */
   public void refreshSession() throws XmlBlasterException {
      GetKey gk = new GetKey(glob, "__refresh");
      GetQos gq = new GetQos(glob);
      get(gk, gq);
   }
View Full Code Here

                                Timestamp timestamp, long sizeInBytes,
                                GetKey getKey, GetQos getQos) {
      super(glob, MethodName.GET.toString(), priority,
            timestamp, storageId,
            (getQos == null) ? false : getQos.getData().isPersistent());
      this.getQos = (getQos == null) ? new GetQos(glob) : getQos;
      this.getKey = getKey;
      this.immutableSizeInBytes = sizeInBytes;
   }
View Full Code Here

   /**
    * @see I_XmlBlasterAccess#get(GetKey, GetQos)
    */
   public MsgUnit[] get(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException {
      return get(new GetKey(glob, glob.getQueryKeyFactory().readObject(xmlKey)),
                 new GetQos(glob, glob.getQueryQosFactory().readObject(qos)) );
   }
View Full Code Here

   /** JMX **/
   public String[] invokeGet(String url, String qos) throws Exception {
      qos = checkQueryKeyQos(url, qos);
      try {
         GetKey gk = new GetKey(glob, url);
         MsgUnit[] msgs = get(gk, new GetQos(glob, glob.getQueryQosFactory().readObject(qos)));
         if (msgs == null) return new String[0];
         if (msgs == null || msgs.length < 1) {
            return new String[] { "get('"+url+"') did not match any topic" };
         }
         ArrayList tmpList = new ArrayList();
View Full Code Here

         }
      }
      else {
         String oid = "__cmd:" + cmd;
         GetKey getKey = new GetKey(glob, oid);
         GetQos getQos = new GetQos(glob);
         try {
            MsgUnit[] msgs = get(getKey, getQos);
            if (log.isLoggable(Level.FINE)) log.fine(getLogId()+"Send '" + cmd + " ', got array of size " + msgs.length);
            if (msgs.length == 0)
               return "";
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.qos.GetQos

Copyright © 2018 www.massapicom. 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.