Interface ExternalPayloadStorage
public interface ExternalPayloadStorage
Interface used to externalize the storage of large JSON payloads in workflow and task
input/output
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionDownload the json payload from the specified external storage location.getLocation(ExternalPayloadStorage.Operation operation, ExternalPayloadStorage.PayloadType payloadType, String path) Obtain a uri used to store/access a json payload in external storage.default ExternalStorageLocationgetLocation(ExternalPayloadStorage.Operation operation, ExternalPayloadStorage.PayloadType payloadType, String path, byte[] payloadBytes) Obtain an uri used to store/access a json payload in external storage with deduplication of data based on payloadBytes digest.voidupload(String path, InputStream payload, long payloadSize) Upload a json payload to the specified external storage location.
-
Method Details
-
getLocation
ExternalStorageLocation getLocation(ExternalPayloadStorage.Operation operation, ExternalPayloadStorage.PayloadType payloadType, String path) Obtain a uri used to store/access a json payload in external storage.- Parameters:
operation- the type ofExternalPayloadStorage.Operationto be performed with the uripayloadType- theExternalPayloadStorage.PayloadTypethat is being accessed at the uripath- (optional) the relative path for which the external storage location object is to be populated. If path is not specified, it will be computed and populated.- Returns:
- a
ExternalStorageLocationobject which contains the uri and the path for the json payload
-
getLocation
default ExternalStorageLocation getLocation(ExternalPayloadStorage.Operation operation, ExternalPayloadStorage.PayloadType payloadType, String path, byte[] payloadBytes) Obtain an uri used to store/access a json payload in external storage with deduplication of data based on payloadBytes digest.- Parameters:
operation- the type ofExternalPayloadStorage.Operationto be performed with the uripayloadType- theExternalPayloadStorage.PayloadTypethat is being accessed at the uripath- (optional) the relative path for which the external storage location object is to be populated. If path is not specified, it will be computed and populated.payloadBytes- for calculating digest which is used for objectKey- Returns:
- a
ExternalStorageLocationobject which contains the uri and the path for the json payload
-
upload
Upload a json payload to the specified external storage location.- Parameters:
path- the location to which the object is to be uploadedpayload- anInputStreamcontaining the json payload which is to be uploadedpayloadSize- the size of the json payload in bytes
-
download
Download the json payload from the specified external storage location.- Parameters:
path- the location from where the object is to be downloaded- Returns:
- an
InputStreamof the json payload at the specified location
-