public class GroupConditionsInfo extends Object
A group-level condition uses dataId tokens for the dataIds defined in the condition. The group members
must then replace the tokens with actual dataIds. For example, we may define a group ThresholdCondition like
( $SystemLoad$ > 80 ). Each member must then replace $SystemLoad$ with the actual system load dataId for that
member. See setDataIdMemberMap(Map) for details on how to construct the map supplying the
dataId substitutions.
| Constructor and Description |
|---|
GroupConditionsInfo() |
GroupConditionsInfo(Collection<Condition> conditions,
Map<String,Map<String,String>> dataIdMemberMap) |
GroupConditionsInfo(Condition condition,
Map<String,Map<String,String>> dataIdMemberMap)
Convenience constructor for single-condition group trigger.
|
| Modifier and Type | Method and Description |
|---|---|
Collection<Condition> |
getConditions() |
Map<String,Map<String,String>> |
getDataIdMemberMap() |
void |
setConditions(Collection<Condition> conditions) |
void |
setDataIdMemberMap(Map<String,Map<String,String>> dataIdMemberMap)
The
dataIdMemberMap is a map of the dataId tokens in the group conditions to the actual dataIds
used for the current member triggers. |
String |
toString() |
public GroupConditionsInfo()
public GroupConditionsInfo(Condition condition, Map<String,Map<String,String>> dataIdMemberMap)
condition - The single condition for this group trigger.dataIdMemberMap - The dataIdMemberMap. Can be empty if no member triggers exist for the group.#setDataIdMemberMap(Map)}public GroupConditionsInfo(Collection<Condition> conditions, Map<String,Map<String,String>> dataIdMemberMap)
condition - The conditions for this group trigger.dataIdMemberMap - The dataIdMemberMap. Can be empty if no member triggers exist for the group.#setDataIdMemberMap(Map)}public Collection<Condition> getConditions()
public void setConditions(Collection<Condition> conditions)
conditions - the conditions to be added to the group trigger. To maintain ordering use a
Collection implementation that supports ordering (e.g. List).public void setDataIdMemberMap(Map<String,Map<String,String>> dataIdMemberMap)
dataIdMemberMap is a map of the dataId tokens in the group conditions to the actual dataIds
used for the current member triggers. Because most condition types have only one dataId the map will
typically have 1 entry per condition. But because a condition could have multiple dataIds (e.g CompareCondition
has data1Id and data2Id), it may have more entries that conditions. The inner map maps member triggerIds to
the dataId to be used for that member trigger for the given token. It should have 1 entry for each
member trigger. For example, let's define a group trigger with two conditions:
ThresholdCondition( $SystemLoad$ > 80 )
ThresholdCondition( $HeapUsed$ > 70 )
{[key = "$SystemLoad$",
value = {[key = "Member1",
value = "Member1SystemLoad"],
[key - "Member2",
value = "Member2SystemLoad"]
}
],
[key = "$HeapUsed$",
value = {[key = "Member1",
value = "Member1HeapUsed"],
[key - "Member2",
value = "Member2HeapUsed"]
}
]
}
So, in the example the actual $SystemLoad$ dataIds would be Member1SystemLoad and
Member2SystemLoad. With this Map we can now add the group-level conditions and also the
two member-level conditions to each member.
ExternalCondition.expression will automatically have the
same token replacement performed. So, all occurrences of the dataId token found in the expression, will be
replaced with the mapping. This allows the expression of a group external condition to be automatically
customized to the member.
dataIdMemberMap - the dataID mappings to be used for the existing member triggers. Can be empty if the
group has no existing members.Copyright © 2015–2017 Red Hat, Inc.. All rights reserved.