类 HttpExchange
java.lang.Object
org.springframework.boot.actuate.web.exchanges.HttpExchange
An HTTP request and response exchange. Can be used for analyzing contextual information
such as HTTP headers. Data from this class will be exposed by the
HttpExchangesEndpoint
, usually as JSON.- 从以下版本开始:
- 3.0.0
- 作者:
- Dave Syer, Andy Wilkinson, Phillip Webb
-
嵌套类概要
嵌套类修饰符和类型类说明static final class
Principal associated with an HTTP request-response exchange.static final class
The request that started the exchange.static final class
The response that finished the exchange.static final class
The session associated with the exchange.static final class
A started request that whenfinished
will return a newHttpExchange
instance. -
构造器概要
构造器构造器说明HttpExchange
(Instant timestamp, HttpExchange.Request request, HttpExchange.Response response, HttpExchange.Principal principal, HttpExchange.Session session, Duration timeTaken) Primarily for use byHttpExchangeRepository
implementations when recreating an exchange from a persistent store. -
方法概要
修饰符和类型方法说明Returns the principal.Returns the request that started the exchange.Returns the response that completed the exchange.Returns the session details.Returns the instant that the exchange started.Returns the total time taken for the exchange.static HttpExchange.Started
start
(Clock clock, RecordableHttpRequest request) Start a newHttpExchange.Started
from the given source request.static HttpExchange.Started
start
(RecordableHttpRequest request) Start a newHttpExchange.Started
from the given source request.
-
构造器详细资料
-
HttpExchange
public HttpExchange(Instant timestamp, HttpExchange.Request request, HttpExchange.Response response, HttpExchange.Principal principal, HttpExchange.Session session, Duration timeTaken) Primarily for use byHttpExchangeRepository
implementations when recreating an exchange from a persistent store.- 参数:
timestamp
- the instant that the exchange startedrequest
- the requestresponse
- the responseprincipal
- the principalsession
- the sessiontimeTaken
- the total time taken
-
-
方法详细资料
-
getTimestamp
Returns the instant that the exchange started.- 返回:
- the start timestamp
-
getRequest
Returns the request that started the exchange.- 返回:
- the request.
-
getResponse
Returns the response that completed the exchange.- 返回:
- the response.
-
getPrincipal
Returns the principal.- 返回:
- the request
-
getSession
Returns the session details.- 返回:
- the session
-
getTimeTaken
Returns the total time taken for the exchange.- 返回:
- the total time taken
-
start
Start a newHttpExchange.Started
from the given source request.- 参数:
request
- the recordable HTTP request- 返回:
- an in-progress request
-
start
Start a newHttpExchange.Started
from the given source request.- 参数:
clock
- the clock to userequest
- the recordable HTTP request- 返回:
- an in-progress request
-