类 RequestHandledEvent

java.lang.Object
java.util.EventObject
cn.taketoday.context.ApplicationEvent
cn.taketoday.web.context.support.RequestHandledEvent
所有已实现的接口:
Serializable

public class RequestHandledEvent extends cn.taketoday.context.ApplicationEvent
Event raised when a request is handled within an ApplicationContext.
从以下版本开始:
4.0 2022/4/15 13:16
作者:
Rod Johnson, Juergen Hoeller, Harry Yang
另请参阅:
  • ApplicationEventPublisher.publishEvent(cn.taketoday.context.ApplicationEvent)
  • 序列化表格
  • 字段详细资料

    • sessionId

      @Nullable private final String sessionId
      Session id that applied to the request, if any.
    • userName

      @Nullable private final String userName
      Usually the UserPrincipal.
    • processingTimeMillis

      private final long processingTimeMillis
      Request processing time.
    • notHandled

      @Nullable private Throwable notHandled
      Cause of failure, if any.
    • requestUrl

      private final String requestUrl
      URL that triggered the request.
    • clientAddress

      private final String clientAddress
      IP address that the request came from.
    • method

      private final String method
      Usually GET or POST.
    • statusCode

      private final int statusCode
      HTTP status code of the response.
  • 构造器详细资料

    • RequestHandledEvent

      public RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis)
      Create a new RequestHandledEvent.
      参数:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
    • RequestHandledEvent

      public RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis, @Nullable Throwable notHandled)
      Create a new RequestHandledEvent.
      参数:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
      notHandled - the cause of failure, if any
    • RequestHandledEvent

      public RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis, @Nullable Throwable notHandled, int statusCode)
      Create a new RequestHandledEvent.
      参数:
      source - the component that published the event
      requestUrl - the URL of the request
      clientAddress - the IP address that the request came from
      method - the HTTP method of the request (usually GET or POST)
      sessionId - the id of the HTTP session, if any
      userName - the name of the user that was associated with the request, if any (usually the UserPrincipal)
      processingTimeMillis - the processing time of the request in milliseconds
      notHandled - the cause of failure, if any
      statusCode - the HTTP status code of the response
  • 方法详细资料

    • getProcessingTimeMillis

      public long getProcessingTimeMillis()
      Return the processing time of the request in milliseconds.
    • getSessionId

      @Nullable public String getSessionId()
      Return the id of the HTTP session, if any.
    • getUserName

      @Nullable public String getUserName()
      Return the name of the user that was associated with the request (usually the UserPrincipal).
      另请参阅:
    • wasFailure

      public boolean wasFailure()
      Return whether the request failed.
    • getFailureCause

      @Nullable public Throwable getFailureCause()
      Return the cause of failure, if any.
    • getRequestUrl

      public String getRequestUrl()
      Return the URL of the request.
    • getClientAddress

      public String getClientAddress()
      Return the IP address that the request came from.
    • getMethod

      public String getMethod()
      Return the HTTP method of the request (usually GET or POST).
    • getStatusCode

      public int getStatusCode()
      Return the HTTP status code of the response or -1 if the status code is not available.
    • getShortDescription

      public String getShortDescription()
      Return a short description of this event, only involving the most important context data.
    • getDescription

      public String getDescription()
      Return a full description of this event, involving all available context data.
    • toString

      public String toString()
      覆盖:
      toString 在类中 EventObject