Package com.github.ambry.frontend
Class StitchRequestSerDe
- java.lang.Object
-
- com.github.ambry.frontend.StitchRequestSerDe
-
public class StitchRequestSerDe extends java.lang.Object
Methods to serialize and deserialize the body of a stitch request. The body of the request should be a JSON object that contains an array field with the key, "signedChunkIds". Each element of the array should be a signed ID produced by anIdSigningService
implementation representing a data chunk to be stitched together. The order of the IDs in the array will be the order in which the data chunks are stitched. For example:{ "signedChunkIds": ["/signedId/id1", "/signedId/id2", "..."] }
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>
fromJson(org.json.JSONObject stitchRequestJson)
static org.json.JSONObject
toJson(java.util.List<java.lang.String> signedChunkIds)
-
-
-
Method Detail
-
toJson
public static org.json.JSONObject toJson(java.util.List<java.lang.String> signedChunkIds)
- Parameters:
signedChunkIds
- the list of signed chunk IDs to stitch together.- Returns:
- a
JSONObject
representing the request.
-
fromJson
public static java.util.List<java.lang.String> fromJson(org.json.JSONObject stitchRequestJson)
- Parameters:
stitchRequestJson
- the JSON object to extract the list of signed chunk IDs from.- Returns:
- a
List
that contains the signed chunk IDs to be stitched.
-
-