Class OrderedEntityObjectBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>
- java.lang.Object
-
- com.atlassian.confluence.content.render.xhtml.migration.OrderedEntityObjectBatchableWorkSource<T>
-
- All Implemented Interfaces:
BatchableWorkSource<T>
- Direct Known Subclasses:
LatestVersionXhtmlContentWorkSource
public class OrderedEntityObjectBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject> extends Object implements BatchableWorkSource<T>
ABatchableWorkSourceimplementation which retrieves batches ofEntityObjects by ordering the entities by their IDs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOrderedEntityObjectBatchableWorkSource.EntityRetrievalExceptionprotected static interfaceOrderedEntityObjectBatchableWorkSource.EntitySource<T extends com.atlassian.core.bean.EntityObject>
-
Constructor Summary
Constructors Constructor Description OrderedEntityObjectBatchableWorkSource(int batchSize, OrderedEntityObjectBatchableWorkSource.EntitySource<T> entitySource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<T>getBatch()Returns a batch of work.intgetTotalSize()booleanhasMoreBatches()intnumberOfBatches()voidreset(int total)Reset the work source ready to begin getting batches again.
-
-
-
Constructor Detail
-
OrderedEntityObjectBatchableWorkSource
public OrderedEntityObjectBatchableWorkSource(int batchSize, OrderedEntityObjectBatchableWorkSource.EntitySource<T> entitySource)
-
-
Method Detail
-
getBatch
public List<T> getBatch()
Returns a batch of work. When work is exhausted an empty list is returned.- Specified by:
getBatchin interfaceBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>- Returns:
- batch of work
-
hasMoreBatches
public boolean hasMoreBatches()
- Specified by:
hasMoreBatchesin interfaceBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>- Returns:
- true if more work batches exist
-
numberOfBatches
public int numberOfBatches()
- Specified by:
numberOfBatchesin interfaceBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>- Returns:
- total number of work batches available.
-
getTotalSize
public int getTotalSize()
- Specified by:
getTotalSizein interfaceBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>
-
reset
public void reset(int total)
Description copied from interface:BatchableWorkSourceReset the work source ready to begin getting batches again.- Specified by:
resetin interfaceBatchableWorkSource<T extends com.atlassian.core.bean.EntityObject>
-
-