Package org.dspace.checker
Class LimitedDurationDispatcher
java.lang.Object
org.dspace.checker.LimitedDurationDispatcher
- All Implemented Interfaces:
BitstreamDispatcher
A delegating dispatcher that puts a time limit on the operation of another dispatcher.
Unit testing this class would be possible by abstracting the system time into an abstract clock. We decided this was not worth the candle.
- Author:
- Jim Downing, Grace Carpenter, Nathan Sarr
-
Field Summary
Fields inherited from interface org.dspace.checker.BitstreamDispatcher
SENTINEL -
Constructor Summary
ConstructorsConstructorDescriptionLimitedDurationDispatcher(BitstreamDispatcher dispatcher, Instant endTime) Main constructor. -
Method Summary
-
Constructor Details
-
LimitedDurationDispatcher
Main constructor.- Parameters:
dispatcher- Delegate dispatcher that will do the heavy lifting of the dispatching work.endTime- when this dispatcher will stop returning valid bitstream ids.
-
-
Method Details
-
next
Description copied from interface:BitstreamDispatcherReturns the next id for checking, or a sentinel value if there are no more to check.- Specified by:
nextin interfaceBitstreamDispatcher- Returns:
- the next bitstream id, or BitstreamDispatcher.SENTINEL if there isn't another value
- Throws:
SQLException- if database error- See Also:
-