Interface HttpResponseMapper
- All Known Implementing Classes:
StandardHttpResponseMapper
public interface HttpResponseMapper
An HttpResponseMapper is responsible for taking the responses from all nodes in a cluster and distilling them down to a single response that would be appropriate to respond with, to the user/client who made the original web requests.
-
Method Summary
Modifier and TypeMethodDescriptiongetProblematicNodeResponses
(Set<NodeResponse> allResponses) Returns a subset (or equal set) of the given Node Responses, such that all of those returned are the responses that indicate that the node was unable to fulfill the requestboolean
isResponseInterpreted
(URI uri, String httpMethod) Indicates whether or not the responses from nodes for the given URI invalid input: '&' HTTP method must be interpreted in order to merge themmapResponses
(URI uri, String httpMethod, Set<NodeResponse> nodeResponses, boolean merge) Maps the responses from all nodes in the cluster to a single NodeResponse object that is appropriate to respond with
-
Method Details
-
mapResponses
NodeResponse mapResponses(URI uri, String httpMethod, Set<NodeResponse> nodeResponses, boolean merge) Maps the responses from all nodes in the cluster to a single NodeResponse object that is appropriate to respond with- Parameters:
uri
- the URI of the web request that was madehttpMethod
- the HTTP Method that was used when making the requestnodeResponses
- the responses received from the individual nodes- Returns:
- a single NodeResponse that represents the response that should be returned to the user/client
-
getProblematicNodeResponses
Returns a subset (or equal set) of the given Node Responses, such that all of those returned are the responses that indicate that the node was unable to fulfill the request- Parameters:
allResponses
- the responses to filter- Returns:
- a subset (or equal set) of the given Node Responses, such that all of those returned are the responses that indicate that the node was unable to fulfill the request
-
isResponseInterpreted
Indicates whether or not the responses from nodes for the given URI invalid input: '&' HTTP method must be interpreted in order to merge them- Parameters:
uri
- the URI of the requesthttpMethod
- the HTTP Method of the request- Returns:
true
if the response must be interpreted,false
otherwise
-