public class DefaultBatchJobResult extends Object implements BatchJobResultAdapter
BatchJobResultAdapter| Constructor and Description |
|---|
DefaultBatchJobResult(String batchJodInstanceId) |
| Modifier and Type | Method and Description |
|---|---|
String |
getBatchJobInstanceId()
The id of the owning
BatchJobInstance |
Map<String,BatchStepResult> |
getBatchStepResults()
Returns a
Map in which the key is the name of a step and the value is a BatchStepResult |
long |
getElapsedTimeInMillis()
How many milliseconds the
BatchJobInstance has been in executing state. |
long |
getFailedRecords()
How many records were processed and failed in at least one step
|
Exception |
getInputPhaseException()
If the input phase failed, this method returns an exception info object
|
long |
getLoadedRecords()
How many records were loaded so far.
|
Exception |
getLoadingPhaseException()
If the loading phase failed, this method returns an exception info object
|
Exception |
getOnCompletePhaseException()
If the on complete phase failed, this method returns an exception info object
|
long |
getProcessedRecords()
How many records already went through all steps so far.
|
BatchStepResult |
getResultForStep(String stepId)
Retrieves information about the execution of a particular step
|
long |
getSuccessfulRecords()
How many records were processed through all the steps without failing any of them
|
long |
getTotalRecords()
Total number of records in the batch
|
long |
incrementLoadedRecords(long howMany)
Increments the load records count by howMany
|
boolean |
isFailedOnCompletePhase()
Wether an exeption was found on the on complete phase
|
boolean |
isFailedOnInputPhase()
Wether an exeption was found on the on input phase
|
boolean |
isFailedOnLoadingPhase()
Wether an exeption was found on the on loading phase
|
void |
setInputPhaseException(Exception inputPhaseException)
Sets an
Exception thrown in the input phase |
void |
setLoadingPhaseException(Exception loadingPhaseException)
Sets an
Exception thrown in the loading phase |
void |
setOnCompletePhaseException(Exception onCompleteStepException)
Sets an
Exception thrown in the on complete phase |
void |
setTotalRecords(long totalRecords)
sets the amount of total records that make for the owning
BatchJobInstance |
long |
startClock()
Starts tracking the time that a
BatchJobInstance has been processing since the moment that this method has been
invoked. |
long |
stopClock()
Signals that the owning
BatchJobInstance has stopped processing at the time this method was invoked |
void |
updateFor(BatchJobAdapter job,
Collection<Record> records)
Updates the values in this instance
|
public DefaultBatchJobResult(String batchJodInstanceId)
public void updateFor(BatchJobAdapter job, Collection<Record> records)
updateFor in interface BatchJobResultAdapterjob - the owning BatchJobAdapterrecords - a collection of Record processedpublic BatchStepResult getResultForStep(String stepId)
getResultForStep in interface BatchJobResultstepId - the id of a step in the owning BatchJobBatchStepResultpublic long startClock()
BatchJobInstance has been processing since the moment that this method has been
invoked. After invoking this method, BatchJobResultAdapter.stopClock() has to be invoked at some point so that
BatchJobResult.getElapsedTimeInMillis() can eventually return a valid valuestartClock in interface BatchJobResultAdapterpublic long stopClock()
BatchJobInstance has stopped processing at the time this method was invokedstopClock in interface BatchJobResultAdapterBatchJobInstance has been processingpublic long getElapsedTimeInMillis()
BatchJobInstance has been in executing state. If the job is stopped and then resumed, this
method is smart enough to filter the intervalgetElapsedTimeInMillis in interface BatchJobResultpublic long getSuccessfulRecords()
getSuccessfulRecords in interface BatchJobResultpublic long getFailedRecords()
getFailedRecords in interface BatchJobResultpublic long getProcessedRecords()
BatchJobResult.getTotalRecords()getProcessedRecords in interface BatchJobResultpublic long getTotalRecords()
getTotalRecords in interface BatchJobResultpublic String getBatchJobInstanceId()
BatchJobInstancegetBatchJobInstanceId in interface BatchJobResultStringpublic long getLoadedRecords()
BatchJobResult.getTotalRecords()getLoadedRecords in interface BatchJobResultpublic long incrementLoadedRecords(long howMany)
incrementLoadedRecords in interface BatchJobResultAdapterhowMany - the amount of new records that have been loadedpublic void setTotalRecords(long totalRecords)
BatchJobInstancesetTotalRecords in interface BatchJobResultAdaptertotalRecords - the total amount of recordspublic boolean isFailedOnInputPhase()
isFailedOnInputPhase in interface BatchJobResultpublic Exception getInputPhaseException()
getInputPhaseException in interface BatchJobResultExceptionpublic Exception getLoadingPhaseException()
BatchJobResultgetLoadingPhaseException in interface BatchJobResultExceptionpublic boolean isFailedOnLoadingPhase()
BatchJobResultisFailedOnLoadingPhase in interface BatchJobResultpublic boolean isFailedOnCompletePhase()
isFailedOnCompletePhase in interface BatchJobResultpublic Exception getOnCompletePhaseException()
getOnCompletePhaseException in interface BatchJobResultExceptionpublic void setOnCompletePhaseException(Exception onCompleteStepException)
Exception thrown in the on complete phasesetOnCompletePhaseException in interface BatchJobResultAdapteronCompleteStepException - a Exceptionpublic void setInputPhaseException(Exception inputPhaseException)
Exception thrown in the input phasesetInputPhaseException in interface BatchJobResultAdapterinputPhaseException - a Exceptionpublic void setLoadingPhaseException(Exception loadingPhaseException)
Exception thrown in the loading phasesetLoadingPhaseException in interface BatchJobResultAdapterloadingPhaseException - a Exceptionpublic Map<String,BatchStepResult> getBatchStepResults()
Map in which the key is the name of a step and the value is a BatchStepResultgetBatchStepResults in interface BatchJobResultAdapterCopyright © 2006–2019 MuleSoft, Inc.. All rights reserved.