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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Probe createProbe(Logger logger, ProgressLoggerFactory progressLoggerFactory, Function1<Unit, Unit> onSuccess, Function1<Unit, Unit> onFailure) Creates the described Probe.
      abstract Duration getRetryInterval() Interval between two attempts.
      abstract Duration getRetryTimeout() Total time after which probing is given up.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 task
        progressLoggerFactory - progress logger factory injected into the executing task
        onSuccess - called once after the probe succeeded, not per attempt
        onFailure - called once after the probe gave up, not per attempt
        Returns:

        the probe to execute