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.
|
Constructor and Description |
---|
FeedConfig(AttributeSensor<T> sensor) |
FeedConfig(FeedConfig<V,T,F> other) |
Modifier and Type | Method and Description |
---|---|
F |
checkSuccess(<any> val)
sets the predicate used to check whether a feed run is successful
|
F |
checkSuccess(<any> val)
as
#checkSuccess(Predicate) |
F |
enabled(boolean val)
Whether this feed is enabled (defaulting to true).
|
boolean |
equals(java.lang.Object obj) |
<any> |
getCheckSuccess() |
Duration |
getLogWarningGraceTime() |
Duration |
getLogWarningGraceTimeOnStartup() |
<any> |
getOnException() |
<any> |
getOnFailure() |
<any> |
getOnSuccess() |
AttributeSensor<T> |
getSensor() |
boolean |
getSupressDuplicates() |
boolean |
hasCheckSuccessHandler() |
boolean |
hasExceptionHandler() |
boolean |
hasFailureHandler() |
int |
hashCode() |
boolean |
hasSuccessHandler() |
boolean |
isEnabled() |
F |
logWarningGraceTime(Duration val) |
F |
logWarningGraceTimeOnStartup(Duration val) |
F |
onException(<any> val)
An exception is when there is an error in the communication
|
F |
onFailure(<any> 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(<any> val)
A 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(<any> val)
Registers a callback to be used by
#onSuccess(Function) and #onFailure(Function) ,
i.e. |
F |
onSuccess(<any> val) |
F |
setOnException(T val) |
F |
setOnFailure(T val) |
F |
setOnFailureOrException(T val) |
F |
setOnResult(T val) |
F |
setOnSuccess(T val) |
F |
suppressDuplicates(boolean val) |
java.lang.String |
toString() |
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 <any> getCheckSuccess()
public <any> getOnSuccess()
public <any> getOnFailure()
public <any> getOnException()
public boolean getSupressDuplicates()
public boolean isEnabled()
public F checkSuccess(<any> val)
public F checkSuccess(<any> val)
#checkSuccess(Predicate)
public F onSuccess(<any> val)
public F onFailure(<any> val)
public F onResult(<any> 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(<any> val)
public F onFailureOrException(<any> val)
#onException(Function)
(error connecting) and #onFailure(Function)
(successful communication but failure
report from remote end)public F setOnFailureOrException(T val)
#onFailureOrException(Function)
public F suppressDuplicates(boolean val)
public Duration getLogWarningGraceTimeOnStartup()
public Duration getLogWarningGraceTime()
public F enabled(boolean val)
public boolean hasSuccessHandler()
public boolean hasFailureHandler()
public boolean hasExceptionHandler()
public boolean hasCheckSuccessHandler()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object