T
- the type parameterpublic abstract class AbstractPageOperationTemplate<T> extends Object
Constructor and Description |
---|
AbstractPageOperationTemplate(int maxPages,
long maxTime,
String operationName)
Instantiates a new AbstractPageOperationTemplate with the
given maxPages and maxTime
|
AbstractPageOperationTemplate(String operationName)
default constructor which sets the value of
maxPages and maxTime to DEFAULT_MAX_PAGES and
DEFAULT_MAX_TIME_MILLIS respectively
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doOperation(T item)
method responsible for performing desired
operation on a fetched page item.
|
void |
execute()
Execute the operation on each member of a page of results
retrieved through the fetch method.
|
abstract Collection<T> |
fetchPage()
method responsible for fetching
a page of items.
|
protected void |
finalReport(int operationsCompleted,
int exceptionsSwallowedCount,
Set<String> exceptionsSwallowedClasses)
Method responsible for final report of progress.
|
int |
getMaxPages() |
long |
getMaxTime() |
String |
getOperationName() |
boolean |
isSwallowExceptions() |
void |
setMaxPages(int maxPages) |
void |
setMaxTime(long maxTime) |
void |
setOperationName(String operationName) |
void |
setSwallowExceptions(boolean swallowExceptions) |
public AbstractPageOperationTemplate(String operationName)
public AbstractPageOperationTemplate(int maxPages, long maxTime, String operationName)
maxPages
- the maximum number of pages to fetch.maxTime
- the maximum execution time.public void execute()
public abstract Collection<T> fetchPage()
protected abstract void doOperation(T item)
item
- the itemprotected void finalReport(int operationsCompleted, int exceptionsSwallowedCount, Set<String> exceptionsSwallowedClasses)
public int getMaxPages()
public void setMaxPages(int maxPages)
public long getMaxTime()
public void setMaxTime(long maxTime)
public boolean isSwallowExceptions()
public void setSwallowExceptions(boolean swallowExceptions)
public String getOperationName()
public void setOperationName(String operationName)
operationName
- the operationName to setCopyright © 2018. All rights reserved.