public class FeedConfig<V,T,F extends FeedConfig<V,T,F>>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static AttributeSensor<java.lang.Void> |
NO_SENSOR
Indicates that no sensor is being used here.
|
static java.lang.Object |
REMOVE
The onSuccess or onError functions can return this value to indicate that the sensor value should be removed
(cf 'null', but useful in dynamic situations)
|
static java.lang.Object |
UNCHANGED
The onSuccess or onError functions can return this value to indicate that the sensor should not change.
|
static java.lang.Object |
UNSET
Deprecated.
since 0.7.0 use UNCHANGED
|
Constructor and Description |
---|
FeedConfig(AttributeSensor<T> sensor) |
FeedConfig(FeedConfig<V,T,F> other) |
Modifier and Type | Method and Description |
---|---|
F |
checkSuccess(com.google.common.base.Function<? super V,java.lang.Boolean> val)
|
F |
checkSuccess(com.google.common.base.Predicate<? super V> val)
sets the predicate used to check whether a feed run is successful
|
com.google.common.base.Predicate<? super V> |
getCheckSuccess() |
com.google.common.base.Function<? super java.lang.Exception,T> |
getOnException() |
com.google.common.base.Function<? super V,T> |
getOnFailure() |
com.google.common.base.Function<? super V,T> |
getOnSuccess() |
AttributeSensor<T> |
getSensor() |
boolean |
hasCheckSuccessHandler() |
boolean |
hasExceptionHandler() |
boolean |
hasFailureHandler() |
boolean |
hasSuccessHandler() |
F |
onException(com.google.common.base.Function<? super java.lang.Exception,T> val)
an exception is when there is an error in the communication
|
F |
onFailure(com.google.common.base.Function<? super V,T> val)
a failure is when the connection is fine (no exception) but the other end returns a result object V
which the feed can tell indicates a failure (e.g.
|
F |
onFailureOrException(com.google.common.base.Function<java.lang.Object,T> val)
convenience for indicating a behaviour to occur for both
onException(Function)
(error connecting) and
onFailure(Function)
(successful communication but failure report from remote end) |
F |
onResult(com.google.common.base.Function<? super V,T> val)
registers a callback to be used
onSuccess(Function) and onFailure(Function) ,
i.e. |
F |
onSuccess(com.google.common.base.Function<? super V,T> val) |
F |
setOnException(T val) |
F |
setOnFailure(T val) |
F |
setOnFailureOrException(T val) |
F |
setOnResult(T val) |
F |
setOnSuccess(T val) |
public static final java.lang.Object UNSET
public static final java.lang.Object UNCHANGED
public static final java.lang.Object REMOVE
public static final AttributeSensor<java.lang.Void> NO_SENSOR
See HttpPollConfig.forMultiple()
and its usages.
(It can work for any poll config, but conveniences have not been supplied for others.)
public FeedConfig(AttributeSensor<T> sensor)
public FeedConfig(FeedConfig<V,T,F> other)
public AttributeSensor<T> getSensor()
public com.google.common.base.Predicate<? super V> getCheckSuccess()
public com.google.common.base.Function<? super java.lang.Exception,T> getOnException()
public F checkSuccess(com.google.common.base.Predicate<? super V> val)
public F checkSuccess(com.google.common.base.Function<? super V,java.lang.Boolean> val)
public F onFailure(com.google.common.base.Function<? super V,T> val)
public F onResult(com.google.common.base.Function<? super V,T> val)
onSuccess(Function)
and onFailure(Function)
,
i.e. whenever a result comes back, but not in case of exceptions being thrown (ie problems communicating)public F onException(com.google.common.base.Function<? super java.lang.Exception,T> val)
public F onFailureOrException(com.google.common.base.Function<java.lang.Object,T> val)
onException(Function)
(error connecting) and
onFailure(Function)
(successful communication but failure report from remote end)public boolean hasSuccessHandler()
public boolean hasFailureHandler()
public boolean hasExceptionHandler()
public boolean hasCheckSuccessHandler()