Class ReaderSchedule


  • public class ReaderSchedule
    extends java.lang.Object

    ReaderSchedule class.

    Version:
    $Id: $
    Author:
    David Hustace
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ReaderSchedule createSchedule()
      createSchedule
      static ReaderSchedule createSchedule​(long initDelay, long interval, int attempts, java.util.concurrent.TimeUnit unit)
      createSchedule
      static ReaderSchedule createSchedule​(long interval, java.lang.String unit)
      Creates a proper ReaderSchedule based by computing a new interval based on the string representation of units from the ackd-configuration: hours(h), days(d), minutes(m), seconds(s), milliseconds(ms) note: if the specification in the configuration is seconds (s) or milliseconds (ms), then no computation is made to adjust the interval.
      long getAttemptsRemaining()
      getAttemptsRemaining
      long getInitialDelay()
      getInitialDelay
      long getInterval()
      getInterval
      java.util.concurrent.TimeUnit getUnit()
      getUnit
      void setAttemptsRemaining​(long attemptsRemaining)
      setAttemptsRemaining
      void setInitialDelay​(long initialDelay)
      setInitialDelay
      void setInterval​(long interval)
      setInterval
      void setUnit​(java.util.concurrent.TimeUnit unit)
      setUnit
      • Methods inherited from class java.lang.Object

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

      • createSchedule

        public static ReaderSchedule createSchedule​(long initDelay,
                                                    long interval,
                                                    int attempts,
                                                    java.util.concurrent.TimeUnit unit)

        createSchedule

        Parameters:
        initDelay - a long.
        interval - a long.
        attempts - a int.
        unit - a TimeUnit object.
        Returns:
        a ReaderSchedule object.
      • getInitialDelay

        public long getInitialDelay()

        getInitialDelay

        Returns:
        a long.
      • setInitialDelay

        public void setInitialDelay​(long initialDelay)

        setInitialDelay

        Parameters:
        initialDelay - a long.
      • getInterval

        public long getInterval()

        getInterval

        Returns:
        a long.
      • setInterval

        public void setInterval​(long interval)

        setInterval

        Parameters:
        interval - a long.
      • getAttemptsRemaining

        public long getAttemptsRemaining()

        getAttemptsRemaining

        Returns:
        a long.
      • setAttemptsRemaining

        public void setAttemptsRemaining​(long attemptsRemaining)

        setAttemptsRemaining

        Parameters:
        attemptsRemaining - a long.
      • getUnit

        public java.util.concurrent.TimeUnit getUnit()

        getUnit

        Returns:
        a TimeUnit object.
      • setUnit

        public void setUnit​(java.util.concurrent.TimeUnit unit)

        setUnit

        Parameters:
        unit - a TimeUnit object.
      • createSchedule

        public static ReaderSchedule createSchedule​(long interval,
                                                    java.lang.String unit)
        Creates a proper ReaderSchedule based by computing a new interval based on the string representation of units from the ackd-configuration: hours(h), days(d), minutes(m), seconds(s), milliseconds(ms) note: if the specification in the configuration is seconds (s) or milliseconds (ms), then no computation is made to adjust the interval.
        Parameters:
        interval - a long.
        unit - a String object.
        Returns:
        an adjusted ReaderSchedule