Package io.camunda.client.impl.command
Class CreateDocumentCommandImpl
java.lang.Object
io.camunda.client.impl.util.DocumentBuilder
io.camunda.client.impl.command.CreateDocumentCommandImpl
- All Implemented Interfaces:
CreateDocumentCommandStep1,CreateDocumentCommandStep1.CreateDocumentCommandStep2,DocumentBuilderStep1,DocumentBuilderStep1.DocumentBuilderStep2,FinalCommandStep<DocumentReferenceResponse>
@ExperimentalApi("https://github.com/camunda/issues/issues/841")
public class CreateDocumentCommandImpl
extends DocumentBuilder
implements CreateDocumentCommandStep1, CreateDocumentCommandStep1.CreateDocumentCommandStep2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.api.command.CreateDocumentCommandStep1
CreateDocumentCommandStep1.CreateDocumentCommandStep2Nested classes/interfaces inherited from interface io.camunda.client.api.command.DocumentBuilderStep1
DocumentBuilderStep1.DocumentBuilderStep2 -
Constructor Summary
ConstructorsConstructorDescriptionCreateDocumentCommandImpl(JsonMapper jsonMapper, HttpClient httpClient, CamundaClientConfiguration configuration) -
Method Summary
Modifier and TypeMethodDescriptioncontent(byte[] content) Sets the content of the document.content(InputStream content) Sets the content of the document.Sets the content of the document.contentType(String contentType) Sets the content type of the document.customMetadata(String key, Object value) Adds a custom key-value pair to the document metadata.customMetadata(Map<String, Object> customMetadata) Adds custom key-value pairs to the document metadata.documentId(String documentId) Sets the document ID.Sets the file name of the document.processDefinitionId(String processDefinitionId) Sets the process definition that the document is associated with.processInstanceKey(long processInstanceKey) Sets the process instance key that the document is associated with.requestTimeout(Duration requestTimeout) Sets the request timeout for the command.send()Sends the command to the Camunda gateway.Sets the store ID.timeToLive(Duration timeToLive) Sets the time-to-live of the document.Methods inherited from class io.camunda.client.impl.util.DocumentBuilder
getContent, getMetadataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.client.api.command.FinalCommandStep
execute
-
Constructor Details
-
CreateDocumentCommandImpl
public CreateDocumentCommandImpl(JsonMapper jsonMapper, HttpClient httpClient, CamundaClientConfiguration configuration)
-
-
Method Details
-
requestTimeout
Description copied from interface:FinalCommandStepSets the request timeout for the command. The default request timeout can be configured usingCamundaClientBuilder.defaultRequestTimeout(Duration).- Specified by:
requestTimeoutin interfaceFinalCommandStep<DocumentReferenceResponse>- Parameters:
requestTimeout- the request timeout- Returns:
- the configured command
-
send
Description copied from interface:FinalCommandStepSends the command to the Camunda gateway. This operation is asynchronous. In case of success, the future returns the event that was generated by the Camunda gateway in response to the command.Call
CamundaFuture.join()to wait until the response is available.Future<JobEventinvalid input: '>' future = command.send(); JobEvent event = future.join();- Specified by:
sendin interfaceFinalCommandStep<DocumentReferenceResponse>- Returns:
- a future tracking state of success/failure of the command.
-
content
Description copied from interface:DocumentBuilderStep1Sets the content of the document.- Specified by:
contentin interfaceCreateDocumentCommandStep1- Specified by:
contentin interfaceDocumentBuilderStep1- Overrides:
contentin classDocumentBuilder- Parameters:
content- the content of the document as stream
-
content
Description copied from interface:DocumentBuilderStep1Sets the content of the document.- Specified by:
contentin interfaceCreateDocumentCommandStep1- Specified by:
contentin interfaceDocumentBuilderStep1- Overrides:
contentin classDocumentBuilder- Parameters:
content- the content of the document as byte array
-
content
Description copied from interface:DocumentBuilderStep1Sets the content of the document.- Specified by:
contentin interfaceCreateDocumentCommandStep1- Specified by:
contentin interfaceDocumentBuilderStep1- Overrides:
contentin classDocumentBuilder- Parameters:
content- the content of the document as string
-
contentType
Description copied from interface:DocumentBuilderStep1.DocumentBuilderStep2Sets the content type of the document.- Specified by:
contentTypein interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Specified by:
contentTypein interfaceDocumentBuilderStep1.DocumentBuilderStep2- Overrides:
contentTypein classDocumentBuilder- Parameters:
contentType- the content type of the document
-
fileName
Description copied from interface:DocumentBuilderStep1.DocumentBuilderStep2Sets the file name of the document.- Specified by:
fileNamein interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Specified by:
fileNamein interfaceDocumentBuilderStep1.DocumentBuilderStep2- Overrides:
fileNamein classDocumentBuilder- Parameters:
name- the file name of the document
-
timeToLive
Description copied from interface:DocumentBuilderStep1.DocumentBuilderStep2Sets the time-to-live of the document. The document will be automatically deleted after the time-to-live is exceeded.Depending on the document store, a maximum and a default time-to-live strategy may be enforced.
- Specified by:
timeToLivein interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Specified by:
timeToLivein interfaceDocumentBuilderStep1.DocumentBuilderStep2- Overrides:
timeToLivein classDocumentBuilder- Parameters:
timeToLive- the time-to-live of the document
-
customMetadata
public CreateDocumentCommandStep1.CreateDocumentCommandStep2 customMetadata(String key, Object value) Description copied from interface:DocumentBuilderStep1.DocumentBuilderStep2Adds a custom key-value pair to the document metadata.- Specified by:
customMetadatain interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Specified by:
customMetadatain interfaceDocumentBuilderStep1.DocumentBuilderStep2- Overrides:
customMetadatain classDocumentBuilder- Parameters:
key- custom metadata keyvalue- custom metadata value
-
customMetadata
public CreateDocumentCommandStep1.CreateDocumentCommandStep2 customMetadata(Map<String, Object> customMetadata) Description copied from interface:DocumentBuilderStep1.DocumentBuilderStep2Adds custom key-value pairs to the document metadata.- Specified by:
customMetadatain interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Specified by:
customMetadatain interfaceDocumentBuilderStep1.DocumentBuilderStep2- Overrides:
customMetadatain classDocumentBuilder- Parameters:
customMetadata- custom metadata key-value pairs
-
documentId
Description copied from interface:CreateDocumentCommandStep1.CreateDocumentCommandStep2Sets the document ID. If not set, the document ID will be generated by the document store.The document ID must be unique within the store. If a document with the same ID already exists, the request will fail.
A custom document ID can be used to prevent duplicate documents from being created in an environment where requests can be retried (e.g. job workers).
- Specified by:
documentIdin interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Parameters:
documentId- the document ID
-
storeId
Description copied from interface:CreateDocumentCommandStep1.CreateDocumentCommandStep2Sets the store ID. If not set, the default store will be used.The store ID is the identifier of the document store where the document should be stored. Documents with the same ID can exist in different stores.
- Specified by:
storeIdin interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Parameters:
storeId- the store ID
-
processDefinitionId
public CreateDocumentCommandStep1.CreateDocumentCommandStep2 processDefinitionId(String processDefinitionId) Description copied from interface:CreateDocumentCommandStep1.CreateDocumentCommandStep2Sets the process definition that the document is associated with.- Specified by:
processDefinitionIdin interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Parameters:
processDefinitionId- the process definition ID
-
processInstanceKey
public CreateDocumentCommandStep1.CreateDocumentCommandStep2 processInstanceKey(long processInstanceKey) Description copied from interface:CreateDocumentCommandStep1.CreateDocumentCommandStep2Sets the process instance key that the document is associated with.- Specified by:
processInstanceKeyin interfaceCreateDocumentCommandStep1.CreateDocumentCommandStep2- Parameters:
processInstanceKey- the process instance key
-