public class CommandPollConfig<T> extends PollConfig<SshPollValue,T,CommandPollConfig<T>>
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Predicate<SshPollValue> |
DEFAULT_SUCCESS |
NO_SENSOR, REMOVE, UNCHANGED, UNSET
Constructor and Description |
---|
CommandPollConfig(AttributeSensor<T> sensor) |
CommandPollConfig(CommandPollConfig<T> other) |
Modifier and Type | Method and Description |
---|---|
CommandPollConfig<T> |
command(java.lang.String val) |
CommandPollConfig<T> |
command(com.google.common.base.Supplier<java.lang.String> val) |
CommandPollConfig<T> |
env(java.util.Map<java.lang.String,java.lang.String> val)
add the given env params; sequence is as per
env(Supplier) . |
CommandPollConfig<T> |
env(java.lang.String key,
java.lang.String val)
add the given env param; sequence is as per
env(Supplier) |
CommandPollConfig<T> |
env(com.google.common.base.Supplier<java.util.Map<java.lang.String,java.lang.String>> val)
adds the given dynamic supplier of environment variables.
|
static CommandPollConfig<java.lang.Void> |
forMultiple() |
static <T> CommandPollConfig<T> |
forSensor(AttributeSensor<T> sensor) |
java.lang.String |
getCommand()
Deprecated.
since 0.7.0; use
getCommandSupplier() and resolve just-in-time |
com.google.common.base.Supplier<java.lang.String> |
getCommandSupplier() |
java.util.Map<java.lang.String,java.lang.String> |
getEnv()
Deprecated.
since 0.7.0; use
getEnvSupplier() and resolve just-in-time |
com.google.common.base.Supplier<java.util.Map<java.lang.String,java.lang.String>> |
getEnvSupplier() |
description, getDescription, getPeriod, period, period, period
checkSuccess, checkSuccess, enabled, equals, getCheckSuccess, getOnException, getOnFailure, getOnSuccess, getSensor, getSupressDuplicates, hasCheckSuccessHandler, hasExceptionHandler, hasFailureHandler, hashCode, hasSuccessHandler, isEnabled, onException, onFailure, onFailureOrException, onResult, onSuccess, setOnException, setOnFailure, setOnFailureOrException, setOnResult, setOnSuccess, suppressDuplicates, toString
public static final com.google.common.base.Predicate<SshPollValue> DEFAULT_SUCCESS
public CommandPollConfig(AttributeSensor<T> sensor)
public CommandPollConfig(CommandPollConfig<T> other)
public static <T> CommandPollConfig<T> forSensor(AttributeSensor<T> sensor)
public static CommandPollConfig<java.lang.Void> forMultiple()
@Deprecated public java.lang.String getCommand()
getCommandSupplier()
and resolve just-in-timepublic com.google.common.base.Supplier<java.lang.String> getCommandSupplier()
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getEnv()
getEnvSupplier()
and resolve just-in-timepublic com.google.common.base.Supplier<java.util.Map<java.lang.String,java.lang.String>> getEnvSupplier()
public CommandPollConfig<T> command(java.lang.String val)
public CommandPollConfig<T> command(com.google.common.base.Supplier<java.lang.String> val)
public CommandPollConfig<T> env(java.lang.String key, java.lang.String val)
env(Supplier)
public CommandPollConfig<T> env(java.util.Map<java.lang.String,java.lang.String> val)
env(Supplier)
.
behaviour is undefined if the map supplied here is subsequently changed.
if a map's contents might change, use env(Supplier)
public CommandPollConfig<T> env(com.google.common.base.Supplier<java.util.Map<java.lang.String,java.lang.String>> val)
use of a supplier allows env vars to be computed on each execution, for example to take the most recent sensor values.
in the case of multiple map suppliers, static maps, or static env(String, String)
key value pairs, the order in which they are specified here is the order
in which they are computed and applied.