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
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected String
protected Long
protected boolean
protected Integer
protected long
protected String
protected static final String
protected Long
protected Long
protected Long
protected Long
protected boolean
protected Map<String,
Serializable> protected Long
protected Long
protected Long
protected BulkStatus.State
protected Long
protected Long
protected String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
static BulkStatus
Creates a delta status for a command.boolean
Gets the action name of the command.Gets the time when the command has been detected as completed.int
Gets the error code if any.long
Returns the number of errors encounteredReturns the first error message if any or null.getId()
Gets the asynchronous task id.long
For a full status returns the number of documents where the action has been applied so far.long
Gets 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.long
For 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.long
getTotal()
Gets the total number of documents in the document set.Gets the username of the user running the command.boolean
hasError()
Checks if there is any error.int
hashCode()
void
void
An error occurred during the processingvoid
An error occurred during the processingvoid
An error occurred during the processingvoid
An error occurred during the processingboolean
Returns true if command is completed.boolean
isDelta()
This is an update of a status containing only partial information.boolean
Returns true if the query used by the scroller has been limited.void
merge
(BulkStatus update) Updates the status with the provided update.void
mergeResult
(Map<String, Serializable> result) Merge the given result map by doing a sum between old and new value extendingNumber
for each common key.void
void
setCompletedTime
(Instant completedTime) void
setErrorCount
(long errorCount) void
void
setProcessed
(long processed) Sets number of processed documents.void
setProcessingDurationMillis
(long processingDurationMillis) void
setProcessingEndTime
(Instant processingEndTime) void
setProcessingStartTime
(Instant processingStartTime) void
setQueryLimitReached
(boolean queryLimitReached) void
setResult
(Map<String, Serializable> result) Sets action result.void
setScrollEndTime
(Instant scrollEndTime) void
setScrollStartTime
(Instant scrollStartTime) void
setSkipCount
(long skipCount) Sets number of skipped documents.void
setState
(BulkStatus.State state) void
setSubmitTime
(Instant submitTime) void
setTotal
(long count) Sets the total number of documents in the document setvoid
setUsername
(String username) toString()
static BulkStatus
Creates 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:AsyncStatus
Gets the asynchronous task id.- Specified by:
getId
in 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:AsyncStatus
Returns true if command is completed.- Specified by:
isCompleted
in 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 extendingNumber
for 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:AsyncStatus
Checks if there is any error.- Specified by:
hasError
in interfaceAsyncStatus<String>
- Returns:
true
if there is any error,false
otherwise
-
getErrorMessage
Returns the first error message if any or null.- Specified by:
getErrorMessage
in interfaceAsyncStatus<String>
- Returns:
- the error message if any,
null
otherwise
-
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:AsyncStatus
Gets the error code if any.- Specified by:
getErrorCode
in interfaceAsyncStatus<String>
- Returns:
- the error code if any,
0
otherwise
-