Class StepExecutionEvent
java.lang.Object
org.springframework.batch.core.Entity
org.springframework.cloud.task.batch.listener.support.StepExecutionEvent
- All Implemented Interfaces:
Serializable
public class StepExecutionEvent
extends org.springframework.batch.core.Entity
This is a StepExecution DTO created so that a
StepExecution
can be serialized into Json
without having to add mixins to an ObjectMapper.- Author:
- Glenn Renfro
- See Also:
-
Constructor Summary
ConstructorDescriptionStepExecutionEvent
(org.springframework.batch.core.StepExecution stepExecution) Constructor for the StepExecution to initialize the DTO. -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
Returns the current number of commits for this execution.Returns the time that this execution ended.org.springframework.batch.item.ExecutionContext
Returns theExecutionContext
for this execution.long
Returns the current number of items filtered out of this execution.long
long
long
Returns the current number of items read for this execution.long
long
Returns the current number of rollbacks for this execution.long
Gets the time this execution started.org.springframework.batch.core.BatchStatus
Returns the current status of this step.long
Returns the current number of items written for this execution.long
int
hashCode()
void
Increment the number of commits.boolean
void
setCommitCount
(int commitCount) Sets the current number of commits for this execution.void
setEndTime
(LocalDateTime endTime) Sets the time that this execution ended.void
setExecutionContext
(org.springframework.batch.item.ExecutionContext executionContext) Sets theExecutionContext
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
(LocalDateTime 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
(LocalDateTime startTime) Sets the time this execution started.void
setStatus
(org.springframework.batch.core.BatchStatus status) Sets the current status of this step.void
setStepName
(String stepName) void
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.toString()
Methods inherited from class org.springframework.batch.core.Entity
getId, getVersion, incrementVersion, setId, setVersion
-
Constructor Details
-
StepExecutionEvent
public StepExecutionEvent() -
StepExecutionEvent
public StepExecutionEvent(org.springframework.batch.core.StepExecution stepExecution) Constructor for the StepExecution to initialize the DTO.- Parameters:
stepExecution
- the StepExecution to build this DTO around.
-
-
Method Details
-
getExecutionContext
public org.springframework.batch.item.ExecutionContext getExecutionContext()Returns theExecutionContext
for this execution.- Returns:
- the attributes
-
setExecutionContext
public void setExecutionContext(org.springframework.batch.item.ExecutionContext executionContext) Sets theExecutionContext
for this execution.- Parameters:
executionContext
- the attributes
-
getCommitCount
public long getCommitCount()Returns the current number of commits for this execution.- Returns:
- the current number of commits
-
setCommitCount
public void setCommitCount(int commitCount) Sets the current number of commits for this execution.- Parameters:
commitCount
- the current number of commits
-
getEndTime
Returns the time that this execution ended.- Returns:
- the time that this execution ended
-
setEndTime
Sets the time that this execution ended.- Parameters:
endTime
- the time that this execution ended
-
getReadCount
public long getReadCount()Returns the current number of items read for this execution.- Returns:
- the current number of items read for this execution
-
setReadCount
public void setReadCount(int readCount) Sets the current number of read items for this execution.- Parameters:
readCount
- the current number of read items for this execution
-
getWriteCount
public long getWriteCount()Returns the current number of items written for this execution.- Returns:
- the current number of items written for this execution
-
setWriteCount
public void setWriteCount(int writeCount) Sets the current number of written items for this execution.- Parameters:
writeCount
- the current number of written items for this execution
-
getRollbackCount
public long getRollbackCount()Returns the current number of rollbacks for this execution.- Returns:
- the current number of rollbacks for this execution
-
setRollbackCount
public void setRollbackCount(int rollbackCount) Setter for number of rollbacks for this execution.- Parameters:
rollbackCount
- the number of rollbacks for this execution
-
getFilterCount
public long getFilterCount()Returns the current number of items filtered out of this execution.- Returns:
- the current number of items filtered out of this execution
-
setFilterCount
public void setFilterCount(int filterCount) Public setter for the number of items filtered out of this execution.- Parameters:
filterCount
- the number of items filtered out of this execution to set
-
getStartTime
Gets the time this execution started.- Returns:
- the time this execution started
-
setStartTime
Sets the time this execution started.- Parameters:
startTime
- the time this execution started
-
getStatus
public org.springframework.batch.core.BatchStatus getStatus()Returns the current status of this step.- Returns:
- the current status of this step
-
setStatus
public void setStatus(org.springframework.batch.core.BatchStatus status) Sets the current status of this step.- Parameters:
status
- the current status of this step
-
getStepName
- Returns:
- the name of the step.
-
setStepName
-
getExitStatus
- Returns:
- the exitCode
-
setExitStatus
- Parameters:
exitStatus
- theExitStatus
for the step.
-
isTerminateOnly
public boolean isTerminateOnly()- Returns:
- flag to indicate that an execution should halt
-
setTerminateOnly
public void setTerminateOnly()Set a flag that will signal to an execution environment that this execution (and its surrounding job) wishes to exit. -
getSkipCount
public long getSkipCount()- Returns:
- the total number of items skipped.
-
incrementCommitCount
public void incrementCommitCount()Increment the number of commits. -
getReadSkipCount
public long getReadSkipCount()- Returns:
- the number of records skipped on read.
-
setReadSkipCount
public void setReadSkipCount(int readSkipCount) Set the number of records skipped on read.- Parameters:
readSkipCount
- the number of records to be skipped on read.
-
getWriteSkipCount
public long getWriteSkipCount()- Returns:
- the number of records skipped on write
-
setWriteSkipCount
public void setWriteSkipCount(int writeSkipCount) Set the number of records skipped on write.- Parameters:
writeSkipCount
- the number of records to be skipped on write.
-
getProcessSkipCount
public long getProcessSkipCount()- Returns:
- the number of records skipped during processing
-
setProcessSkipCount
public void setProcessSkipCount(int processSkipCount) Set the number of records skipped during processing.- Parameters:
processSkipCount
- the number of records skip during processing.
-
getLastUpdated
- Returns:
- the Date representing the last time this execution was persisted.
-
setLastUpdated
Set the time when the StepExecution was last updated before persisting.- Parameters:
lastUpdated
- theLocalDateTime
the StepExecution was last updated.
-
getFailureExceptions
-
getJobExecutionId
public long getJobExecutionId() -
equals
- Overrides:
equals
in classorg.springframework.batch.core.Entity
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.springframework.batch.core.Entity
-
toString
- Overrides:
toString
in classorg.springframework.batch.core.Entity
-
getSummary
-