Package io.wcm.caravan.pipeline
Interface JsonPipelineOutput
-
@ProviderType public interface JsonPipelineOutput
The immutable output of aJsonPipeline
's processing step: the main JSON content payload, and additional metadata about the status and cachability of the content.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getCorrelationId()
int
getMaxAge()
com.fasterxml.jackson.databind.JsonNode
getPayload()
List<io.wcm.caravan.io.http.request.CaravanHttpRequest>
getRequests()
int
getStatusCode()
JsonPipelineOutput
withMaxAge(int newMaxAge)
JsonPipelineOutput
withPayload(com.fasterxml.jackson.databind.JsonNode newPayload)
JsonPipelineOutput
withStatusCode(int newStatusCode)
-
-
-
Method Detail
-
getPayload
com.fasterxml.jackson.databind.JsonNode getPayload()
- Returns:
- the JSON content
-
getStatusCode
int getStatusCode()
- Returns:
- the HTTP status code
-
getMaxAge
int getMaxAge()
- Returns:
- the duration in seconds for which the content can be stored in cache, before it should be re-validated
-
getCorrelationId
String getCorrelationId()
- Returns:
- the correlation ID from the incoming HTTP request header
-
getRequests
List<io.wcm.caravan.io.http.request.CaravanHttpRequest> getRequests()
- Returns:
- the requests that produced this output
-
withPayload
JsonPipelineOutput withPayload(com.fasterxml.jackson.databind.JsonNode newPayload)
- Parameters:
newPayload
- the JSON output- Returns:
- a new instance with the same metadata, but new JSON content
-
withStatusCode
JsonPipelineOutput withStatusCode(int newStatusCode)
- Parameters:
newStatusCode
- the HTTP response status code to return to clients- Returns:
- a new instance with the same JSON content but updated metadata
-
withMaxAge
JsonPipelineOutput withMaxAge(int newMaxAge)
- Parameters:
newMaxAge
- for how many seconds can the response be cached- Returns:
- a new instance with the same JSON content but updated metadata
-
-