Codota Logo
RuleManager.match
Code IndexAdd Codota to your IDE (free)

How to use
match
method
in
com.marklogic.client.alerting.RuleManager

Best Java code snippets using com.marklogic.client.alerting.RuleManager.match (Showing top 18 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: marklogic/java-client-api

@Test
public void testPostDocumentWithoutFormat() throws SAXException, IOException {
 StringHandle stringHandle = new StringHandle("<search xmlns=\"http://marklogic.com/appservices/search\"><qtext>true</qtext></search>");
 DOMHandle answer = ruleManager.match(stringHandle, new DOMHandle());
 Document doc = answer.get();
 NodeList nl = doc.getElementsByTagNameNS(
  "http://marklogic.com/rest-api", "name");
 assertEquals(2, nl.getLength());
}
origin: marklogic/java-client-api

@Test
public void testMatchPostQuery() throws SAXException, IOException {
 StructuredQueryBuilder qb = new StructuredQueryBuilder();
 StructuredQueryDefinition structuredQuery;
 structuredQuery = qb.rangeConstraint("favorited", Operator.EQ, "true");
 DOMHandle answer = ruleManager.match(structuredQuery, new DOMHandle());
 Document doc = answer.get();
 NodeList nl = doc.getElementsByTagNameNS(
  "http://marklogic.com/rest-api", "name");
 assertEquals(2, nl.getLength());
 answer = ruleManager.match(structuredQuery, 1, QueryManager.DEFAULT_PAGE_LENGTH,
  new String[] { "favorites" }, new DOMHandle());
 doc = answer.get();
 nl = doc.getElementsByTagNameNS("http://marklogic.com/rest-api", "name");
 assertEquals(1, nl.getLength());
}
origin: marklogic/java-client-api

@Test
public void testRuleMatchTransform() {
 StructuredQueryBuilder qb = new StructuredQueryBuilder();
 StructuredQueryDefinition structuredQuery;
 structuredQuery = qb.rangeConstraint("favorited", Operator.EQ, "true");
 ServerTransform transform = new ServerTransform("ruleTransform");
 DOMHandle answer = ruleManager.match(structuredQuery, 0L, QueryManager.DEFAULT_PAGE_LENGTH, new String[] {}, new DOMHandle(), transform);
 Document doc = answer.get();
 NodeList nl = doc.getElementsByTagNameNS(
  "", "transformed-name");
 assertEquals(2, nl.getLength());
}
origin: marklogic/java-client-api

@Test
public void testMatchGetQuery() {
 StringQueryDefinition qtext = queryManager
  .newStringDefinition("alerts");
 qtext.setCriteria("favorited:true");
 RuleDefinitionList answer = ruleManager.match(qtext,
  new RuleDefinitionList());
 assertEquals("One answer", 1, answer.size());
 qtext.setCriteria("favorited:false");
 answer = ruleManager.match(qtext, 1L, 10L, new String[] { "favorites",
  "notfavorited" }, answer);
 assertEquals("One answer", answer.size(), 1);
 assertEquals("Right answer", "notfavorited", answer.iterator().next()
  .getName());
 answer = ruleManager.match(qtext, 1L, 0L, new String[] { "favorites",
  "notfavorited" }, answer);
 assertEquals("Zero answers (pageLength 0)", answer.size(), 0);
 answer = ruleManager.match(qtext, 3L, QueryManager.DEFAULT_PAGE_LENGTH, new String[] { "favorites",
  "notfavorited" }, answer);
 assertEquals("Zero answers (default pageLength, but start beyond result size)", answer.size(), 0);
}
origin: marklogic/java-client-api

@Test
public void testMatchGetDocumentUri() {
 String[] docs = new String[] { "/alert/second.xml" };
 String[] candidates = new String[] { "notfavorited" };
 RuleDefinitionList answer = ruleManager.match(docs,
  new RuleDefinitionList());
 assertEquals(
  "One answer for first match scenario, favorite against all rules",
  1, answer.size());
 RuleDefinition ruleMatch = answer.iterator().next();
 assertEquals("favorites", ruleMatch.getName());
 answer = ruleManager.match(docs, candidates, answer, null);
 assertEquals(
  "Zero answers for second match scenario, favorites against false rule ",
  0, answer.size());
 docs = new String[] { "/alert/first.xml", "/alert/third.xml" };
 answer = ruleManager.match(docs, answer);
 assertEquals("One answer for first match scenario", 1, answer.size());
 RuleDefinition match = answer.iterator().next();
 assertEquals("notfavorited", match.getName());
}
origin: marklogic/java-client-api

@Test
public void testMatchPostDocument() {
 String docToMatch1 = "<favorited>true</favorited>";
 String docToMatch2 = "<favorited>false</favorited>";
 RuleDefinitionList ans1 = ruleManager.match(new StringHandle(
  docToMatch1).withFormat(Format.XML), new RuleDefinitionList());
 assertEquals("doc match 1 count", 1, ans1.size());
 assertEquals("doc match 1", "favorites", ans1.iterator().next()
  .getName());
 RuleDefinitionList ans2 = ruleManager.match(new StringHandle(
  docToMatch2).withFormat(Format.XML), new RuleDefinitionList());
 assertEquals("doc match 2 count", 1, ans2.size());
 assertEquals("doc match 2", "notfavorited", ans2.iterator().next()
  .getName());
}
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(handle, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(docUris, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(termQuery1, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, 1, 2, candidateRules, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(termQuery1, 0L, QueryManager.DEFAULT_PAGE_LENGTH, new String[] {}, new RuleDefinitionList(), transform);
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, new RuleDefinitionList());
origin: marklogic/java-client-api

RuleDefinitionList matchedRules = ruleMatchMgr.match(querydef, 1, 2, candidateRules, new RuleDefinitionList());
com.marklogic.client.alertingRuleManagermatch

Javadoc

Matches server rules based on a document supplied in a write handle.

Popular methods of RuleManager

  • writeRule
    Writes a rule to the server from the provided handle.
  • delete
    Removes a rule from the server.
  • exists
    Tests for existence of rule on the REST server.
  • readRule
    Reads a rule from the server into the provided handle.
  • writeRuleAs
    Writes a rule to the server in an XML representation provided as an object of an IO class. The IO cl

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • startActivity (Activity)
  • getSystemService (Context)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now