Package org.nuxeo.ecm.core.bulk.message
Class BulkStatus
java.lang.Object
org.nuxeo.ecm.core.bulk.message.BulkStatus
- All Implemented Interfaces:
Serializable,AsyncStatus<String>
A message representing a command status or a change of status (delta).
- Since:
- 10.2
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Longprotected booleanprotected Integerprotected longprotected Stringprotected static final Stringprotected Longprotected Longprotected Longprotected Longprotected booleanprotected Map<String,Serializable> protected Longprotected Longprotected Longprotected BulkStatus.Stateprotected Longprotected Longprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidstatic BulkStatusCreates a delta status for a command.booleanGets the action name of the command.Gets the time when the command has been detected as completed.intGets the error code if any.longReturns the number of errors encounteredReturns the first error message if any or null.getId()Gets the asynchronous task id.longFor a full status returns the number of documents where the action has been applied so far.longGets the accumulated processing time in milliseconds.Gets the time when the last action computation has terminated.Gets the time when the action computation starts.Gets unmodifiable action result.Gets the time when the scrolling is completed.Gets the time when the scroll computation starts.longFor a full status returns the number of documents where the action has been skipped so far.getState()Gets the state of the command.Gets the time when the command was submitted to the Bulk service.longgetTotal()Gets the total number of documents in the document set.Gets the username of the user running the command.booleanhasError()Checks if there is any error.inthashCode()voidvoidAn error occurred during the processingvoidAn error occurred during the processingvoidAn error occurred during the processingvoidAn error occurred during the processingbooleanReturns true if command is completed.booleanisDelta()This is an update of a status containing only partial information.booleanReturns true if the query used by the scroller has been limited.voidmerge(BulkStatus update) Updates the status with the provided update.voidmergeResult(Map<String, Serializable> result) Merge the given result map by doing a sum between old and new value extendingNumberfor each common key.voidvoidsetCompletedTime(Instant completedTime) voidsetErrorCount(long errorCount) voidvoidsetProcessed(long processed) Sets number of processed documents.voidsetProcessingDurationMillis(long processingDurationMillis) voidsetProcessingEndTime(Instant processingEndTime) voidsetProcessingStartTime(Instant processingStartTime) voidsetQueryLimitReached(boolean queryLimitReached) voidsetResult(Map<String, Serializable> result) Sets action result.voidsetScrollEndTime(Instant scrollEndTime) voidsetScrollStartTime(Instant scrollStartTime) voidsetSkipCount(long skipCount) Sets number of skipped documents.voidsetState(BulkStatus.State state) voidsetSubmitTime(Instant submitTime) voidsetTotal(long count) Sets the total number of documents in the document setvoidsetUsername(String username) toString()static BulkStatusCreates a delta status for a command.
-
Field Details
-
MERGE_RESULT_FLAG
- Since:
- 2023
- See Also:
-
commandId
-
action
-
username
-
delta
protected boolean delta -
errorCount
protected long errorCount -
errorMessage
-
errorCode
- Since:
- 11.5
-
processed
-
skipCount
-
state
-
submitTime
-
scrollStartTime
-
scrollEndTime
-
processingStartTime
-
processingEndTime
-
completedTime
-
total
-
processingDurationMillis
-
queryLimitReached
protected boolean queryLimitReached -
result
-
-
Constructor Details
-
BulkStatus
protected BulkStatus() -
BulkStatus
-
-
Method Details
-
deltaOf
Creates a delta status for a command. -
unknownOf
Creates a delta status for a command. -
merge
Updates the status with the provided update.- Since:
- 10.3
-
checkForCompletedState
protected void checkForCompletedState() -
getId
Description copied from interface:AsyncStatusGets the asynchronous task id.- Specified by:
getIdin interfaceAsyncStatus<String>
-
setId
-
getState
Gets the state of the command. -
setState
-
getSubmitTime
Gets the time when the command was submitted to the Bulk service. -
setSubmitTime
-
getScrollStartTime
Gets the time when the scroll computation starts. -
setScrollStartTime
-
getScrollEndTime
Gets the time when the scrolling is completed. -
setScrollEndTime
-
getProcessingStartTime
Gets the time when the action computation starts. -
setProcessingStartTime
-
getProcessingEndTime
Gets the time when the last action computation has terminated. -
setProcessingEndTime
-
getCompletedTime
Gets the time when the command has been detected as completed. -
setCompletedTime
-
isQueryLimitReached
public boolean isQueryLimitReached()Returns true if the query used by the scroller has been limited.- Since:
- 11.4
-
setQueryLimitReached
public void setQueryLimitReached(boolean queryLimitReached) - Since:
- 11.4
-
isCompleted
public boolean isCompleted()Description copied from interface:AsyncStatusReturns true if command is completed.- Specified by:
isCompletedin interfaceAsyncStatus<String>
-
getProcessed
public long getProcessed()For a full status returns the number of documents where the action has been applied so far. -
setProcessed
public void setProcessed(long processed) Sets number of processed documents. For a delta this is a relative value that is aggregated duringmerge(BulkStatus)operation. -
getSkipCount
public long getSkipCount()For a full status returns the number of documents where the action has been skipped so far.- Since:
- 2023
-
setSkipCount
public void setSkipCount(long skipCount) Sets number of skipped documents. For a delta this is a relative value that is aggregated duringmerge(BulkStatus)operation.- Since:
- 2023
-
getTotal
public long getTotal()Gets the total number of documents in the document set. Returns 0 when the scroll is not yet completed. -
setTotal
public void setTotal(long count) Sets the total number of documents in the document set -
getResult
Gets unmodifiable action result.- Returns:
- the action result
- Since:
- 10.3
-
setResult
Sets action result.- Parameters:
result- the action result- Since:
- 10.3
-
mergeResult
Merge the given result map by doing a sum between old and new value extendingNumberfor each common key.- Since:
- 2023
-
isDelta
public boolean isDelta()This is an update of a status containing only partial information. For a delta the processing start and end time, and the processed count are also delta.- Since:
- 10.3
-
getAction
Gets the action name of the command. -
setAction
-
getUsername
Gets the username of the user running the command. -
setUsername
-
getProcessingDurationMillis
public long getProcessingDurationMillis()Gets the accumulated processing time in milliseconds. -
setProcessingDurationMillis
public void setProcessingDurationMillis(long processingDurationMillis) -
hasError
public boolean hasError()Description copied from interface:AsyncStatusChecks if there is any error.- Specified by:
hasErrorin interfaceAsyncStatus<String>- Returns:
trueif there is any error,falseotherwise
-
getErrorMessage
Returns the first error message if any or null.- Specified by:
getErrorMessagein interfaceAsyncStatus<String>- Returns:
- the error message if any,
nullotherwise
-
getErrorCount
public long getErrorCount()Returns the number of errors encountered -
setErrorCount
public void setErrorCount(long errorCount) -
incrementSkipCount
public void incrementSkipCount() -
inError
An error occurred during the processing -
inError
An error occurred during the processing -
inError
An error occurred during the processing- Since:
- 11.5
-
inError
An error occurred during the processing -
hashCode
public int hashCode() -
equals
-
toString
-
getErrorCode
public int getErrorCode()Description copied from interface:AsyncStatusGets the error code if any.- Specified by:
getErrorCodein interfaceAsyncStatus<String>- Returns:
- the error code if any,
0otherwise
-