Class ResolvedAttachmentList
- java.lang.Object
-
- de.xima.fc.workflow.processor.model.ResolvedAttachmentList
-
- All Implemented Interfaces:
IAttachmentItemResolutionErrorProviding
,IResolvedAttachmentList
public final class ResolvedAttachmentList extends Object implements IResolvedAttachmentList
Default POJO implementation ofIResolvedAttachmentList
.- Since:
- 8.1.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,E extends Throwable>
RcollectResult(IResolvedAttachmentListProcessor<R,E> handler)
Iterates over all resolved attachment items, processes them with the given handler, and returns the combined result of all attachment items.List<IResolvedAttachmentItem>
getAttachmentItems()
Retrieves the list of resolved attachment items.IReferencedAttachmentList
getAttachmentList()
Map<EAttachmentItemResolutionError,List<AAttachmentListResolutionError>>
getErrors()
static IResolvedAttachmentList
ofError(AAttachmentListResolutionError.CannotProcessAttachmentList error)
Creates a new POJO with the given data and no containing directory and attachments.static IResolvedAttachmentList
ofSuccess(IReferencedAttachmentList attachmentList, List<IResolvedAttachmentItem> resourceItems)
Creates a new POJO with the given data and thegetErrors()
set tonull
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.xima.fc.interfaces.workflow.retval.IAttachmentItemResolutionErrorProviding
getErrors, getErrorsAttachmentCountReducedTozeroByFilterOptions, getErrorsAttachmentFilterDoesNotMatch, getErrorsCannotProcessAttachmentItem, getErrorsCannotProcessAttachmentList, getErrorsDatabaseError, getErrorsFileSystemError, getErrorsNodeDoesNotExist, getErrorsNodeDoesNotProvideAttachments, getErrorsNodeNotExecuted, getErrorsUploadFieldDoesNotExist, getErrorsUploadFieldDoesNotProvideAttachments, isHasError
-
Methods inherited from interface de.xima.fc.interfaces.workflow.retval.IResolvedAttachmentList
getResolvedAttachmentsComplete, getResolvedAttachmentsPartial
-
-
-
-
Method Detail
-
collectResult
public <R,E extends Throwable> R collectResult(IResolvedAttachmentListProcessor<R,E> handler) throws E extends Throwable
Description copied from interface:IResolvedAttachmentList
Iterates over all resolved attachment items, processes them with the given handler, and returns the combined result of all attachment items. Standard use case is to convert errors to hard and soft workflow node errors and return a list of all resolved attachments.If you wish to use the standard error behavior for attachments, use
standardAttachmentErrorsSingle
orstandardAttachmentErrorsMultiple
. Otherwise, provide your own processor implementation, or extend theStandardErrorAttachmentListProcessor
.- Specified by:
collectResult
in interfaceIResolvedAttachmentList
- Type Parameters:
R
- Type of the combined result of all attachment items.E
- Type of the error that may be thrown when anyerrors
are present.- Parameters:
handler
- Handler for processing the errors and the results.- Returns:
- The combined result of all attachment items.
- Throws:
E
- The first error thrown by the handler.E extends Throwable
-
getErrors
public Map<EAttachmentItemResolutionError,List<AAttachmentListResolutionError>> getErrors()
- Specified by:
getErrors
in interfaceIAttachmentItemResolutionErrorProviding
- Returns:
- All errors that occurred during the attachment item's resolution.
-
getAttachmentList
public IReferencedAttachmentList getAttachmentList()
- Specified by:
getAttachmentList
in interfaceIResolvedAttachmentList
- Returns:
- The attachment list that was resolved to obtain this result.
-
getAttachmentItems
public List<IResolvedAttachmentItem> getAttachmentItems()
Description copied from interface:IResolvedAttachmentList
Retrieves the list of resolved attachment items. This list always contains one entry for eachAttachmentItem
that was passed toresolveReferencedAttachments
, independent of whether any exceptions occurred while resolving that item. WhenIAttachmentItemResolutionErrorProviding.getErrors()
is notnull
, this list is empty.- Specified by:
getAttachmentItems
in interfaceIResolvedAttachmentList
- Returns:
- A list with the resolved attachments.
-
ofError
public static IResolvedAttachmentList ofError(AAttachmentListResolutionError.CannotProcessAttachmentList error)
Creates a new POJO with the given data and no containing directory and attachments.- Parameters:
error
- Value as returned bygetErrors()
.- Returns:
- New resolved attachment list for the given error.
-
ofSuccess
public static IResolvedAttachmentList ofSuccess(IReferencedAttachmentList attachmentList, List<IResolvedAttachmentItem> resourceItems)
Creates a new POJO with the given data and thegetErrors()
set tonull
.- Parameters:
attachmentList
- Original attachment list that was processed.resourceItems
- Value as returned bygetAttachmentItems()
.- Returns:
- New resolved attachment list for the given resolved items.
-
-