Class HttpExchangeAdapter
Object
HttpExchangeAdapter
- All Implemented Interfaces:
PrometheusHttpExchange
,AutoCloseable
This class is an adapter for HTTP exchanges, implementing the PrometheusHttpExchange interface.
It wraps HttpServletRequest and HttpServletResponse objects into Request and Response inner
classes.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This inner class adapts a HttpServletRequest to a PrometheusHttpRequest.static class
This inner class adapts a HttpServletResponse to a PrometheusHttpResponse. -
Constructor Summary
ConstructorDescriptionHttpExchangeAdapter
(HttpServletRequest request, HttpServletResponse response) Constructs a new HttpExchangeAdapter with the given HttpServletRequest and HttpServletResponse. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the adapted HttpServletRequest.Returns the adapted HttpServletResponse.void
void
-
Constructor Details
-
HttpExchangeAdapter
Constructs a new HttpExchangeAdapter with the given HttpServletRequest and HttpServletResponse.- Parameters:
request
- the HttpServletRequest to be adaptedresponse
- the HttpServletResponse to be adapted
-
-
Method Details
-
getRequest
Returns the adapted HttpServletRequest.- Specified by:
getRequest
in interfacePrometheusHttpExchange
- Returns:
- the adapted HttpServletRequest
-
getResponse
Returns the adapted HttpServletResponse.- Specified by:
getResponse
in interfacePrometheusHttpExchange
- Returns:
- the adapted HttpServletResponse
-
handleException
- Specified by:
handleException
in interfacePrometheusHttpExchange
- Throws:
IOException
-
handleException
- Specified by:
handleException
in interfacePrometheusHttpExchange
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePrometheusHttpExchange
-