Package org.opennms.netmgt.ackd.readers
Class ReaderSchedule
- java.lang.Object
-
- org.opennms.netmgt.ackd.readers.ReaderSchedule
-
public class ReaderSchedule extends 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()
createSchedulestatic ReaderSchedule
createSchedule(long initDelay, long interval, int attempts, TimeUnit unit)
createSchedulestatic ReaderSchedule
createSchedule(long interval, String unit)
Creates a properReaderSchedule
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()
getAttemptsRemaininglong
getInitialDelay()
getInitialDelaylong
getInterval()
getIntervalTimeUnit
getUnit()
getUnitvoid
setAttemptsRemaining(long attemptsRemaining)
setAttemptsRemainingvoid
setInitialDelay(long initialDelay)
setInitialDelayvoid
setInterval(long interval)
setIntervalvoid
setUnit(TimeUnit unit)
setUnit
-
-
-
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
- aTimeUnit
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.
-
createSchedule
public static ReaderSchedule createSchedule(long interval, String unit)
Creates a properReaderSchedule
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
- aString
object.- Returns:
- an adjusted
ReaderSchedule
-
-