Class ReaderSchedule


  • public class ReaderSchedule
    extends Object

    ReaderSchedule class.

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

      • createSchedule

        public static ReaderSchedule createSchedule​(long initDelay,
                                                    long interval,
                                                    int attempts,
                                                    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.
      • setUnit

        public void setUnit​(TimeUnit unit)

        setUnit

        Parameters:
        unit - a TimeUnit object.
      • createSchedule

        public static ReaderSchedule createSchedule​(long interval,
                                                    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