|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.customstep.paging.PagingManager
public class PagingManager
Manage the paging state.
Reads and writes the paging state (page index and record count) on disk. Also stores paging parameters (paging size, decrease factor, current run date), because those cannot change until the whole paging cycle is complete.
Field Summary | |
---|---|
static java.lang.String |
PIPELINE_KEY
Key for the PagingManager in the pipeline. |
Constructor Summary | |
---|---|
PagingManager(java.io.File file,
int pagingSize,
int decreaseFactor,
java.util.Date lastRunDate,
java.util.Date currentRunDate)
Constructor with the file to read/write the paging state, the paging size, the decrease factor, the last run date and the current run date. |
Method Summary | |
---|---|
void |
addNewPage()
Add a new page. |
void |
delete()
Delete the paging file. |
int |
getAdjustedPagingSize()
Get the paging size adjusted for the decrease factor. |
int |
getCurrentPageIndex()
Get the current page index (1 based). |
int |
getCurrentRecordCount()
Get the current record count (corresponding to the current page index). |
int |
getPagingSize()
Get the paging size. |
boolean |
isComplete()
Indicate if paging is complete. |
boolean |
isNew()
Indicate if paging is new. |
void |
save()
Save the current state in the paging file. |
void |
setCurrentRecordCount(int currentRecordCount)
Set the current record count. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PIPELINE_KEY
Constructor Detail |
---|
public PagingManager(java.io.File file, int pagingSize, int decreaseFactor, java.util.Date lastRunDate, java.util.Date currentRunDate) throws java.io.IOException
If paging size, decrease factor, last run date or current run date have changed since the last cycle, while paging was not complete, throw an exception because paging will be inconsistent.
file
- The file to store and retrieve the paging state.pagingSize
- The paging size.decreaseFactor
- The decrease factor.lastRunDate
- The last run date, may be null.currentRunDate
- The current run date, may be null.
java.io.IOException
Method Detail |
---|
public void addNewPage()
public int getPagingSize()
public int getAdjustedPagingSize()
public int getCurrentPageIndex()
Equals 0 if there is no current page.
public int getCurrentRecordCount()
Equals -1 if not set for the current page.
public void setCurrentRecordCount(int currentRecordCount)
currentRecordCount
- public boolean isNew()
public boolean isComplete()
public void save() throws java.io.IOException
java.io.IOException
public void delete() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |