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 ReaderSchedulecreateSchedule()createSchedulestatic ReaderSchedulecreateSchedule(long initDelay, long interval, int attempts, TimeUnit unit)createSchedulestatic ReaderSchedulecreateSchedule(long interval, String unit)Creates a properReaderSchedulebased 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.longgetAttemptsRemaining()getAttemptsRemaininglonggetInitialDelay()getInitialDelaylonggetInterval()getIntervalTimeUnitgetUnit()getUnitvoidsetAttemptsRemaining(long attemptsRemaining)setAttemptsRemainingvoidsetInitialDelay(long initialDelay)setInitialDelayvoidsetInterval(long interval)setIntervalvoidsetUnit(TimeUnit unit)setUnit
-
-
-
Method Detail
-
createSchedule
public static ReaderSchedule createSchedule()
createSchedule
- Returns:
- a
ReaderScheduleobject.
-
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- aTimeUnitobject.- Returns:
- a
ReaderScheduleobject.
-
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 properReaderSchedulebased 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- aStringobject.- Returns:
- an adjusted
ReaderSchedule
-
-