Package org.xmlBlaster.util

Examples of org.xmlBlaster.util.MsgUnit


      String xmlKey = "<?xml version='1.0' encoding='ISO-8859-1' ?>\n" +
                      "<key oid='" + publishOid1 + "' contentMime='" + contentMime + "' contentMimeExtended='" + contentMimeExtended + "'>\n" +
                      "</key>";
      String senderContent = "Yeahh, i'm the new content";
      try {
         MsgUnit msgUnit = new MsgUnit(xmlKey, senderContent.getBytes(), "<qos></qos>");
         stopWatch = new StopWatch();
         String tmp = oneConnection.publish(msgUnit).getKeyOid();
         assertEquals("Wrong publishOid1", publishOid1, tmp);
         log.info("Success: Publishing done, returned oid=" + publishOid1);
      } catch(XmlBlasterException e) {
View Full Code Here


            }
            if (content == null)
               content = "";

            log.info("Publishing '" + key + "'");
            MsgUnit msgUnit = new MsgUnit(glob, key, content.getBytes(), qos);
            try {
               PublishReturnQos prq = xmlBlaster.publish(msgUnit);
               log.fine("Success: Publishing done, returned oid=" + prq.getKeyOid());
            } catch(XmlBlasterException e) {
               log.warning("XmlBlasterException: " + e.getMessage());
View Full Code Here

    if (/*updateKey.isInternal() ||*/ !updateQos.isOk()) {
      log.warning(id + " Ignoring received message " + updateKey.toXml() + " "
          + updateQos.toXml());
      return "";
    }
    MsgUnit msgUnit = new MsgUnit(updateKey.getData(), content, updateQos.getData());
    // if (!positionHasChanged(req, pos)) {
    // return "";String url = getUrl(pos);
    // }
    log.info(id + " receiving '" + msgUnit.toXml() + "'");
    put(msgUnit);
    return "";
  }
View Full Code Here

            }
            else {
               ret.append(obj);
            }
         }
         MsgUnit msgUnit = new MsgUnit("<key oid='__cmd:"+cmd+"'/>", ret.toString().getBytes(), "<qos/>");
         return new MsgUnit[] { msgUnit };
      }
     
      try {
         CommandWrapper w = new CommandWrapper(glob, oid);
View Full Code Here

         else
            return true;
      }
      Hashtable dataHashtable = (Hashtable)obj;
      synchronized (dataHashtable) {
         dataHashtable.put(updateKey.getOid(), new MsgUnit(updateKey.getData(), content, updateQos.getData()));
      }
      return true;
   }
View Full Code Here

   private MsgUnit[] getResponseMessage(byte[] content, String contentMimeExtended)
   {
      PublishKey key = new PublishKey(glob, "__sys_jdbc."+ME, "text/xml", contentMimeExtended);
      GetReturnQosServer retQos = new GetReturnQosServer(glob, null, Constants.STATE_OK);

      MsgUnit mu = new MsgUnit(key.getData(), content, retQos.getData());

      if (log.isLoggable(Level.FINEST)) log.finest("SQL Results...\n" + new String(content));
      MsgUnit[] msgArr = new MsgUnit[1];
      msgArr[0] = mu;
      return msgArr;
View Full Code Here

               XmlBlasterException x = new XmlBlasterException(this.initialGlobal, ErrorCode.USER_ILLEGALARGUMENT, ME, str);
               writeResponse(res, I_XmlBlasterAccessRaw.EXCEPTION_NAME, x.getMessage());
               return;
            }
            if (log.isLoggable(Level.FINE)) log.fine("Publishing '" + key + "'");
            MsgUnit msgUnit = new MsgUnit(glob, key, content, qos);
            try {
               PublishReturnQos prq = xmlBlaster.publish(msgUnit);
               returnObject = prq.getData().toJXPath();
               if (log.isLoggable(Level.FINE)) log.fine("Success: Publishing done, returned oid=" + prq.getKeyOid());
            } catch(XmlBlasterException e) {
View Full Code Here

          "text/xml", "1.0");
      PublishQos pq = new PublishQos(xmlBlaster.getGlobal());
      pq.addClientProperty("sender", req.getSession().getId()); // TODO:
                                    // nice
                                    // name
      MsgUnit msgUnit = new MsgUnit(pk, smsText.getBytes("UTF-8"), pq);
      xmlBlaster.publish(msgUnit);
      return true;
    }
    return false;
  }
View Full Code Here

          // Service markup: sc=serviceCollection, s=service, p=property
          content = "<sc>" + " <s>" + "  <p k='serviceName'>" + serviceName + "</p>"
              + "  <p k='taskType'>" + taskType + "</p>" + "  <p k='task'>" + task
              + "</p>" + "  <p k='data'>" + data + "</p>" + " </s>" + "</sc>";
        }
        MsgUnit msgUnit = new MsgUnit("<key oid='" + topicId + "'/>", content, qos);
        log(getInfo(req) + "Sending request to " + topicId + ": " + content);
        MsgUnit[] msgUnitArr = blasterInstance.getXmlBlasterAccess().request(msgUnit,
            timeout, maxEntries);
        if (msgUnitArr.length > 0) {
          String contentMime = msgUnitArr[0].getQosData().getClientProperty(
View Full Code Here

                      "      </TestSub-DRIVER>"+
                      "   </TestSub-AGENT>" +
                      "</key>";
      senderContent = "Yeahh, i'm the new content";
      try {
         MsgUnit msgUnit = new MsgUnit(xmlKey, senderContent.getBytes(), "<qos></qos>");
         sentTimestamp = new Timestamp();
         PublishReturnQos tmp = senderConnection.publish(msgUnit);
         assertEquals("Wrong publishOid", publishOid, tmp.getKeyOid());
         log.info("Success: Publishing done, returned oid=" + publishOid);
      } catch(XmlBlasterException e) {
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.MsgUnit

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.