类 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)- 序列化表格
-
字段概要
字段修饰符和类型字段说明private final StringIP address that the request came from.private final StringUsually GET or POST.private ThrowableCause of failure, if any.private final longRequest processing time.private final StringURL that triggered the request.private final StringSession id that applied to the request, if any.private final intHTTP status code of the response.private final StringUsually the UserPrincipal.从类继承的字段 java.util.EventObject
source -
构造器概要
构造器构造器说明RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String sessionId, String userName, long processingTimeMillis) Create a new RequestHandledEvent.RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String sessionId, String userName, long processingTimeMillis, Throwable notHandled) Create a new RequestHandledEvent.RequestHandledEvent(Object source, String requestUrl, String clientAddress, String method, String sessionId, String userName, long processingTimeMillis, Throwable notHandled, int statusCode) Create a new RequestHandledEvent. -
方法概要
修饰符和类型方法说明Return the IP address that the request came from.Return a full description of this event, involving all available context data.Return the cause of failure, if any.Return the HTTP method of the request (usually GET or POST).longReturn the processing time of the request in milliseconds.Return the URL of the request.Return the id of the HTTP session, if any.Return a short description of this event, only involving the most important context data.intReturn the HTTP status code of the response or -1 if the status code is not available.Return the name of the user that was associated with the request (usually the UserPrincipal).toString()booleanReturn whether the request failed.从类继承的方法 cn.taketoday.context.ApplicationEvent
getTimestamp从类继承的方法 java.util.EventObject
getSource
-
字段详细资料
-
sessionId
Session id that applied to the request, if any. -
userName
Usually the UserPrincipal. -
processingTimeMillis
private final long processingTimeMillisRequest processing time. -
notHandled
Cause of failure, if any. -
requestUrl
URL that triggered the request. -
clientAddress
IP address that the request came from. -
method
Usually GET or POST. -
statusCode
private final int statusCodeHTTP 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 eventrequestUrl- the URL of the requestclientAddress- the IP address that the request came frommethod- the HTTP method of the request (usually GET or POST)sessionId- the id of the HTTP session, if anyuserName- 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 eventrequestUrl- the URL of the requestclientAddress- the IP address that the request came frommethod- the HTTP method of the request (usually GET or POST)sessionId- the id of the HTTP session, if anyuserName- the name of the user that was associated with the request, if any (usually the UserPrincipal)processingTimeMillis- the processing time of the request in millisecondsnotHandled- 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 eventrequestUrl- the URL of the requestclientAddress- the IP address that the request came frommethod- the HTTP method of the request (usually GET or POST)sessionId- the id of the HTTP session, if anyuserName- the name of the user that was associated with the request, if any (usually the UserPrincipal)processingTimeMillis- the processing time of the request in millisecondsnotHandled- the cause of failure, if anystatusCode- the HTTP status code of the response
-
-
方法详细资料
-
getProcessingTimeMillis
public long getProcessingTimeMillis()Return the processing time of the request in milliseconds. -
getSessionId
Return the id of the HTTP session, if any. -
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
Return the cause of failure, if any. -
getRequestUrl
Return the URL of the request. -
getClientAddress
Return the IP address that the request came from. -
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
Return a short description of this event, only involving the most important context data. -
getDescription
Return a full description of this event, involving all available context data. -
toString
- 覆盖:
toString在类中EventObject
-