public interface TriggerApi
Modifier and Type | Method and Description |
---|---|
void |
compileDictionary(String dictionaryName)
Compile the trigger dictionary identified by
dictionaryName into binary format. |
void |
copyDictionary(String dictionaryName,
String newName)
Copy the trigger dictionary identified by
dictionaryName to a new dictionary with newName . |
void |
createDictionary(TriggerDictionaryInfo info)
Create a new
trigger dictionary. |
void |
createTrigger(String dictionaryName,
TriggerDefinition trigger)
Add
trigger to the dictionary identified by dictionaryName . |
void |
deleteDictionary(String dictionaryName)
Delete a
trigger dictionary identified by dictionaryName . |
void |
deleteTrigger(String dictionaryName,
String triggerName)
Delete trigger named
triggerName for the dictionary identified by dictionaryName . |
void |
exportDictionary(String dictionaryName,
OutputStream output)
Export trigger dictionary by
name to output . |
Iterable<TriggerDictionaryInfo> |
getDictionaries(String prefix,
int offset,
int rows)
Get all dictionaries.
|
TriggerDictionaryInfo |
getDictionary(String dictionaryName)
Get a
TriggerDictionaryInfo by dictionaryName . |
Map<Locale,Long> |
getLocales(String dictionaryName,
String prefix)
Get a map of locales for dictionary specified by
dictionaryName . |
TriggerDefinition |
getTrigger(String dictionaryName,
String triggerName)
|
Iterable<TriggerDefinition> |
getTriggers(String dictionaryName,
Locale locale,
String prefix,
int offset,
int rows)
Get triggers for dictionary identified by
dictionaryName . |
void |
importDictionary(byte[] input,
String newName,
boolean replace)
Deprecated.
|
void |
importDictionary(InputStream input,
String newName,
boolean replace)
Import a trigger dictionary from
input . |
IngestDocument |
process(String dictionaryName,
IngestDocument document,
boolean published)
Process
document according to dictionaryName . |
void |
publishDictionary(String dictionaryName)
Publish the most recently compiled binary dictionary identified by
dictionaryName . |
void |
updateDictionary(TriggerDictionaryInfo info)
Update the metadata for a
trigger dictionary. |
void |
updateTrigger(String dictionaryName,
TriggerDefinition trigger)
Update
trigger for the dictionary identified by dictionaryName . |
TriggerDictionaryInfo getDictionary(String dictionaryName) throws AttivioException
TriggerDictionaryInfo
by dictionaryName
.
Returns null
if a trigger dictionary with dictionaryName
does not exist.
AttivioException
Iterable<TriggerDictionaryInfo> getDictionaries(String prefix, int offset, int rows) throws AttivioException
Dictionaries will be returned ordered by name
.
If prefix
is specified, the result will be filtered to only include dictionaries whose
name
starts with prefix
.
AttivioException
void createDictionary(TriggerDictionaryInfo info) throws AttivioException
trigger
dictionary.
This dictionary will not be available to transformers/components until
compileDictionary(String)
and publishDictionary(String)
has been called for this dictionary.
AttivioException
void updateDictionary(TriggerDictionaryInfo info) throws AttivioException
trigger
dictionary.
The changes to this dictionary will not be available to transformers/components until
compileDictionary(String)
and publishDictionary(String)
has been called for this dictionary.
AttivioException
void deleteDictionary(String dictionaryName) throws AttivioException
trigger
dictionary identified by dictionaryName
.AttivioException
void compileDictionary(String dictionaryName) throws AttivioException
dictionaryName
into binary format.AttivioException
void publishDictionary(String dictionaryName) throws AttivioException
dictionaryName
.
Upon successful completion of this method, all transformers/components will start using the newly published version of this dictionary.
AttivioException
void copyDictionary(String dictionaryName, String newName) throws AttivioException
dictionaryName
to a new dictionary with newName
.
NOTE: the newly created copy will not be available to transformers/components until compileDictionary(String)
and
publishDictionary(String)
are called for the new dictionary.
AttivioException
TriggerDefinition getTrigger(String dictionaryName, String triggerName) throws AttivioException
AttivioException
- if dictionary does not exist, or trigger does not exist.void createTrigger(String dictionaryName, TriggerDefinition trigger) throws AttivioException
trigger
to the dictionary identified by dictionaryName
.
If the dictionary already contains a trigger with the same name
, an exception will be thrown.
This new trigger will not be available to transformers/components until
compileDictionary(String)
and publishDictionary(String)
has been called for dictionaryName
.
AttivioException
void updateTrigger(String dictionaryName, TriggerDefinition trigger) throws AttivioException
trigger
for the dictionary identified by dictionaryName
.
If the dictionary does not contain a trigger with the name
specified, an exception will be thrown.
NOTE: you cannot change the name
of a trigger. In order to rename a trigger, you must first call
createTrigger(String, TriggerDefinition)
with the new trigger, and upon success, call deleteTrigger(String, String)
for the previous trigger.
Updates to this trigger will not be available to transformers/components until
compileDictionary(String)
and publishDictionary(String)
has been called for dictionaryName
.
AttivioException
void deleteTrigger(String dictionaryName, String triggerName) throws AttivioException
triggerName
for the dictionary identified by dictionaryName
.
This trigger will continue to be available to transformers/components until
compileDictionary(String)
and publishDictionary(String)
has been called for dictionaryName
, assuming this trigger has been published previously.
AttivioException
Map<Locale,Long> getLocales(String dictionaryName, String prefix) throws AttivioException
dictionaryName
.
The value for the map will contain the number of triggers in the dictionary specified for the locale.
If prefix
is specified, this will be used to filter the matching triggers to only include
triggers with a name
that starts with prefix
.
AttivioException
Iterable<TriggerDefinition> getTriggers(String dictionaryName, Locale locale, String prefix, int offset, int rows) throws AttivioException
dictionaryName
.
Returned triggers will be ordered according to name
.
If locale
is specified, the result will be filtered to only include triggers for the specified locale
.
If prefix
is specified, the result will be filtered to only include triggers whose
name
starts with prefix
.
AttivioException
void exportDictionary(String dictionaryName, OutputStream output) throws AttivioException
name
to output
.
Dictionary will be output in XML format.
.Triggers will be output in order according to name
.
NOTE: this export will also include any changes not yet compiled
or
published
.
AttivioException
void importDictionary(InputStream input, String newName, boolean replace) throws AttivioException
input
.
Dictionary must be in XML format as output from exportDictionary(String, OutputStream)
.
If newName
is specified, the imported dictionary will be imported with this name instead of the name stored in the export.
If replace
is true
, this import will overwrite any existing dictionary.
NOTE: the imported dictionary will not be available to transformers/components until compileDictionary(String)
and
publishDictionary(String)
are called for the new dictionary.
AttivioException
@Deprecated void importDictionary(byte[] input, String newName, boolean replace) throws AttivioException
input
bytes.
Dictionary must be in XML format as output from exportDictionary(String, OutputStream)
.
If newName
is specified, the imported dictionary will be imported with this name instead of the name stored in the export.
If replace
is true
, this import will overwrite any existing dictionary.
NOTE: the imported dictionary will not be available to transformers/components until compileDictionary(String)
and
publishDictionary(String)
are called for the new dictionary.
AttivioException
IngestDocument process(String dictionaryName, IngestDocument document, boolean published) throws AttivioException
document
according to dictionaryName
.dictionaryName
- the name of the dictionary to use for processingdocument
- the document to process.published
- if true
the most recently published dictionary will be used for processing,
if false
the most recently compiled dictionary will be used for processing.AttivioException
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.