Package org.xmlBlaster.client.key

Examples of org.xmlBlaster.client.key.PublishKey.toXml()


         log.info("############ Con2 subscribed for msg and for DEAD letter, publishing now msg");

         PublishKey pk = new PublishKey(glob2, oid, "text/plain", "1.0");
         PublishQos pq = new PublishQos(glob2);
         MsgUnit msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());
         con2.publish(msgUnit);
         log.info("Published message oid=" + oid);

         log.info("############ Con2 is waiting for msg and for DEAD letter ...");
View Full Code Here


         publishKey.setDomain("domain");
         publishKey.setClientTags(clientTags);
         publishKey.setContentMime("image/png");
         publishKey.setContentMimeExtended("2");

         System.out.println("PublishKey: " + publishKey.toXml());

         MsgKeyData key = factory.readObject(publishKey.toXml());

         assertEquals("", "oid", key.getOid());
         assertEquals("", "domain", key.getDomain());
View Full Code Here

         publishKey.setContentMime("image/png");
         publishKey.setContentMimeExtended("2");

         System.out.println("PublishKey: " + publishKey.toXml());

         MsgKeyData key = factory.readObject(publishKey.toXml());

         assertEquals("", "oid", key.getOid());
         assertEquals("", "domain", key.getDomain());
         assertEquals("Input='"+clientTags+"' output='"+key.getClientTags()+"'", clientTags, key.getClientTags());
         assertEquals("", "image/png", key.getContentMime());
View Full Code Here

         ConnectQos qos = new ConnectQos(glob);
         con.connect(qos, this)// Login to xmlBlaster, register for updates

         PublishKey pk = new PublishKey(glob, "Latency", "text/xml", "1.0");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk.toXml(), "Hi".getBytes(), pq.toXml());

         SubscribeKey sk = new SubscribeKey(glob, "Latency");
         SubscribeQos sq = new SubscribeQos(glob);
         con.subscribe(sk.toXml(), sq.toXml()).getSubscriptionId();
View Full Code Here

         String contentString = "This is a simple Test Message for the xml-rpc Protocol";
         byte[] content = contentString.getBytes();

         PublishKey xmlKey = new PublishKey(glob, "", "text/plain", null);

         MsgUnit msgUnit = new MsgUnit(xmlKey.toXml(), content, "<qos><forceUpdate /></qos>");
         client.publish(msgUnit);
         log.info("Published a message");

         client.disconnect(null);
      }
View Full Code Here

      PublishKey key = new PublishKey(glob, "", contentMime, contentMimeExtended);
      key.setClientTags("<location dest='agent-192.168.10.218' driver='PSD1'></location>");
      PublishQos qos = new PublishQos(glob);
      senderContent = "some content";
      try {
         MsgUnit msgUnit = new MsgUnit(key.toXml(), senderContent.getBytes(), qos.toXml());
         sentTimestamp = new Timestamp();
         publishOid = con.publish(msgUnit).getKeyOid();
         log.info("Success: Publishing done, returned oid=" + publishOid);
      } catch(XmlBlasterException e) {
         log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here

         if (contentMime == null) {
            log.severe("File MIME type is unknown, specify MIME type as '-m <MIME>', for example '-m \"image/gif\"' (get help with -?)");
            System.exit(1);
         }
         PublishKey publishKey = new PublishKey(glob, body, contentMime, contentMimeExtended);
         xmlKey = publishKey.toXml()// default <key oid=......></key>
      }
      if (xmlKey == null) {
         log.severe("XmlKey is missing, specify key as '-k <file>' or '-xmlKey <the XML key>' (get help with -?)");
         System.exit(1);
      }
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.