org.opennms.netmgt.ackd.readers
Class ReaderSchedule

java.lang.Object
  extended by org.opennms.netmgt.ackd.readers.ReaderSchedule

public class ReaderSchedule
extends Object

ReaderSchedule class.

Version:
$Id: $
Author:
David Hustace

Method Summary
static ReaderSchedule createSchedule()
          createSchedule
static ReaderSchedule createSchedule(long initDelay, long interval, int attempts, TimeUnit unit)
          createSchedule
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.
 long getAttemptsRemaining()
          getAttemptsRemaining
 long getInitialDelay()
          getInitialDelay
 long getInterval()
          getInterval
 TimeUnit getUnit()
          getUnit
 void setAttemptsRemaining(long attemptsRemaining)
          setAttemptsRemaining
 void setInitialDelay(long initialDelay)
          setInitialDelay
 void setInterval(long interval)
          setInterval
 void setUnit(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()

createSchedule

Returns:
a ReaderSchedule object.

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.

getUnit

public TimeUnit getUnit()

getUnit

Returns:
a TimeUnit object.

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


Copyright © 2011. All Rights Reserved.