类 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 classPrincipal associated with an HTTP request-response exchange.static final classThe request that started the exchange.static final classThe response that finished the exchange.static final classThe session associated with the exchange.static final classA started request that whenfinishedwill return a newHttpExchangeinstance. -
构造器概要
构造器构造器说明HttpExchange(Instant timestamp, HttpExchange.Request request, HttpExchange.Response response, HttpExchange.Principal principal, HttpExchange.Session session, Duration timeTaken) Primarily for use byHttpExchangeRepositoryimplementations 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.Startedstart(Clock clock, RecordableHttpRequest request) Start a newHttpExchange.Startedfrom the given source request.static HttpExchange.Startedstart(RecordableHttpRequest request) Start a newHttpExchange.Startedfrom 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 byHttpExchangeRepositoryimplementations 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.Startedfrom the given source request.- 参数:
request- the recordable HTTP request- 返回:
- an in-progress request
-
start
Start a newHttpExchange.Startedfrom the given source request.- 参数:
clock- the clock to userequest- the recordable HTTP request- 返回:
- an in-progress request
-