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,
Mode triggerMode,
Condition condition)
Deprecated.
|
Dampening |
addDampening(String tenantId,
Dampening dampening)
Add the
Dampening. |
Dampening |
addGroupDampening(String tenantId,
Dampening groupDampening)
Add the
Dampening. |
void |
addGroupTrigger(String tenantId,
Trigger groupTrigger)
Create a new Group
Trigger. |
Trigger |
addMemberTrigger(String tenantId,
String groupId,
String memberId,
String memberName,
Map<String,String> memberContext,
Map<String,String> dataIdMap)
Generate a member trigger for the specified group trigger.
|
void |
addTrigger(String tenantId,
Trigger trigger)
Create a new
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 name,
String value)
Get all stored Triggers for all Tenants with a specific Tag.
|
Condition |
getCondition(String tenantId,
String conditionId)
Deprecated.
|
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
|
Collection<Trigger> |
getMemberTriggers(String tenantId,
String groupId,
boolean includeOrphans)
Get the member triggers for the specified group trigger.
|
Trigger |
getTrigger(String tenantId,
String triggerId)
Get a stored Trigger for a specific Tenant.
|
Collection<Condition> |
getTriggerConditions(String tenantId,
String triggerId,
Mode triggerMode) |
Collection<Dampening> |
getTriggerDampenings(String tenantId,
String triggerId,
Mode triggerMode) |
Page<Trigger> |
getTriggers(String tenantId,
TriggersCriteria criteria,
Pager pager) |
Trigger |
orphanMemberTrigger(String tenantId,
String memberId)
Orphan a member trigger.
|
void |
registerListener(DefinitionsListener listener,
DefinitionsEvent.Type eventType,
DefinitionsEvent.Type... 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)
Deprecated.
|
void |
removeDampening(String tenantId,
String dampeningId)
Remove the specified
Dampening from the relevant trigger. |
void |
removeGroupDampening(String tenantId,
String groupDampeningId)
Remove the specified
Dampening from the relevant group trigger. |
void |
removeGroupTrigger(String tenantId,
String groupId,
boolean keepNonOrphans,
boolean keepOrphans)
The group
Trigger will be removed from the Alerts engine, as needed, and will no longer be
persisted. |
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,
Mode triggerMode,
Collection<Condition> conditions)
The condition set for a trigger's trigger mode is treated as a whole.
|
Collection<Condition> |
setGroupConditions(String tenantId,
String groupId,
Mode triggerMode,
Collection<Condition> groupConditions,
Map<String,Map<String,String>> dataIdMemberMap)
The condition set for the specified Group Trigger and trigger mode.
|
Trigger |
unorphanMemberTrigger(String tenantId,
String memberId,
Map<String,String> memberContext,
Map<String,String> dataIdMap)
Un-orphan a member trigger.
|
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)
Deprecated.
|
Dampening |
updateDampening(String tenantId,
Dampening dampening)
Update the
Dampening on the relevant trigger. |
Dampening |
updateGroupDampening(String tenantId,
Dampening groupDampening)
Update the
Dampening on the relevant group trigger. |
Trigger |
updateGroupTrigger(String tenantId,
Trigger groupTrigger)
Update the group
Trigger. |
Trigger |
updateTrigger(String tenantId,
Trigger trigger)
Update the
Trigger. |
void addTrigger(String tenantId, Trigger trigger) throws Exception
Trigger. Conditions and Dampening 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.
A non-group trigger can never be made into a group trigger, and vice-versa.
tenantId - Tenant where trigger is createdtrigger - New trigger definition to be addedException - If the Trigger already exists.#addGroupTrigger(String, Trigger)} for adding a group trigger.void addGroupTrigger(String tenantId, Trigger groupTrigger) throws Exception
Trigger. Conditions and Dampening are
manipulated in separate calls. The new Group Trigger will be persisted. When fully
defined a call to updateGroupTrigger(String, Trigger) is needed to enable the Trigger.
A non-group trigger can never be made into a group trigger, and vice-versa.
tenantId - Tenant where trigger is createdgroupTrigger - New trigger definition to be addedException - If the Trigger already exists.#addTrigger(String, Trigger)} for adding a non-group trigger.Trigger addMemberTrigger(String tenantId, String groupId, String memberId, String memberName, Map<String,String> memberContext, Map<String,String> dataIdMap) throws Exception
org.hawkular.alerts.api.json.MemberTrigger#setDataIdMap(Map) for an example of the
dataIdMap parameter. The member trigger gets the enabled state of the group.tenantId - Tenant where trigger is storedgroupId - Group triggerId from which to spawn the member triggermemberId - The member triggerId, unique id within the tenant, if null an Id will be generatedmemberName - The member triggerName, not null, unique name within the tenantmemberContext - The member triggerContext. If null the context is inherited from the group triggerdataIdMap - Tokens to be replaced in the new triggerException - on any problem#addTrigger(String, Trigger)} for adding a non-group trigger.,
#addGroupTrigger(String, Trigger)} for adding a group trigger.,
org.hawkular.alerts.api.json.MemberTrigger#setDataIdMap(Map)} for an example of the
dataIdMap parameter.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 removedNotFoundException - if trigger is not foundException - on any problem#removeGroupTrigger(String, String, boolean, boolean)} for removing a group trigger and its members.void removeGroupTrigger(String tenantId, String groupId, boolean keepNonOrphans, boolean keepOrphans) throws Exception
Trigger will be removed from the Alerts engine, as needed, and will no longer be
persisted. The member triggers will be removed as well, depending on the settings for
keepNonOrphans and keepOrphans. Note that any member triggers not removed will
no longer have a group trigger associated and will then need to be managed independently.tenantId - Tenant where trigger is storedgroupId - Group Trigger to be removed.keepNonOrphans - If true the non-orphan member are maintained and made independent.keepOrphans - If true the orphan member triggers are maintained and made independent.NotFoundException - if trigger is not foundException - on any problem#removeTrigger(String, String)} for removing a non-group triggerTrigger updateTrigger(String tenantId, Trigger trigger) throws Exception
Trigger. Conditions and Dampening 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 updatedNotFoundException - if trigger is not foundException - on any problem#updateGroupTrigger(String, Trigger)} for updating a group triggerTrigger updateGroupTrigger(String tenantId, Trigger groupTrigger) throws Exception
Trigger. Conditions and Dampening 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.
The group's non-orphan member triggers will be similarly updated.
tenantId - Tenant where trigger is updatedgroupTrigger - Existing trigger to be updatedNotFoundException - if trigger is not foundException - on any problem#updateTrigger(String, Trigger)} for updating a non-group trigger.Trigger getTrigger(String tenantId, String triggerId) throws Exception
tenantId - Tenant where trigger is storedtriggerId - Given trigger to be retrievedException - on any problemPage<Trigger> getTriggers(String tenantId, TriggersCriteria criteria, Pager pager) throws Exception
tenantId - Tenant where triggers are storedcriteria - If null returns all triggers for the tenant (not recommended)pager - Paging requirement for fetching triggers. Optional. Return all if null.Exception - any problemCollection<Trigger> getMemberTriggers(String tenantId, String groupId, boolean includeOrphans) throws Exception
tenantId - Tenant for the group triggergroupId - Group triggerIdincludeOrphans - if true, include orphan triggers for the groupException - on any problemCollection<Trigger> getAllTriggers() throws Exception
Exception - on any problemCollection<Trigger> getAllTriggersByTag(String name, String value) throws Exception
name - The tag name, not null.value - The tag value, not null. Set to '*' to match all values for the name.Exception - on any problemTrigger orphanMemberTrigger(String tenantId, String memberId) throws Exception
unorphanMemberTrigger(String, String, Map, Map).tenantId - Tenant where trigger is storedmemberId - The member triggerIdNotFoundException - if trigger is not foundException#unorphanMemberTrigger(String, String, Map, Map)} to again have the trigger be a full group member.Trigger unorphanMemberTrigger(String tenantId, String memberId, Map<String,String> memberContext, Map<String,String> dataIdMap) throws Exception
org.hawkular.alerts.api.json.MemberTrigger#setDataIdMap(Map) for an example
of setting the dataIdMap.
This is basically a convenience method that first performs a removeTrigger(String, String) and
then an addMemberTrigger(String, String, String, String, Map, Map). But the member trigger must
already exist for this call to succeed. The trigger will maintain the same group, id, and name.
tenantId - Tenant where trigger is storedmemberId - The member triggerIdmemberContext - The member triggerContext. If null the context is inherited from the member triggerdataIdMap - Tokens to be replaced in the new triggerNotFoundException - if trigger is not foundException#orphanMemberTrigger(String, String)} for setting a member to be an orphan.,
org.hawkular.alerts.api.json.MemberTrigger#setDataIdMap(Map)} for an example
of setting the dataIdMap.Dampening addDampening(String tenantId, Dampening dampening) throws Exception
Dampening. The relevant triggerId is specified in the Dampening object.tenantId - the owning tenantdampening - the Dampening definition, which should be tied to a triggerException#addGroupDampening(String, Dampening)} for adding group-level dampeningDampening addGroupDampening(String tenantId, Dampening groupDampening) throws Exception
Dampening. The relevant triggerId is specified in the Dampening object.
The group's non-orphan member triggers will be similarly updated.
tenantId - the owning tenantgroupDampening - the Dampening definition, which should be tied to a triggerException#addDampening(String, Dampening)} for adding non-group dampening.void removeDampening(String tenantId, String dampeningId) throws Exception
Dampening from the relevant trigger.tenantId - the owning tenantdampeningId - the doomed dampening recordException#removeGroupDampening(String, String)} for removing group-level dampening.void removeGroupDampening(String tenantId, String groupDampeningId) throws Exception
Dampening from the relevant group trigger.
The group's non-orphan member triggers will be similarly updated.
tenantId - the owning tenantgroupDampeningId - the doomed dampening record for the group triggerException#removeDampening(String, String)} for removing non-group dampening.Dampening updateDampening(String tenantId, Dampening dampening) throws Exception
Dampening on the relevant trigger.tenantId - the owning tenantdampening - the Dampening definition, which should be tied to a triggerException#updateGroupDampening(String, Dampening)} for group-level dampening.Dampening updateGroupDampening(String tenantId, Dampening groupDampening) throws Exception
Dampening on the relevant group trigger.
The group's non-orphan member triggers will be similarly updated.
tenantId - the owning tenantgroupDampening - the Dampening definition, which should be tied to a group triggerException#updateDampening(String, Dampening)} for non-group dampening.Dampening getDampening(String tenantId, String dampeningId) throws Exception
ExceptionCollection<Dampening> getTriggerDampenings(String tenantId, String triggerId, 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 problem@Deprecated Collection<Condition> addCondition(String tenantId, String triggerId, Mode triggerMode, Condition condition) throws Exception
setConditions(String, String, Mode, Collection)IMPORTANT! Add/Delete/Update of a condition effectively replaces the condition set for the trigger. The new condition set is returned. Clients code should then use the new condition set as ConditionIds may have changed!
The following Condition fields are ignored for the incoming condition, and set in the returned collection set:conditionId triggerId triggerMode conditionSetSize conditionSetIndex
tenantId - Tenant where trigger is storedtriggerId - Trigger where condition will be storedtriggerMode - Mode where condition is appliedcondition - Not nullNotFoundException - if trigger is not foundException - on any problem#addGroupCondition(String, String, Mode, Condition, Map)} for group-level conditions.@Deprecated Collection<Condition> removeCondition(String tenantId, String conditionId) throws Exception
setConditions(String, String, Mode, Collection)IMPORTANT! Add/Delete/Update of a condition effectively replaces the condition set for the trigger. The new condition set is returned. Clients code should then use the new condition set as ConditionIds may have changed!
tenantId - Tenant where trigger and his conditions are storedconditionId - Condition id to be removedException - on any problem#removeGroupCondition(String, String)} for group-level conditions.@Deprecated Collection<Condition> updateCondition(String tenantId, Condition condition) throws Exception
setConditions(String, String, Mode, Collection)IMPORTANT! Add/Delete/Update of a condition effectively replaces the condition set for the trigger. The new condition set is returned. Clients code should then use the new condition set as ConditionIds may have changed!
tenantId - condition - Not null. conditionId must be for an existing condition.Exception - on any problem#updateGroupCondition(String, Condition)} for group-level conditions.Collection<Condition> setConditions(String tenantId, String triggerId, Mode triggerMode, Collection<Condition> conditions) throws Exception
IMPORTANT! Add/Delete/Update of a condition effectively replaces the condition set for the trigger. The new condition set is returned. Clients code should then use the new condition set as ConditionIds may have changed!
The following Condition fields are ignored for the incoming conditions, and set in the returned collection:conditionId triggerId triggerMode conditionSetSize conditionSetIndex
Note that due to the complexity of adding group-level conditions, it is only supported to
add or remove a single group condition at one time. So there is no setGroupConditions.
Instead, use #addGroupCondition(String, String, Mode, Condition, Map) and
#removeGroupCondition(String, String) as needed.
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 problem#removeGroupCondition(String, String)} to remove a group condition.,
#addGroupCondition(String, String, Mode, Condition, Map)} to add a group condition.Collection<Condition> setGroupConditions(String tenantId, String groupId, Mode triggerMode, Collection<Condition> groupConditions, Map<String,Map<String,String>> dataIdMemberMap) throws Exception
org.hawkular.alerts.api.json.GroupConditions#setDataIdMemberMap(Map) for
an example of the dataIdMemberMap parameter. The following Condition fields are ignored for
the incoming conditions, and set in the returned collection set:
conditionId triggerId triggerMode conditionSetSize conditionSetIndex
tenantId - Tenant where trigger is storedgroupId - Group Trigger adding the condition and whose non-orphan members will also have it added.triggerMode - Mode where condition is appliedgroupCondition - Not null, the condition to adddataIdMemberMap - see above for details.NotFoundException - if trigger is not foundException - on any problem#addCondition(String, String, Mode, Condition)} for non-group conditions.,
org.hawkular.alerts.api.json.MemberCondition#setDataIdMemberMap(Map)} for an example of the
dataIdMemberMap parameter.@Deprecated Condition getCondition(String tenantId, String conditionId) throws Exception
ExceptionCollection<Condition> getTriggerConditions(String tenantId, String triggerId, 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 registerListener(DefinitionsListener listener, DefinitionsEvent.Type eventType, DefinitionsEvent.Type... eventTypes)
Copyright © 2015 Red Hat, Inc.. All rights reserved.