public class AlertDefinitionCommand extends AgentCommand
AlertDefinitionCommand
class is used to encapsulate the
AlertDefinition
s that will be returned to an agent given a requested
hash.
Commands must have addConfigs(ConfigHelper, Cluster)
invoked before
being sent to the agent so that the definitions will have the required
configuration data when they run. Failure to do this will cause the alerts to
be scheduled and run, but the result will always be a failure since the
parameterized properties they depend on will not be available.AgentCommand.AgentCommandType
Constructor and Description |
---|
AlertDefinitionCommand(String clusterName,
String hostName,
String publicHostName,
String hash,
List<AlertDefinition> definitions)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigs(ConfigHelper configHelper,
Cluster cluster)
Adds cluster configuration properties as required by commands sent to agent.
|
List<AlertDefinition> |
getAlertDefinitions()
Gets the alert definitions
|
String |
getClusterName()
Gets the name of the cluster.
|
AgentCommand.AgentCommandType |
getCommandType() |
String |
getHash()
Gets the global hash for all alert definitions for a given host.
|
String |
getHostName()
Gets the host name.
|
setCommandType, toString
public AlertDefinitionCommand(String clusterName, String hostName, String publicHostName, String hash, List<AlertDefinition> definitions)
clusterName
- the name of the cluster this response is for (hostName
- publicHostName
- hash
- definitions
- AlertDefinitionHash
public AgentCommand.AgentCommandType getCommandType()
getCommandType
in class AgentCommand
public String getHash()
null
).public List<AlertDefinition> getAlertDefinitions()
public String getClusterName()
null
).public String getHostName()
null
).public void addConfigs(ConfigHelper configHelper, Cluster cluster) throws org.apache.ambari.server.AmbariException
configHelper
- the helpercluster
- the cluster, matching the cluster name specified by the commandorg.apache.ambari.server.AmbariException
Copyright © 2022 Apache Software Foundation. All rights reserved.