Package org.xmlBlaster.client.key

Examples of org.xmlBlaster.client.key.PublishKey


         ConnectQos qos = new ConnectQos(glob); // name, passwd can be set on command line, try -help
         con.connect(qos, this)// Login to xmlBlaster, register for updates


         PublishKey pk = new PublishKey(glob, "HelloWorldMime", "text/xml");
         pk.setClientTags("<org.xmlBlaster><demo/></org.xmlBlaster>");
         PublishQos pq = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(pk, "<news type='sport'/>".getBytes(), pq);
         con.publish(msgUnit);

View Full Code Here


      /*
      String xmlKey = "<key oid='" + oid + "' contentMime='text/plain' contentMimeExtended='systemInfo'>\n" +
                      "   <systemInfo />" +
                      "</key>";
      */
      PublishKey key = new PublishKey(glob, oid, "text/plain", "systemInfo");
      key.setClientTags("<systemInfo />");
      PublishQos qos = new PublishQos(glob);
      MsgUnit msgUnit = new MsgUnit(key, content.getBytes(), qos);

      try {
         con.publish(msgUnit);
View Full Code Here

    * You will receive the result set wrapped in XML with a asynchronous update().
    */
   public MsgUnit toMessage() throws XmlBlasterException
   {
      PublishQos qos = new PublishQos(glob, new Destination(new SessionName(Global.instance(), "__sys__jdbc")));
      PublishKey key = new PublishKey(glob, "", "text/xml", "SQL_QUERY");
      return new MsgUnit(key, toXml().getBytes(), qos);
   }
View Full Code Here

         if (this.key != null) {
            return engineGlob.getMsgKeyFactory().readObject(this.key);
         }
         //PublishKey publishKey = new PublishKey(engineGlob, Constants.EVENT_OID_LOGIN/*"__sys__Login"*/, "text/plain");
         // TODO: invent an oid depending on the eventType:
         PublishKey publishKey = new PublishKey(engineGlob, "__sys__Event", "text/plain", "1.0");
         publishKey.setClientTags("<org.xmlBlaster><event/></org.xmlBlaster>");
         return publishKey.getData();
      }
View Full Code Here

      // one msgListener associated to this session
      boolean realDoActivate = (doActivate && (this.syncMode == MODE_ASYNC));
      if ( (doActivate && this.syncMode == MODE_ASYNC) || !doActivate) {
         String oid = "__cmd:" + this.sessionName + "/?dispatcherActive=" + doActivate;
         PublishQos qos = new PublishQos(this.global);
         PublishKey key = new PublishKey(this.global, oid);
         this.global.getXmlBlasterAccess().publish(new MsgUnit(key, (byte[])null, qos));
         this.connectionActivated = realDoActivate;
      }
   }
View Full Code Here

      boolean isSet = command.indexOf("set ") == 0 || command.indexOf("SET ") == 0;
      String cmd = ((isGet || isSet)) ? command.substring(4) : command;

      if (isSet || (!isGet && cmd.indexOf("=") != -1)) {
         String oid = "__cmd:" + cmd;
         PublishKey key = new PublishKey(glob, oid); // oid="__cmd:/client/joe/1/?dispatcherActive=false"
         PublishQos qos = new PublishQos(glob);
         MsgUnit msgUnit = new MsgUnit(key, "", qos);
         try {
            PublishReturnQos ret = publish(msgUnit);
            if (log.isLoggable(Level.FINE)) log.fine(getLogId()+"Send '" + cmd + " '");
View Full Code Here

    */
   public PublishReturnQos createTemporaryTopic(TopicProperty topicProperty) throws XmlBlasterException {
      if (topicProperty == null) {
         return createTemporaryTopic(-1, 10);
      }
      PublishKey pk = new PublishKey(glob, "");
      PublishQos pq = new PublishQos(glob);
      pq.setTopicProperty(topicProperty);
      MsgUnit msgUnit = new MsgUnit(pk, new byte[0], pq);
      PublishReturnQos prq = publish(msgUnit);
      if (log.isLoggable(Level.FINER)) log.finer(getLogId()+"Created temporary topic " + prq.getKeyOid());
View Full Code Here

    * @return
    * @throws XmlBlasterException
    */
   public PublishReturnQos createTemporaryTopic(String uniqueTopicId, long destroyDelay, int historyMaxMsg) throws XmlBlasterException {
    if (uniqueTopicId == null) uniqueTopicId = "";
      PublishKey pk = new PublishKey(glob, uniqueTopicId);
      PublishQos pq = new PublishQos(glob);
      TopicProperty topicProperty = new TopicProperty(glob);
      topicProperty.setDestroyDelay(destroyDelay);
      topicProperty.setCreateDomEntry(false);
      topicProperty.setReadonly(false);
View Full Code Here

         }
         origMsgUnit.getQosData().addClientProperty(clientPropertyKey, true); // Mark the original to avoid looping if failed client is the dead message listener
         PublishQos pubQos = new PublishQos(glob);
         pubQos.setVolatile(true);
         origMsgUnit.getQosData().addClientProperty(clientPropertyKey, true); // Mark the original to avoid looping if failed client is the dead message listener
         PublishKey publishKey = new PublishKey(glob, Constants.OID_DEAD_LETTER);
         //publishKey.setClientTags("<oid>"+entry.getKeyOid()+"</oid>");
         // null: use the content from origMsgUnit:
         pubQos.addClientProperty(Constants.CLIENTPROPERTY_DEADMSGKEY, origMsgUnit.getKey()); //"__key"
         pubQos.addClientProperty(Constants.CLIENTPROPERTY_DEADMSGQOS, origMsgUnit.getQos()); //"__qos"
         pubQos.addClientProperty(Constants.CLIENTPROPERTY_OID, origMsgUnit.getKeyOid()); //"__oid"
         pubQos.addClientProperty(Constants.CLIENTPROPERTY_RCVTIMESTAMP, origMsgUnit.getQosData().getRcvTimestamp()); //"__rcvTimestamp"
         pubQos.addClientProperty(Constants.CLIENTPROPERTY_DEADMSGREASON, text); //"__deadMessageReason"
         if (receiver != null)
            pubQos.addClientProperty(Constants.CLIENTPROPERTY_DEADMSGRECEIVER, receiver.getAbsoluteName());
         MsgUnit msgUnit = new MsgUnit(origMsgUnit, publishKey.getData(), null, pubQos.getData());
         return publish(unsecureSessionInfo, msgUnit);
      }
      catch(Throwable e) {
         log.severe("PANIC: " + origMsgUnit.getKeyOid() + " dead letter is lost, no recovery possible - dumping to file not yet coded: " + e.toString() + "\n" + origMsgUnit.toXml());
         e.printStackTrace();
View Full Code Here

              Thread.dumpStack();
              return origMsgUnit.getKey();
           }
           PublishQos pubQos = new PublishQos(glob);
           pubQos.setVolatile(true);
           PublishKey publishKey = new PublishKey(glob, Constants.OID_DEAD_LETTER);
           pubQos.addClientProperty(Constants.CLIENTPROPERTY_DEADMSGKEY, origMsgUnit.getKey()); //"__key"
           String qos = origMsgUnit.getQos();
           if (qos != null && qos.indexOf("</sender>") == -1 && sender != null) {
             // If import has not yet added the sender:
             int end = qos.indexOf("</qos>");
View Full Code Here

TOP

Related Classes of org.xmlBlaster.client.key.PublishKey

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.