Package com.intershop.gradle.icm.utils
Interface ProbeSpec
-
- All Implemented Interfaces:
-
java.io.Serializable
public interface ProbeSpec implements Serializable
Description of a Probe in plain values.
A Probe is behaviour: it carries an HTTP client, a logger and the factory of the progress logger, none of which can be stored by Gradle. A task therefore keeps the description of its probes - which is Serializable, has value semantics and is a valid task input - and turns it into a Probe with createProbe while it executes.
-
-
Method Summary
Modifier and Type Method Description abstract ProbecreateProbe(Logger logger, ProgressLoggerFactory progressLoggerFactory, Function1<Unit, Unit> onSuccess, Function1<Unit, Unit> onFailure)Creates the described Probe. abstract DurationgetRetryInterval()Interval between two attempts. abstract DurationgetRetryTimeout()Total time after which probing is given up. -
-
Method Detail
-
createProbe
abstract Probe createProbe(Logger logger, ProgressLoggerFactory progressLoggerFactory, Function1<Unit, Unit> onSuccess, Function1<Unit, Unit> onFailure)
Creates the described Probe.
The callbacks are parameters rather than properties of the description on purpose: they are behaviour, they close over the state of the executing task and they are not Serializable, so keeping them in the description would make it unusable as a task input.
- Parameters:
logger- logger of the executing taskprogressLoggerFactory- progress logger factory injected into the executing taskonSuccess- called once after the probe succeeded, not per attemptonFailure- called once after the probe gave up, not per attempt- Returns:
the probe to execute
-
getRetryInterval
abstract Duration getRetryInterval()
Interval between two attempts.
-
getRetryTimeout
abstract Duration getRetryTimeout()
Total time after which probing is given up.
-
-
-
-