public interface RuleManager
Manages CRUD of rules for the REST API alerting capability, as well as match operations against installed rules.
| Modifier and Type | Method and Description |
|---|---|
void |
delete(String ruleName)
Removes a rule from the server.
|
boolean |
exists(String ruleName)
Tests for existence of rule on the REST server.
|
<T extends RuleListReadHandle> |
match(QueryDefinition docQuery,
long start,
long pageLength,
String[] candidateRules,
T ruleListHandle)
Matches server rules based on results of a search, with pagination applied to search.
|
<T extends RuleListReadHandle> |
match(QueryDefinition docQuery,
long start,
long pageLength,
String[] candidateRules,
T ruleListHandle,
ServerTransform transform)
Matches server rules based on results of a search, with pagination applied to search.
|
<T extends RuleListReadHandle> |
match(QueryDefinition docQuery,
T ruleListHandle)
Matches server rules based on the results of a search.
|
<T extends RuleListReadHandle> |
match(String[] docIds,
String[] candidateRules,
T ruleListHandle)
Matches server rules based on an array of document IDs and an array of rule names.
|
<T extends RuleListReadHandle> |
match(String[] docIds,
String[] candidateRules,
T ruleListHandle,
ServerTransform transform)
Matches server rules based on an array of document IDs and an array of rule names.
|
<T extends RuleListReadHandle> |
match(String[] docIds,
T ruleListHandle)
Matches server rules based on an array of document IDS.
|
<T extends RuleListReadHandle> |
match(StructureWriteHandle document,
String[] candidateRules,
T ruleListHandle)
Matches server rules based on a document supplied in a write handle.
|
<T extends RuleListReadHandle> |
match(StructureWriteHandle document,
String[] candidateRules,
T ruleListHandle,
ServerTransform transform)
Matches server rules based on a document supplied in a write handle.
|
<T extends RuleListReadHandle> |
match(StructureWriteHandle document,
T ruleListHandle)
Matches server rules based on a document supplied in a write handle.
|
<T extends RuleListReadHandle> |
matchAs(Object content,
String[] candidateRules,
T ruleListHandle)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
|
<T extends RuleListReadHandle> |
matchAs(Object content,
String[] candidateRules,
T ruleListHandle,
ServerTransform transform)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
|
<T extends RuleListReadHandle> |
matchAs(Object content,
T ruleListHandle)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
|
<T extends RuleReadHandle> |
readRule(String ruleName,
T readHandle)
Reads a rule from the server into the provided handle.
|
<T> T |
readRuleAs(String ruleName,
Class<T> as)
Reads a rule from the server in an XML representation provided as an object of an IO class.
|
void |
writeRule(RuleDefinition writeHandle)
Writes a rule to the server from the provided handle.
|
void |
writeRule(String ruleName,
RuleWriteHandle writeHandle)
Writes a rule to the server from the provided handle.
|
void |
writeRuleAs(String ruleName,
Object ruleSource)
Writes a rule to the server in an XML representation provided as an object of an IO class.
|
boolean exists(String ruleName)
Tests for existence of rule on the REST server.
ruleName - Name of the rule<T> T readRuleAs(String ruleName, Class<T> as) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads a rule from the server in an XML representation provided as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itruleName - name of rule on REST serveras - the IO class for reading the ruleResourceNotFoundExceptionForbiddenUserExceptionFailedRequestException<T extends RuleReadHandle> T readRule(String ruleName, T readHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads a rule from the server into the provided handle.
T - the type of RuleReadHandle to returnruleName - Name of rule on REST server.readHandle - Handle that will accept the rule payload. Often will be an instance of RuleDefinition.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeRuleAs(String ruleName, Object ruleSource) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes a rule to the server in an XML representation provided as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
ruleName - name of rule on REST serverruleSource - an IO representation of the ruleResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeRule(RuleDefinition writeHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes a rule to the server from the provided handle.
writeHandle - Handle that contains the rule payload. Must be a RuleDefinition object to use this method, which has no ruleName.ResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeRule(String ruleName, RuleWriteHandle writeHandle)
Writes a rule to the server from the provided handle.
ruleName - Name of rule on REST server.writeHandle - Handle that contains the rule payload. Often will be an instance of RuleDefinition.void delete(String ruleName) throws ForbiddenUserException, FailedRequestException
Removes a rule from the server.
ruleName - Name of rule on REST server.ForbiddenUserExceptionFailedRequestException<T extends RuleListReadHandle> T match(QueryDefinition docQuery, T ruleListHandle)
Matches server rules based on the results of a search.
T - the type of RuleListReadHandle to returndocQuery - A query definition to qualify documents to match.ruleListHandle - A handle to hold the match results.<T extends RuleListReadHandle> T match(QueryDefinition docQuery, long start, long pageLength, String[] candidateRules, T ruleListHandle)
Matches server rules based on results of a search, with pagination applied to search. Use this method to match, say, a page or search results against rules.
T - the type of RuleListReadHandle to returndocQuery - A query definition to qualify documents to match.start - The start position in query results to match.pageLength - The number of results in the filtering query to match. Use null to return all matches.candidateRules - An array of rule names to return in matches. Null matches all rules.ruleListHandle - A handle to hold the match results.<T extends RuleListReadHandle> T match(QueryDefinition docQuery, long start, long pageLength, String[] candidateRules, T ruleListHandle, ServerTransform transform)
Matches server rules based on results of a search, with pagination applied to search. Use this method to match, say, a page or search results against rules.
T - the type of RuleListReadHandle to returndocQuery - A query definition to qualify documents to match.start - The start position in query results to match.pageLength - The number of results in the filtering query to match. Use null to return all matches.candidateRules - An array of rule names to return in matches. A zero-length array matches all rules.ruleListHandle - A handle to hold the match results.transform - a server transform to modify the rule list payload.<T extends RuleListReadHandle> T match(String[] docIds, T ruleListHandle)
Matches server rules based on an array of document IDS.
T - the type of RuleListReadHandle to returndocIds - An array of document IDs to match against.ruleListHandle - A handle to hold the match results.<T extends RuleListReadHandle> T match(String[] docIds, String[] candidateRules, T ruleListHandle)
Matches server rules based on an array of document IDs and an array of rule names.
T - the type of RuleListReadHandle to returndocIds - An array of document IDs to match against.candidateRules - An array of rule names to return in matches. A zero-length array matches all rules.ruleListHandle - A handle to hold the match results<T extends RuleListReadHandle> T match(String[] docIds, String[] candidateRules, T ruleListHandle, ServerTransform transform)
Matches server rules based on an array of document IDs and an array of rule names.
T - the type of RuleListReadHandle to returndocIds - An array of document IDs to match against.candidateRules - An array of rule names to return in matches. A zero-length array matches all rules.ruleListHandle - A handle to hold the match results.transform - a server transform to modify the rule list payload.<T extends RuleListReadHandle> T matchAs(Object content, T ruleListHandle)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itcontent - an IO representation of the document to match against rulesruleListHandle - a handle to hold the match results<T extends RuleListReadHandle> T matchAs(Object content, String[] candidateRules, T ruleListHandle)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itcontent - an IO representation of the document to match against rulescandidateRules - an array of rule names to match. A zero-length array matches all rules.ruleListHandle - a handle to hold the match results<T extends RuleListReadHandle> T matchAs(Object content, String[] candidateRules, T ruleListHandle, ServerTransform transform)
Matches server rules based on a document supplied in a textual representation provided as an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of RuleListReadHandle to returncontent - an IO representation of the document to match against rulescandidateRules - an array of rule names to match. A zero-length array matches all rules.ruleListHandle - a handle to hold the match resultstransform - a server transform to modify the rule list payload<T extends RuleListReadHandle> T match(StructureWriteHandle document, T ruleListHandle)
Matches server rules based on a document supplied in a write handle.
T - the type of RuleListReadHandle to returndocument - A document payload to match against rules.ruleListHandle - A handle to hold the match results.<T extends RuleListReadHandle> T match(StructureWriteHandle document, String[] candidateRules, T ruleListHandle)
Matches server rules based on a document supplied in a write handle.
T - the type of RuleListReadHandle to returndocument - A document payload to match against rules.candidateRules - An array of rule names to match. A zero-length array matches all rules.ruleListHandle - A handle to hold the match results<T extends RuleListReadHandle> T match(StructureWriteHandle document, String[] candidateRules, T ruleListHandle, ServerTransform transform)
Matches server rules based on a document supplied in a write handle.
T - the type of RuleListReadHandle to returndocument - A document payload to match against rules.candidateRules - An array of rule names to match. A zero-length array matches all rules.ruleListHandle - A handle to hold the match results.transform - a server transform to modify the rule list payload.Copyright © 2013-2017 MarkLogic Corporation.