|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.internal.monitoring.RequestEventImpl
public class RequestEventImpl
Request event implementation. Instances are immutable.
| Nested Class Summary | |
|---|---|
static class |
RequestEventImpl.Builder
Builder of RequestEventImpl. |
| Nested classes/interfaces inherited from interface org.glassfish.jersey.server.monitoring.RequestEvent |
|---|
RequestEvent.ExceptionCause, RequestEvent.Type |
| Method Summary | |
|---|---|
ContainerRequest |
getContainerRequest()
Get the container request. |
Iterable<javax.ws.rs.container.ContainerRequestFilter> |
getContainerRequestFilters()
Get container request filters used during the request filtering
phase. |
ContainerResponse |
getContainerResponse()
Get the container response. |
Iterable<javax.ws.rs.container.ContainerResponseFilter> |
getContainerResponseFilters()
Get container response filters used during the response filtering
phase. |
Throwable |
getException()
Get the latest exception, if any, thrown by the request and response processing. |
RequestEvent.ExceptionCause |
getExceptionCause()
Get the exception cause. |
javax.ws.rs.ext.ExceptionMapper<?> |
getExceptionMapper()
Get the ExceptionMapper that was found and used during the exception mapping phase. |
RequestEvent.Type |
getType()
Returns the type of this event. |
ExtendedUriInfo |
getUriInfo()
Get the extended uri info associated with this request. |
boolean |
isResponseSuccessfullyMapped()
Returns true if the response was successfully mapped from an exception
by exception mappers. |
boolean |
isResponseWritten()
Returns true if the response has been successfully written. |
boolean |
isSuccess()
Return true if the request and response has been successfully processed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public ContainerRequest getContainerRequest()
RequestEventrequest event listener.
getContainerRequest in interface RequestEventpublic ContainerResponse getContainerResponse()
RequestEventevent types. The
returned response might vary also on the event type. The getter returns always the latest response being
processed. So, for example for event RequestEvent.Type.EXCEPTION_MAPPING_FINISHED event type the method
returns mapped response and not the original response created from execution of the resource method.
getContainerResponse in interface RequestEventnull if no response has been produced yet.public Throwable getException()
RequestEventRequestEvent.getExceptionCause() returns the origin of the exception.
getException in interface RequestEventnull if no exception has been thrown.public RequestEvent.Type getType()
RequestEventtype of this event.
getType in interface RequestEventpublic ExtendedUriInfo getUriInfo()
RequestEventextended uri info associated with this request. This method returns
null for RequestEvent.Type.START event. The returned ExtendedUriInfo can be used to retrieve
information relevant to many event types (especially event types describing the matching process).
getUriInfo in interface RequestEventnull if it is not available yet.public javax.ws.rs.ext.ExceptionMapper<?> getExceptionMapper()
RequestEventExceptionMapper that was found and used during the exception mapping phase.
getExceptionMapper in interface RequestEventnull if no exception mapper was found or even needed.public Iterable<javax.ws.rs.container.ContainerRequestFilter> getContainerRequestFilters()
RequestEventcontainer request filters used during the request filtering
phase.
getContainerRequestFilters in interface RequestEventnull if no filters were used yet.public Iterable<javax.ws.rs.container.ContainerResponseFilter> getContainerResponseFilters()
RequestEventcontainer response filters used during the response filtering
phase.
getContainerResponseFilters in interface RequestEventnull if no filters were used yet.public boolean isSuccess()
RequestEventtrue if the request and response has been successfully processed. Response is successfully
processed when the response code is smaller than 400 and response was successfully written. If the exception
occurred but was mapped into a response with successful response code and written, this method returns
true.
isSuccess in interface RequestEventpublic boolean isResponseSuccessfullyMapped()
RequestEventtrue if the response was successfully mapped from an exception
by exception mappers. When exception mapping phase failed or when
no exception was thrown at all the, the method returns false. This method is convenient when
handling the RequestEvent.Type.EXCEPTION_MAPPING_FINISHED event type.
isResponseSuccessfullyMapped in interface RequestEventpublic RequestEvent.ExceptionCause getExceptionCause()
RequestEventexception cause. This method is relevant only in cases when
RequestEvent.getException() returns non-null value (for example when handling RequestEvent.Type.ON_EXCEPTION)
event type.
getExceptionCause in interface RequestEventnull if no exception has occurred.public boolean isResponseWritten()
RequestEventtrue if the response has been successfully written. true is returned
even for cases when the written response contains error response code.
isResponseWritten in interface RequestEventtrue if the response was successfully written;false when the response
has not been written yet or when writing of response failed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||