public interface IBatchProgressMonitor
Usage :
IBatchProgressMonitor monitor, getBatchProgressMonitor("name",
"group", "uuid");
// get item list
monitor.beginTask( "taskName", "taskDescr", 2 );
monitor.setCurrentItem( "1" ) ;
// Do some work on item 1;
monitor.worked(1);
monitor.setCurrentItem( "2" ) ;
// Do some work on item 2;
monitor.worked(1);
monitor.done();
Modifier and Type | Field and Description |
---|---|
static int |
UNKNOW
Unknown amount of work.
|
Modifier and Type | Method and Description |
---|---|
void |
beginTask(String name,
String description,
int totalWork)
Begin a task execution.
|
IBatchProgressMonitor |
createSubTask(int work)
Create a sub task of this task with the amount of work the subtask
execution will done.
|
void |
done()
Set the task is done.
|
void |
fail(String reason)
Report global failure.
|
void |
fail(String reason,
Throwable t)
Report global failure.
|
Date |
getLastUpdate() |
int |
getTotalWork()
Retrieve the total amount of work for this task.
|
boolean |
isCancelRequested()
Returns true if cancel has been requested for the current job, usually
from a control UI.
|
void |
message(String message)
Send a message during the task execution.
|
void |
reject(String[] itemIds,
String reason)
Reject a set of items during the task processing.
|
void |
reject(String[] itemIds,
String reason,
Throwable e)
Reject a set of items during the task processing.
|
void |
reject(String itemId,
String reason)
Reject one item during the task processing.
|
void |
reject(String itemId,
String reason,
Throwable e)
* Reject one item during the task processing.
|
void |
setCurrentItem(Object item)
Set the current item which is being processed.
|
void |
setLogger(org.slf4j.Logger logger)
Set the logger to use for the current batch.
|
void |
worked(int work)
Notify the processing of items.
|
static final int UNKNOW
void beginTask(String name, String description, int totalWork)
name
- task namedescription
- task descriptiontotalWork
- task amount of work to be doneIBatchProgressMonitor createSubTask(int work)
work
- work units of the task done by the subtaskvoid done()
void fail(String reason)
Use this when the batch has issued a major error and cannot continue.
reason
- void fail(String reason, Throwable t)
Use this when the batch has issued a major error and cannot continue.
reason
- t
- Exception which caused the failure.Date getLastUpdate()
int getTotalWork()
boolean isCancelRequested()
void message(String message)
message
- messagevoid reject(String itemId, String reason)
Use this when :
itemId
- rejected item idreason
- the reasonIBatchProgressMonitor#reject(String, String, Throwable) can be used
to provide the exception which has caused the failure.
void reject(String itemId, String reason, Throwable e)
itemId
- reason
- e
- Exceptionreject(String, String)
void reject(String[] itemIds, String reason)
itemIds
- Array of item ids rejectedreason
- the reasonreject(String, String)
void reject(String[] itemIds, String reason, Throwable e)
itemIds
- reason
- e
- Exceptionreject(String, String)
void setCurrentItem(Object item)
item
- current processed itemvoid setLogger(org.slf4j.Logger logger)
logger
- void worked(int work)
work
- items processedCopyright © 2010–2016. All rights reserved.