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
Nested ClassesModifier and TypeClassDescriptionstatic classThis inner class adapts a HttpServletRequest to a PrometheusHttpRequest.static classThis inner class adapts a HttpServletResponse to a PrometheusHttpResponse. -
Constructor Summary
ConstructorsConstructorDescriptionHttpExchangeAdapter(HttpServletRequest request, HttpServletResponse response) Constructs a new HttpExchangeAdapter with the given HttpServletRequest and HttpServletResponse. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the adapted HttpServletRequest.Returns the adapted HttpServletResponse.voidvoid
-
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:
getRequestin interfacePrometheusHttpExchange- Returns:
- the adapted HttpServletRequest
-
getResponse
Returns the adapted HttpServletResponse.- Specified by:
getResponsein interfacePrometheusHttpExchange- Returns:
- the adapted HttpServletResponse
-
handleException
- Specified by:
handleExceptionin interfacePrometheusHttpExchange- Throws:
IOException
-
handleException
- Specified by:
handleExceptionin interfacePrometheusHttpExchange
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacePrometheusHttpExchange
-