Package org.xmlBlaster.engine.mime

Examples of org.xmlBlaster.engine.mime.Query


      PluginInfo info = new PluginInfo(glob, null, "XPathFilter", "1.0");
      info.getParameters().put(XPathFilter.MATCH_AGAINST_QOS, ""+true);
      filter.init(glob, info);
     
      {
         Query query = new Query(glob, queryStr);
         boolean ret = filter.match(sessionInfo, msgUnit, query);
         System.out.println("Match: " + ret + "\nResult: " + msgUnit.getQos());
         assertTrue(queryStr + " should match", ret);
      }

      {
         queryStr = "/a";
         Query query = new Query(glob, queryStr);
         boolean ret = filter.match(sessionInfo, msgUnit, query);
         System.out.println("Match: " + ret + "\nResult: " + msgUnit.getQos());
         assertFalse(queryStr + " shouldn't match", ret);
      }
   }
View Full Code Here


  
         PluginInfo info = new PluginInfo(glob, null, "XPathFilter", "1.0");
         info.getParameters().put(XPathFilter.XSL_CONTENT_TRANSFORMER_FILE_NAME, xslFile);
         filter.init(glob, info);
        
         Query query = new Query(glob, queryStr);
         boolean ret = filter.match(sessionInfo, msgUnit, query);
         System.out.println("Match: " + ret + "\nResult: " + msgUnit.getContentStr());
         assertTrue(ret);
         assertXMLEqual("<c/>", msgUnit.getContentStr());
      }
View Full Code Here

            System.out.print("xpath> " + line);
            line = in.readLine(); // Blocking in I/O
            if (line == null) continue;
            line = line.trim();
            if (line.length() < 1) continue;
            Query query = new Query(glob, line);
            if (line.toLowerCase().equals("q") || line.toLowerCase().equals("quit")) {
               System.out.println("Bye");
               System.exit(0);
            }
            try {
View Full Code Here

   public static void main(String[] args) {
      Global glob = new Global(args);
      try {
         SubscribeQos qos = new SubscribeQos(glob);
         qos.setWantContent(false);
         qos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "1.0", new Query(glob, "800")));
         qos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "3.2", new Query(glob, "a<10")));
         System.out.println(qos.toXml());
      }
      catch (Throwable e) {
         System.out.println("Test failed: " + e.toString());
      }
View Full Code Here

   public static void main(String[] args) {
      Global glob = new Global(args);
      try {
         GetQos qos = new GetQos(glob);
         qos.setWantContent(false);
         qos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "1.0", new Query(glob, "800")));
         qos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "3.2", new Query(glob, "a<10")));
         System.out.println(qos.toXml());
      }
      catch (Throwable e) {
         System.out.println("Test failed: " + e.toString());
      }
View Full Code Here

         subscribeQos.setWantContent(false);
         subscribeQos.setSubscriptionId("MyOwnSentSubscribeId");
         HistoryQos hh = new HistoryQos(glob, 33);
         hh.setNewestFirst(false);
         subscribeQos.setHistoryQos(hh);
         subscribeQos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "1.0", new Query(glob, "800")));
         subscribeQos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter2", "3.2", new Query(glob, "a<10")));
         subscribeQos.setPersistent(true);
         System.out.println("SubscribeQos: " + subscribeQos.toXml());

         QueryQosData qos = factory.readObject(subscribeQos.toXml());
View Full Code Here

         GetQos getQos = new GetQos(glob);
         getQos.setWantContent(false);
         HistoryQos hh = new HistoryQos(glob, 33);
         hh.setNewestFirst(false);
         getQos.setHistoryQos(hh);
         getQos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter", "1.0", new Query(glob, "800")));
         getQos.addAccessFilter(new AccessFilterQos(glob, "ContentLenFilter2", "3.2", new Query(glob, "a<10")));
         System.out.println("GetQos: " + getQos.toXml());
         QueryQosData qos = factory.readObject(getQos.toXml());
         assertEquals("", false, qos.getWantContent());
         assertEquals("", 33, qos.getHistoryQos().getNumEntries());
         assertEquals("", false, qos.getHistoryQos().getNewestFirst());
View Full Code Here

      this.versionProp = versionProp;
      this.glob = glob;

      setType(type);
      setVersion(version);
      setQuery(new Query(glob, query));
   }
View Full Code Here

    * Returns the query, the syntax is depending on what your plugin supports.
    * @return e.g. "a>12 AND b<15"
    */
   public final Query getQuery()
   {
     return (query==null) ? new Query(glob, "") : query;
   }
View Full Code Here

    */
   public final boolean startElement(String uri, String localName, String name, StringBuffer character, Attributes attrs)
   {
      String tmp = character.toString().trim(); // The query
      if (tmp.length() > 0) {
         setQuery(new Query(glob, tmp));
      }
      character.setLength(0);

      if (name.equalsIgnoreCase(this.tagName)) {
         if (attrs != null) {
View Full Code Here

TOP

Related Classes of org.xmlBlaster.engine.mime.Query

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.