Class DefaultFulfillRequestedUploadRequest
- java.lang.Object
-
- de.xima.fc.common.form_record.chat.DefaultFulfillRequestedUploadRequest
-
- All Implemented Interfaces:
IFulfillRequestedUploadRequest
,Serializable
public final class DefaultFulfillRequestedUploadRequest extends Object implements IFulfillRequestedUploadRequest
Simple POJO implementation ofIFulfillRequestedUploadRequest
with a builder.- Since:
- 8.2.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self extends DefaultFulfillRequestedUploadRequest.BaseBuilder<Request,Self>>
Builder for the data needed to fulfill a pending upload request.static class
DefaultFulfillRequestedUploadRequest.Builder
Builder for anIFulfillRequestedUploadRequest
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EAttachmentSource
attachmentSource()
Applies only when theupload request
does not reference anupload element
.UUID
enforceChatUuid()
When given, enforces that theIFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given chat UUID, i.e.boolean
enforceExplicitContentType()
When true, enforces that thefiles
have an explicit content type.boolean
enforceMatchingUser()
UUID
enforceMessageUuid()
When given, enforces that theIFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given message UUID, i.e.List<ISerializableFile>
files()
The files to use for fulfilling the upload request.static DefaultFulfillRequestedUploadRequest.Builder
fulfillUploadRequestBuilder(FormRecordMessageUploadRequest uploadRequest)
Creates a new builder for the data need to fulfill a pending upload request.static DefaultFulfillRequestedUploadRequest.Builder
fulfillUploadRequestBuilder(UUID uploadRequestUuid)
Creates a new builder for the data need to fulfill a pending upload request.boolean
initializeResponse()
When true, initializes all fields in the response entities (i.e.boolean
makeFilesAccessibleToEndUser()
Whether to make the newly created attachments accessible to the end user.IUser
oathKeeper()
The user who provided the upload to fulfill the request.UUID
uploadRequestUuid()
The UUID of apending
upload request.
-
-
-
Method Detail
-
attachmentSource
public EAttachmentSource attachmentSource()
Description copied from interface:IFulfillRequestedUploadRequest
Applies only when theupload request
does not reference anupload element
. Thesource
of the attachments to create. Defaults toUNKNOWN
. Note that when the upload request references an upload element, the source is always set toFORM_UPLOAD
.- Specified by:
attachmentSource
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The source of the attachments to create.
-
enforceChatUuid
public UUID enforceChatUuid()
Description copied from interface:IFulfillRequestedUploadRequest
When given, enforces that theIFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given chat UUID, i.e. that the chat contains the upload request.- Specified by:
enforceChatUuid
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The UUID of the message to enforce.
-
enforceExplicitContentType
public boolean enforceExplicitContentType()
Description copied from interface:IFulfillRequestedUploadRequest
When true, enforces that thefiles
have an explicit content type. Defaults to false.- Specified by:
enforceExplicitContentType
in interfaceIFulfillRequestedUploadRequest
- Returns:
- Whether to enforce that the files have an explicit content type.
-
enforceMatchingUser
public boolean enforceMatchingUser()
Description copied from interface:IFulfillRequestedUploadRequest
When true, enforces that theuser
fulfilling the request matches one ofmembers
of the chat containing the message with the upload request. Defaults to false.- Specified by:
enforceMatchingUser
in interfaceIFulfillRequestedUploadRequest
- Returns:
- When true, enforces that the user fulfilling the request matches one of the chat members.
-
enforceMessageUuid
public UUID enforceMessageUuid()
Description copied from interface:IFulfillRequestedUploadRequest
When given, enforces that theIFulfillRequestedUploadRequest.uploadRequestUuid()
matches the given message UUID, i.e. that the message contains the upload request.- Specified by:
enforceMessageUuid
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The UUID of the message to enforce.
-
files
public List<ISerializableFile> files()
Description copied from interface:IFulfillRequestedUploadRequest
The files to use for fulfilling the upload request. When the files do not have an explicit content type, attempts to guess the type, unless an explicit content type isenforced
.- Specified by:
files
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The files to use for fulfilling the upload request.
-
initializeResponse
public boolean initializeResponse()
Description copied from interface:IFulfillRequestedUploadRequest
When true, initializes all fields in the response entities (i.e. ensures referenced child entities are loaded from the database). Defaults to false.- Specified by:
initializeResponse
in interfaceIFulfillRequestedUploadRequest
- Returns:
- When true, initializes all fields in the response entities.
-
makeFilesAccessibleToEndUser
public boolean makeFilesAccessibleToEndUser()
Description copied from interface:IFulfillRequestedUploadRequest
Whether to make the newly created attachments accessible to the end user. Defaults to false.- Specified by:
makeFilesAccessibleToEndUser
in interfaceIFulfillRequestedUploadRequest
- Returns:
- Whether to make the newly created attachments accessible to the end user.
-
oathKeeper
public IUser oathKeeper()
Description copied from interface:IFulfillRequestedUploadRequest
The user who provided the upload to fulfill the request. Uses an (unspecified) default when not given.- Specified by:
oathKeeper
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The user who provided the upload to fulfill the request.
-
uploadRequestUuid
public UUID uploadRequestUuid()
Description copied from interface:IFulfillRequestedUploadRequest
The UUID of apending
upload request. Since the UUID must be globally unique within the system, this is sufficient to identify the request.- Specified by:
uploadRequestUuid
in interfaceIFulfillRequestedUploadRequest
- Returns:
- The UUID of the upload request.
-
fulfillUploadRequestBuilder
public static DefaultFulfillRequestedUploadRequest.Builder fulfillUploadRequestBuilder(UUID uploadRequestUuid)
Creates a new builder for the data need to fulfill a pending upload request.- Parameters:
uploadRequestUuid
- The UUID of the pending upload request.- Returns:
- A new builder for the data need to fulfill a pending upload request.
-
fulfillUploadRequestBuilder
public static DefaultFulfillRequestedUploadRequest.Builder fulfillUploadRequestBuilder(FormRecordMessageUploadRequest uploadRequest)
Creates a new builder for the data need to fulfill a pending upload request.- Parameters:
uploadRequest
- The pending upload request.- Returns:
- A new builder for the data need to fulfill a pending upload request.
-
-