Interface Probe

  • All Implemented Interfaces:

    
    public interface Probe
    
                        

    Defines a probe: execute a certain action in a defines retry interval until it is a success or the retry timeout is reached.

    • 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 Boolean execute() Executes this probe
      abstract Probe withRetryInterval(Duration interval) Sets the retry interval
      abstract Probe withRetryTimeout(Duration timeout) Sets the retry timeout
      abstract Probe onSuccess(Function1<Unit, Unit> onSuccess) Assigns a callback that is executed when this Probe finishes with a success.
      abstract Probe onFailure(Function1<Unit, Unit> onFailure) Assigns a callback that is executed when this Probe finishes with a failure.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • execute

         abstract Boolean execute()

        Executes this probe

        Returns:

        true on success otherwise false

      • onSuccess

         abstract Probe onSuccess(Function1<Unit, Unit> onSuccess)

        Assigns a callback that is executed when this Probe finishes with a success. The callback is not called for each internal retry attempt.

      • onFailure

         abstract Probe onFailure(Function1<Unit, Unit> onFailure)

        Assigns a callback that is executed when this Probe finishes with a failure. The callback is not called for each internal retry attempt.