Package pro.taskana.common.api
Class BulkOperationResults<K,V extends Exception>
java.lang.Object
pro.taskana.common.api.BulkOperationResults<K,V>
- Type Parameters:
K- unique keys for the logs.V- type of the stored informations
Returning type for a bulk db interaction with errors. This wrapper is storing them with a
matching object ID.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllErrors(BulkOperationResults<? extends K, ? extends V> log) Add all errors from another BulkOperationResult to this.voidAdding an appearing error to the map and list them by a unique ID as key.voidClearing the map - all entries will be removed.booleanReturning the status of a bulk-error-log.getErrorForId(K idKey) Returns the stored error for a unique ID or NULL if there is no error stored or ID invalid.Returning a list of current errors as map.Returns the IDs of the Object with failed requests.Map from any exception type to Exception.toString()
-
Constructor Details
-
BulkOperationResults
public BulkOperationResults()
-
-
Method Details
-
getErrorMap
Returning a list of current errors as map. If there are no errors the result will be empty.- Returns:
- map of errors which can't be null.
-
addError
Adding an appearing error to the map and list them by a unique ID as key.- Parameters:
objectId- unique key of a entity.error- occurred error of a interaction with the entity
-
containsErrors
public boolean containsErrors()Returning the status of a bulk-error-log.- Returns:
- true if there are logged errors.
-
getErrorForId
Returns the stored error for a unique ID or NULL if there is no error stored or ID invalid.- Parameters:
idKey- which is mapped with an error- Returns:
- stored error for ID
-
getFailedIds
Returns the IDs of the Object with failed requests.- Returns:
- a List of IDs that could not be processed successfully.
-
clearErrors
public void clearErrors()Clearing the map - all entries will be removed. -
addAllErrors
Add all errors from another BulkOperationResult to this.- Parameters:
log- the other log
-
mapBulkOperationResults
Map from any exception type to Exception.- Returns:
- map of errors which can't be null.
-
toString
-