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
ConstructorsConstructorDescriptionStepExecutionEvent(org.springframework.batch.core.StepExecution stepExecution) Constructor for the StepExecution to initialize the DTO. -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongReturns the current number of commits for this execution.Returns the time that this execution ended.org.springframework.batch.item.ExecutionContextReturns theExecutionContextfor this execution.longReturns the current number of items filtered out of this execution.longlonglongReturns the current number of items read for this execution.longlongReturns the current number of rollbacks for this execution.longGets the time this execution started.org.springframework.batch.core.BatchStatusReturns the current status of this step.longReturns the current number of items written for this execution.longinthashCode()voidIncrement the number of commits.booleanvoidsetCommitCount(int commitCount) Sets the current number of commits for this execution.voidsetEndTime(LocalDateTime endTime) Sets the time that this execution ended.voidsetExecutionContext(org.springframework.batch.item.ExecutionContext executionContext) Sets theExecutionContextfor this execution.voidsetExitStatus(ExitStatus exitStatus) voidsetFilterCount(int filterCount) Public setter for the number of items filtered out of this execution.voidsetLastUpdated(LocalDateTime lastUpdated) Set the time when the StepExecution was last updated before persisting.voidsetProcessSkipCount(int processSkipCount) Set the number of records skipped during processing.voidsetReadCount(int readCount) Sets the current number of read items for this execution.voidsetReadSkipCount(int readSkipCount) Set the number of records skipped on read.voidsetRollbackCount(int rollbackCount) Setter for number of rollbacks for this execution.voidsetStartTime(LocalDateTime startTime) Sets the time this execution started.voidsetStatus(org.springframework.batch.core.BatchStatus status) Sets the current status of this step.voidsetStepName(String stepName) voidSet a flag that will signal to an execution environment that this execution (and its surrounding job) wishes to exit.voidsetWriteCount(int writeCount) Sets the current number of written items for this execution.voidsetWriteSkipCount(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 theExecutionContextfor this execution.- Returns:
- the attributes
-
setExecutionContext
public void setExecutionContext(org.springframework.batch.item.ExecutionContext executionContext) Sets theExecutionContextfor 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- theExitStatusfor 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- theLocalDateTimethe StepExecution was last updated.
-
getFailureExceptions
-
getJobExecutionId
public long getJobExecutionId() -
equals
- Overrides:
equalsin classorg.springframework.batch.core.Entity
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.springframework.batch.core.Entity
-
toString
- Overrides:
toStringin classorg.springframework.batch.core.Entity
-
getSummary
-