public class RuleDefinition extends BaseHandle<java.io.InputStream,OutputStreamSender> implements OutputStreamSender, RuleReadHandle, RuleWriteHandle
Modifier and Type | Class and Description |
---|---|
static interface |
RuleDefinition.RuleMetadata
A RuleMetadata represents optional client-supplied metadata that is stored alongside a RuleDefinition.
|
UNKNOWN_LENGTH
Constructor and Description |
---|
RuleDefinition()
Make a new rule definition, no argument constructor.
|
RuleDefinition(java.lang.String name,
java.lang.String description)
Make a new rule definition
|
Modifier and Type | Method and Description |
---|---|
<T extends XMLReadHandle> |
exportQueryDefinition(T handle)
Exports the embedded query definitions and options to a handle
|
java.lang.String |
getDescription()
Returns the rule's definition.
|
RuleDefinition.RuleMetadata |
getMetadata()
Gets the metadata object associated with this rule
|
java.lang.String |
getName()
Gets the name of the rule.
|
void |
importQueryDefinition(XMLWriteHandle queryDef)
Imports an XML combined search definition that defines the matching
criteria for this rule.
|
protected java.lang.Class<java.io.InputStream> |
receiveAs() |
protected void |
receiveContent(java.io.InputStream content) |
protected OutputStreamSender |
sendContent() |
void |
setDescription(java.lang.String description)
Sets the description of the rule.
|
void |
setMetadata(RuleDefinition.RuleMetadata metadata)
Sets the metadata object for this rule.
|
void |
setName(java.lang.String name)
Sets the name of the rule.
|
void |
write(java.io.OutputStream out)
Writes a serialized RuleDefinition to an OutputStream as XML.
|
getByteLength, getFormat, getMimetype, getServerTimestamp, setByteLength, setFormat, setMimetype, setServerTimestamp
public RuleDefinition(java.lang.String name, java.lang.String description)
name
- The name of the rule. Should be unique among rule names on the
REST server.description
- Text description of the rule.public RuleDefinition()
public void setName(java.lang.String name)
name
- The rule's name.public java.lang.String getName()
public void setDescription(java.lang.String description)
description
- The rule's description.public java.lang.String getDescription()
public void importQueryDefinition(XMLWriteHandle queryDef)
queryDef
- A combined raw query definition serialized as XML.public <T extends XMLReadHandle> T exportQueryDefinition(T handle)
T
- the type of XMLReadHandle to returnhandle
- The handle to use for export.public RuleDefinition.RuleMetadata getMetadata()
public void setMetadata(RuleDefinition.RuleMetadata metadata)
metadata
- The metadatapublic void write(java.io.OutputStream out) throws java.io.IOException
write
in interface OutputStreamSender
out
- the output stream receiving the contentjava.io.IOException
- if io problems ariseprotected void receiveContent(java.io.InputStream content)
receiveContent
in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
protected java.lang.Class<java.io.InputStream> receiveAs()
receiveAs
in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
protected OutputStreamSender sendContent()
sendContent
in class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
Copyright © 2013-2018 MarkLogic Corporation.