org.dspace.checker
Interface BitstreamDispatcher

All Known Implementing Classes:
HandleDispatcher, LimitedCountDispatcher, LimitedDurationDispatcher, ListDispatcher, SimpleDispatcher

public interface BitstreamDispatcher

BitstreamDispatchers are strategy objects that hand bitstream ids out to workers. Implementations must be threadsafe.

The rationale behind the use of the Sentinel pattern (rather than the more traditional iterator pattern or a cursor c.f. java.sql.ResultSet): -

  1. To make it easy to make implementations thread safe - multithreaded invocation of the dispatchers is seen as a next step use case. In simple terms, this requires that a single method does all the work.
  2. Shouldn't an exception as the sentinel, as reaching the end of a loop is not an exceptional condition.

Author:
Jim Downing, Grace Carpenter, Nathan Sarr

Field Summary
static int SENTINEL
          This value should be returned by next() to indicate that there are no more values.
 
Method Summary
 int next()
          Returns the next id for checking, or a sentinel value if there are no more to check.
 

Field Detail

SENTINEL

static final int SENTINEL
This value should be returned by next() to indicate that there are no more values.

See Also:
Constant Field Values
Method Detail

next

int next()
Returns the next id for checking, or a sentinel value if there are no more to check.

Returns:
the next bitstream id, or BitstreamDispatcher.SENTINEL if there isn't another value


Copyright © 2010 DuraSpace. All Rights Reserved.