public class StepExecution extends Entity
JobExecution
, there are additional properties related the processing
of items such as commit count, etc.Constructor and Description |
---|
StepExecution(java.lang.String stepName,
JobExecution jobExecution)
Constructor that substitutes in null for the execution id
|
StepExecution(java.lang.String stepName,
JobExecution jobExecution,
java.lang.Long id)
Constructor with mandatory properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addFailureException(java.lang.Throwable throwable) |
void |
apply(StepContribution contribution)
On successful execution just before a chunk commit, this method should be
called.
|
StepContribution |
createStepContribution()
Factory method for
StepContribution . |
boolean |
equals(java.lang.Object obj)
Attempt to establish identity based on id if both exist.
|
int |
getCommitCount()
Returns the current number of commits for this execution
|
java.util.Date |
getEndTime()
Returns the time that this execution ended
|
ExecutionContext |
getExecutionContext()
Returns the
ExecutionContext for this execution |
ExitStatus |
getExitStatus() |
java.util.List<java.lang.Throwable> |
getFailureExceptions() |
int |
getFilterCount()
Returns the current number of items filtered out of this execution
|
JobExecution |
getJobExecution()
Accessor for the execution context information of the enclosing job.
|
java.lang.Long |
getJobExecutionId()
Accessor for the job execution id.
|
JobParameters |
getJobParameters()
Convenience method to get the current job parameters.
|
java.util.Date |
getLastUpdated() |
int |
getProcessSkipCount() |
int |
getReadCount()
Returns the current number of items read for this execution
|
int |
getReadSkipCount() |
int |
getRollbackCount()
Returns the current number of rollbacks for this execution
|
int |
getSkipCount() |
java.util.Date |
getStartTime()
Gets the time this execution started
|
BatchStatus |
getStatus()
Returns the current status of this step
|
java.lang.String |
getStepName() |
java.lang.String |
getSummary() |
int |
getWriteCount()
Returns the current number of items written for this execution
|
int |
getWriteSkipCount() |
int |
hashCode()
Use ID if it exists to establish hash code, otherwise fall back to
Object.hashCode().
|
void |
incrementCommitCount()
Increment the number of commits
|
void |
incrementRollbackCount()
On unsuccessful execution after a chunk has rolled back.
|
boolean |
isTerminateOnly() |
void |
setCommitCount(int commitCount)
Sets the current number of commits for this execution
|
void |
setEndTime(java.util.Date endTime)
Sets the time that this execution ended
|
void |
setExecutionContext(ExecutionContext executionContext)
Sets the
ExecutionContext for this execution |
void |
setExitStatus(ExitStatus exitStatus) |
void |
setFilterCount(int filterCount)
Public setter for the number of items filtered out of this execution.
|
void |
setLastUpdated(java.util.Date lastUpdated)
Set the time when the StepExecution was last updated before persisting
|
void |
setProcessSkipCount(int processSkipCount)
Set the number of records skipped during processing.
|
void |
setReadCount(int readCount)
Sets the current number of read items for this execution
|
void |
setReadSkipCount(int readSkipCount)
Set the number of records skipped on read
|
void |
setRollbackCount(int rollbackCount)
Setter for number of rollbacks for this execution
|
void |
setStartTime(java.util.Date startTime)
Sets the time this execution started
|
void |
setStatus(BatchStatus status)
Sets the current status of this step
|
void |
setTerminateOnly()
Set a flag that will signal to an execution environment that this
execution (and its surrounding job) wishes to exit.
|
void |
setWriteCount(int writeCount)
Sets the current number of written items for this execution
|
void |
setWriteSkipCount(int writeSkipCount)
Set the number of records skipped on write
|
java.lang.String |
toString() |
void |
upgradeStatus(BatchStatus status)
Upgrade the status field if the provided value is greater than the
existing one.
|
getId, getVersion, incrementVersion, setId, setVersion
public StepExecution(java.lang.String stepName, JobExecution jobExecution, java.lang.Long id)
stepName
- the step to which this execution belongsjobExecution
- the current job executionid
- the id of this executionpublic StepExecution(java.lang.String stepName, JobExecution jobExecution)
stepName
- the step to which this execution belongsjobExecution
- the current job executionpublic ExecutionContext getExecutionContext()
ExecutionContext
for this executionpublic void setExecutionContext(ExecutionContext executionContext)
ExecutionContext
for this executionexecutionContext
- the attributespublic int getCommitCount()
public void setCommitCount(int commitCount)
commitCount
- the current number of commitspublic java.util.Date getEndTime()
public void setEndTime(java.util.Date endTime)
endTime
- the time that this execution endedpublic int getReadCount()
public void setReadCount(int readCount)
readCount
- the current number of read items for this executionpublic int getWriteCount()
public void setWriteCount(int writeCount)
writeCount
- the current number of written items for this executionpublic int getRollbackCount()
public int getFilterCount()
public void setFilterCount(int filterCount)
filterCount
- the number of items filtered out of this execution to
setpublic void setRollbackCount(int rollbackCount)
public java.util.Date getStartTime()
public void setStartTime(java.util.Date startTime)
startTime
- the time this execution startedpublic BatchStatus getStatus()
public void setStatus(BatchStatus status)
status
- the current status of this steppublic void upgradeStatus(BatchStatus status)
status
- the new status valuepublic java.lang.String getStepName()
public java.lang.Long getJobExecutionId()
public void setExitStatus(ExitStatus exitStatus)
exitStatus
- public ExitStatus getExitStatus()
public JobExecution getJobExecution()
JobExecution
that was used to start this step
execution.public StepContribution createStepContribution()
StepContribution
.StepContribution
public void apply(StepContribution contribution)
StepExecution
so that changes
are atomic.contribution
- public void incrementRollbackCount()
public boolean isTerminateOnly()
public void setTerminateOnly()
public int getSkipCount()
public void incrementCommitCount()
public JobParameters getJobParameters()
JobParameters
from the enclosing job, or empty if
that is nullpublic int getReadSkipCount()
public int getWriteSkipCount()
public void setReadSkipCount(int readSkipCount)
readSkipCount
- public void setWriteSkipCount(int writeSkipCount)
writeSkipCount
- public int getProcessSkipCount()
public void setProcessSkipCount(int processSkipCount)
processSkipCount
- public java.util.Date getLastUpdated()
public void setLastUpdated(java.util.Date lastUpdated)
lastUpdated
- public java.util.List<java.lang.Throwable> getFailureExceptions()
public void addFailureException(java.lang.Throwable throwable)
public boolean equals(java.lang.Object obj)
Entity
public int hashCode()
Entity
Entity
to a
Set because Set.contains() will almost certainly return false for the
Entity
after it is saved. Spring Batch does not store any of its
entities in Sets as a matter of course, so internally this is consistent.
Clients should not be exposed to unsaved entities.public java.lang.String getSummary()