-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DirectHandler
A handler that is invoked when a response is sent outside of routing. SeeDirectHandler.EventType
to see which types of events are covered by this handler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DirectHandler.EventType
Types of events that can be triggered outside of routing that immediately return a response.static interface
DirectHandler.TransportRequest
Request information.static class
DirectHandler.TransportResponse
Response to correctly reply to the original client.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description 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.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 Detail
-
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
-
-