public class RejectionHandlerBuilder
extends java.lang.Object
Constructor and Description |
---|
RejectionHandlerBuilder(RejectionHandler.Builder asScala) |
Modifier and Type | Method and Description |
---|---|
RejectionHandler |
build() |
<T extends Rejection> |
handle(java.lang.Class<T> t,
java.util.function.Function<T,Route> handler)
Handles a single
Rejection with the given function. |
<T extends Rejection> |
handleAll(java.lang.Class<T> t,
java.util.function.Function<java.util.List<T>,Route> handler)
Handles several Rejections of the same type at the same time.
|
RejectionHandlerBuilder |
handleCircuitBreakerOpenRejection(java.util.function.Function<CircuitBreakerOpenRejection,Route> handler)
Convenience method for handling rejections created by created by the onCompleteWithBreaker directive.
|
RejectionHandlerBuilder |
handleNotFound(Route route)
Handles the special "not found" case using the given
Route . |
public RejectionHandlerBuilder(RejectionHandler.Builder asScala)
public RejectionHandler build()
public <T extends Rejection> RejectionHandlerBuilder handle(java.lang.Class<T> t, java.util.function.Function<T,Route> handler)
Rejection
with the given function.t
- (undocumented)handler
- (undocumented)public <T extends Rejection> RejectionHandlerBuilder handleAll(java.lang.Class<T> t, java.util.function.Function<java.util.List<T>,Route> handler)
t
- (undocumented)handler
- (undocumented)public RejectionHandlerBuilder handleCircuitBreakerOpenRejection(java.util.function.Function<CircuitBreakerOpenRejection,Route> handler)
Use to customise the error response being written instead of the default pekko.http.javadsl.model.StatusCodes.SERVICE_UNAVAILABLE
response.
handler
- (undocumented)public RejectionHandlerBuilder handleNotFound(Route route)
Route
.route
- (undocumented)