Class StandardHttpResponseMapper
java.lang.Object
org.apache.nifi.cluster.coordination.http.StandardHttpResponseMapper
- All Implemented Interfaces:
HttpResponseMapper
-
Field Summary
Modifier and TypeFieldDescriptionprivate final List
<EndpointResponseMerger> private org.slf4j.Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
drainResponse
(NodeResponse response) private void
drainResponses
(Set<NodeResponse> responses, NodeResponse exclude) private EndpointResponseMerger
getEndpointResponseMerger
(URI uri, String httpMethod) getProblematicNodeResponses
(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 requestprivate boolean
hasSuccessfulResponse
(Set<NodeResponse> allResponses) boolean
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
-
Field Details
-
logger
private org.slf4j.Logger logger -
endpointMergers
-
-
Constructor Details
-
StandardHttpResponseMapper
-
-
Method Details
-
mapResponses
public NodeResponse mapResponses(URI uri, String httpMethod, Set<NodeResponse> nodeResponses, boolean merge) Description copied from interface:HttpResponseMapper
Maps the responses from all nodes in the cluster to a single NodeResponse object that is appropriate to respond with- Specified by:
mapResponses
in interfaceHttpResponseMapper
- 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
Description copied from interface:HttpResponseMapper
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- Specified by:
getProblematicNodeResponses
in interfaceHttpResponseMapper
- 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
Description copied from interface:HttpResponseMapper
Indicates whether or not the responses from nodes for the given URI invalid input: '&' HTTP method must be interpreted in order to merge them- Specified by:
isResponseInterpreted
in interfaceHttpResponseMapper
- Parameters:
uri
- the URI of the requesthttpMethod
- the HTTP Method of the request- Returns:
true
if the response must be interpreted,false
otherwise
-
getEndpointResponseMerger
-
hasSuccessfulResponse
-
drainResponses
-
drainResponse
-