Class TimerTrigger

java.lang.Object
com.arpnetworking.utility.TimerTrigger
All Implemented Interfaces:
Trigger

public class TimerTrigger extends Object implements Trigger
A Trigger that waits a set amount of time then fires.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot io)
  • Constructor Details

    • TimerTrigger

      public TimerTrigger(Duration duration)
      Public constructor.
      Parameters:
      duration - Wait time
  • Method Details

    • waitOnReadTrigger

      public void waitOnReadTrigger() throws InterruptedException
      Description copied from interface: Trigger
      Blocks the current thread.
      Specified by:
      waitOnReadTrigger in interface Trigger
      Throws:
      InterruptedException - thrown when the wait is interrupted.
    • waitOnFileNotFoundTrigger

      public void waitOnFileNotFoundTrigger(int attempt) throws InterruptedException
      Description copied from interface: Trigger
      Blocks the current thread.
      Specified by:
      waitOnFileNotFoundTrigger in interface Trigger
      Parameters:
      attempt - The attempt number to open or find the file. Used for exponential backoff.
      Throws:
      InterruptedException - thrown when the wait is interrupted.
    • toLogValue

      public Object toLogValue()
      Generate a Steno log compatible representation.
      Returns:
      Steno log compatible representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object