public interface DefinitionsService
| Modifier and Type | Method and Description |
|---|---|
void |
addAction(String tenantId,
String actionPlugin,
String actionId,
Map<String,String> properties)
Create a new Action
|
void |
addActionPlugin(String actionPlugin,
Map<String,String> defaultProperties)
Add a new Plugin into definitions service.
|
void |
addActionPlugin(String actionPlugin,
Set<String> properties)
Add a new Plugin into the definitions service.
|
Collection<Condition> |
addCondition(String tenantId,
String triggerId,
Trigger.Mode triggerMode,
Condition condition)
A convenience method that adds a new Condition to the existing condition set for the specified
Trigger and trigger mode.
|
Dampening |
addDampening(String tenantId,
Dampening dampening) |
void |
addTag(String tenantId,
Tag tag)
Add Tag to the specified Trigger (tenantId+triggerid).
|
void |
addTrigger(String tenantId,
Trigger trigger)
Create a new
Trigger. |
Trigger |
copyTrigger(String tenantId,
String triggerId,
Map<String,String> dataIdMap)
Used to generate an explicit Trigger from a Tokenized Trigger.
|
Map<String,String> |
getAction(String tenantId,
String actionPlugin,
String actionId) |
Set<String> |
getActionPlugin(String actionPlugin)
Get list of properties needed to configure an action for a specific plugin
|
Collection<String> |
getActionPlugins()
Get all list of plugins configured on the system.
|
Map<String,Set<String>> |
getActions(String tenantId) |
Collection<String> |
getActions(String tenantId,
String actionPlugin) |
Map<String,Map<String,Set<String>>> |
getAllActions() |
Collection<Condition> |
getAllConditions() |
Collection<Dampening> |
getAllDampenings() |
Collection<Trigger> |
getAllTriggers()
Get all stored Triggers for all Tenants
|
Collection<Trigger> |
getAllTriggersByTag(String category,
String name)
Get all stored Triggers for all Tenants with a specific Tag.
|
Condition |
getCondition(String tenantId,
String conditionId) |
Collection<Condition> |
getConditions(String tenantId) |
Dampening |
getDampening(String tenantId,
String dampeningId) |
Collection<Dampening> |
getDampenings(String tenantId) |
Map<String,String> |
getDefaultActionPlugin(String actionPlugin)
Get a map with the properties needed to configure an action with its default values
|
Trigger |
getTrigger(String tenantId,
String triggerId)
Get a stored Trigger for a specific Tenant.
|
Collection<Condition> |
getTriggerConditions(String tenantId,
String triggerId,
Trigger.Mode triggerMode) |
Collection<Dampening> |
getTriggerDampenings(String tenantId,
String triggerId,
Trigger.Mode triggerMode) |
Collection<Trigger> |
getTriggers(String tenantId)
Get all stored Triggers for a specific Tenant.
|
Collection<Trigger> |
getTriggersByTag(String tenantId,
String category,
String name)
Get all stored Triggers with a specific Tag.
|
List<Tag> |
getTriggerTags(String tenantId,
String triggerId,
String category) |
void |
registerListener(DefinitionsListener listener,
DefinitionsEvent.EventType eventType,
DefinitionsEvent.EventType... eventTypes) |
void |
removeAction(String tenantId,
String actionPlugin,
String actionId) |
void |
removeActionPlugin(String actionPlugin)
Remove an existing Plugin from the definitions service.
|
Collection<Condition> |
removeCondition(String tenantId,
String conditionId)
A convenience method that removes a Condition from an existing condition set.
|
void |
removeDampening(String tenantId,
String dampeningId) |
void |
removeTags(String tenantId,
String triggerId,
String category,
String name)
Delete tag(s) for the specified trigger, optionally filtered by category and/or name.
|
void |
removeTrigger(String tenantId,
String triggerId)
The
Trigger will be removed from the Alerts engine, as needed, and will no longer be persisted. |
Collection<Condition> |
setConditions(String tenantId,
String triggerId,
Trigger.Mode triggerMode,
Collection<Condition> conditions)
The condition set for a trigger's trigger mode is treated as a whole.
|
void |
updateAction(String tenantId,
String actionPlugin,
String actionId,
Map<String,String> properties) |
void |
updateActionPlugin(String actionPlugin,
Map<String,String> defaultProperties)
Update an existing plugin.
|
void |
updateActionPlugin(String actionPlugin,
Set<String> properties)
Update an existing plugin.
|
Collection<Condition> |
updateCondition(String tenantId,
Condition condition)
A convenience method that updates an existing Condition from an existing condition set.
|
Dampening |
updateDampening(String tenantId,
Dampening dampening) |
Trigger |
updateTrigger(String tenantId,
Trigger trigger)
Update the
Trigger. |
void addTrigger(String tenantId, Trigger trigger) throws Exception
Trigger. Conditions and Actions are manipulated in separate
calls. The new Trigger will be persisted. When fully defined a call to
updateTrigger(String, Trigger)
is needed to enable the Trigger.tenantId - Tenant where trigger is createdtrigger - New trigger definition to be addedException - If the Trigger already exists.void removeTrigger(String tenantId, String triggerId) throws Exception
Trigger will be removed from the Alerts engine, as needed, and will no longer be persisted.tenantId - Tenant where trigger is storedtriggerId - Trigger to be removedException - on any problemTrigger updateTrigger(String tenantId, Trigger trigger) throws Exception
Trigger. Conditions and Actions are manipulated in separate
calls. The updated Trigger will be persisted. If enabled the Trigger
will be [re-]inserted into the Alerts engine and any prior dampening will be reset.tenantId - Tenant where trigger is updatedtrigger - Existing trigger to be updatedException - If the Trigger does not exist.Trigger getTrigger(String tenantId, String triggerId) throws Exception
tenantId - Tenant where trigger is storedtriggerId - Given trigger to be retrievedException - on any problemCollection<Trigger> getTriggers(String tenantId) throws Exception
tenantId - Tenant where triggers are storedException - on any problemCollection<Trigger> getTriggersByTag(String tenantId, String category, String name) throws Exception
tenantId - Tenant where trigger is storedcategory - The tag category, if null or empty fetch only by tag namename - The tag name, if null or empty fetch only by tag categoryException - on any problemCollection<Trigger> getAllTriggers() throws Exception
Exception - on any problemCollection<Trigger> getAllTriggersByTag(String category, String name) throws Exception
category - The tag category, if null or empty fetch only by tag namename - The tag name, requiredException - on any problemTrigger copyTrigger(String tenantId, String triggerId, Map<String,String> dataIdMap) throws Exception
tenantId - Tenant where trigger is storedtriggerId - Trigger to be copieddataIdMap - Tokens to be replaced in the new triggerException - on any problemDampening addDampening(String tenantId, Dampening dampening) throws Exception
Exceptionvoid removeDampening(String tenantId, String dampeningId) throws Exception
ExceptionDampening updateDampening(String tenantId, Dampening dampening) throws Exception
ExceptionDampening getDampening(String tenantId, String dampeningId) throws Exception
ExceptionCollection<Dampening> getTriggerDampenings(String tenantId, String triggerId, Trigger.Mode triggerMode) throws Exception
tenantId - Tenant where trigger is storedtriggerId - Given triggertriggerMode - Return only dampenings for the given trigger mode. Return all if null.Exception - on any problemCollection<Dampening> getAllDampenings() throws Exception
Exception - on any problemCollection<Dampening> getDampenings(String tenantId) throws Exception
tenantId - Tenant where dampening are storedException - on any problemCollection<Condition> addCondition(String tenantId, String triggerId, Trigger.Mode triggerMode, Condition condition) throws Exception
conditionId triggerId triggerMode conditionSetSize conditionSetIndex
tenantId - Tenant where trigger is storedtriggerId - Trigger where condition will be storedtriggerMode - Mode where condition is appliedcondition - Not nullException - on any problemCollection<Condition> removeCondition(String tenantId, String conditionId) throws Exception
tenantId - Tenant where trigger and his conditions are storedconditionId - Condition id to be removedException - on any problemCollection<Condition> updateCondition(String tenantId, Condition condition) throws Exception
tenantId - condition - Not null. conditionId must be for an existing condition.Exception - on any problemCollection<Condition> setConditions(String tenantId, String triggerId, Trigger.Mode triggerMode, Collection<Condition> conditions) throws Exception
conditionId triggerId triggerMode conditionSetSize conditionSetIndex
tenantId - Tenant where trigger and his conditions are storedtriggerId - Trigger where conditions will be storedtriggerMode - Mode where conditions are appliedconditions - Not null, Not EmptyException - on any problemCondition getCondition(String tenantId, String conditionId) throws Exception
ExceptionCollection<Condition> getTriggerConditions(String tenantId, String triggerId, Trigger.Mode triggerMode) throws Exception
tenantId - Tenant where trigger and his conditions are storedtriggerId - Trigger where conditions are storedtriggerMode - Return only conditions for the given trigger mode. Return all if null.Exception - on any problemCollection<Condition> getConditions(String tenantId) throws Exception
ExceptionCollection<Condition> getAllConditions() throws Exception
Exceptionvoid addActionPlugin(String actionPlugin, Set<String> properties) throws Exception
actionPlugin - name of the pluginproperties - list of properties to be configured in actions of this plugins typeException - on any problemvoid addActionPlugin(String actionPlugin, Map<String,String> defaultProperties) throws Exception
actionPlugin - name of the plugindefaultProperties - map of properties with its default valuesException - on any problemvoid removeActionPlugin(String actionPlugin) throws Exception
actionPlugin - name of the pluginException - on any problemvoid updateActionPlugin(String actionPlugin, Set<String> properties) throws Exception
actionPlugin - name of the pluginproperties - list of properties to be configured in actions of this plugins typeException - on any problemvoid updateActionPlugin(String actionPlugin, Map<String,String> defaultProperties) throws Exception
actionPlugin - name of the plugindefaultProperties - map of properties with its default valuesException - on any problemCollection<String> getActionPlugins() throws Exception
Exception - on an problemSet<String> getActionPlugin(String actionPlugin) throws Exception
actionPlugin - name of the pluginException - on any problemMap<String,String> getDefaultActionPlugin(String actionPlugin) throws Exception
actionPlugin - name of the pluginException - on any problemvoid addAction(String tenantId, String actionPlugin, String actionId, Map<String,String> properties) throws Exception
tenantId - Tenant where actions are storedactionPlugin - Action plugin where this action is storedactionId - Id of new actionproperties - the properties of the actionException - on any problemvoid removeAction(String tenantId, String actionPlugin, String actionId) throws Exception
Exceptionvoid updateAction(String tenantId, String actionPlugin, String actionId, Map<String,String> properties) throws Exception
ExceptionMap<String,Map<String,Set<String>>> getAllActions() throws Exception
Exception - on any problemMap<String,Set<String>> getActions(String tenantId) throws Exception
tenantId - Tenant where actions are stored.Exception - on any problemCollection<String> getActions(String tenantId, String actionPlugin) throws Exception
ExceptionMap<String,String> getAction(String tenantId, String actionPlugin, String actionId) throws Exception
Exceptionvoid addTag(String tenantId, Tag tag) throws Exception
tenantId - Tenant where tag is createdtag - New tag to be createdException - on any problemvoid removeTags(String tenantId, String triggerId, String category, String name) throws Exception
triggerId - NotEmptycategory - Nullablename - NullableException - on any problemList<Tag> getTriggerTags(String tenantId, String triggerId, String category) throws Exception
tenantId - NotEmpty, must be the proper tenant for the specified trigger.triggerId - NotEmptycategory - Nullable.Exception - on any problemvoid registerListener(DefinitionsListener listener, DefinitionsEvent.EventType eventType, DefinitionsEvent.EventType... eventTypes)
Copyright © 2015 Red Hat, Inc.. All rights reserved.