- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A handler that is invoked when a response is sent outside of routing.
See
DirectHandler.EventType
to see which types
of events are covered by this handler.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Types of events that can be triggered outside of routing that immediately return a response.static interface
Request information.static class
Response to correctly reply to the original client. -
Method Summary
Modifier and TypeMethodDescriptionhandle
(DirectHandler.TransportRequest request, DirectHandler.EventType eventType, Http.ResponseStatus defaultStatus, String message) Handler of responses that bypass routing, MUST NOT block the current thread.default DirectHandler.TransportResponse
handle
(DirectHandler.TransportRequest request, DirectHandler.EventType eventType, Http.ResponseStatus defaultStatus, Throwable t) Handler of responses that bypass routing, MUST NOT block the current thread.
-
Method Details
-
handle
default DirectHandler.TransportResponse handle(DirectHandler.TransportRequest request, DirectHandler.EventType eventType, Http.ResponseStatus defaultStatus, Throwable t) Handler of responses that bypass routing, MUST NOT block the current thread.This method should be used to return custom status, header and possible entity (retrieved without blocking). If there is a need to handle more details, please redirect the client to a proper endpoint to handle them.
- Parameters:
request
- request as received with as much known information as possibleeventType
- type of the eventdefaultStatus
- default status expected to be returnedt
- throwable caught as part of processing with possible additional details about the reason of failure- Returns:
- response to use to return to original request
-
handle
DirectHandler.TransportResponse handle(DirectHandler.TransportRequest request, DirectHandler.EventType eventType, Http.ResponseStatus defaultStatus, String message) Handler of responses that bypass routing, MUST NOT block the current thread.This method should be used to return custom status, header and possible entity (retrieved without blocking). If there is a need to handle more details, please redirect the client to a proper endpoint to handle them.
- Parameters:
request
- request as received with as much known information as possibleeventType
- type of the eventdefaultStatus
- default status expected to be returnedmessage
- message expected to be used as a response entity - may be an empty string (no entity expected), never null- Returns:
- response to use to return to original request
-