Package akka.http.scaladsl.server
Class RejectionHandler.Builder
- java.lang.Object
-
- akka.http.scaladsl.server.RejectionHandler.Builder
-
- Enclosing interface:
- RejectionHandler
public static final class RejectionHandler.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder(boolean isDefault)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RejectionHandler.Builder
handle(scala.PartialFunction<Rejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> pf)
Handles a singleRejection
with the given partial function.<T extends Rejection>
RejectionHandler.BuilderhandleAll(scala.Function1<scala.collection.immutable.Seq<T>,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> f, scala.reflect.ClassTag<T> evidence$1)
Handles several Rejections of the same type at the same time.RejectionHandler.Builder
handleCircuitBreakerOpenRejection(scala.Function1<CircuitBreakerOpenRejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> handler)
Convenience method for handling rejections created by the onCompleteWithBreaker directive.RejectionHandler.Builder
handleNotFound(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route)
Handles the special "not found" case using the givenRoute
.RejectionHandler
result()
-
-
-
Method Detail
-
handle
public RejectionHandler.Builder handle(scala.PartialFunction<Rejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> pf)
Handles a singleRejection
with the given partial function.- Parameters:
pf
- (undocumented)- Returns:
- (undocumented)
-
handleAll
public <T extends Rejection> RejectionHandler.Builder handleAll(scala.Function1<scala.collection.immutable.Seq<T>,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> f, scala.reflect.ClassTag<T> evidence$1)
Handles several Rejections of the same type at the same time. The seq passed to the given function is guaranteed to be non-empty.- Parameters:
f
- (undocumented)evidence$1
- (undocumented)- Returns:
- (undocumented)
-
handleCircuitBreakerOpenRejection
public RejectionHandler.Builder handleCircuitBreakerOpenRejection(scala.Function1<CircuitBreakerOpenRejection,scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>> handler)
Convenience method for handling rejections created by the onCompleteWithBreaker directive. Signals that the request was rejected because the supplied circuit breaker is open and requests are failing fast.Use to customise the error response being written instead of the default
ServiceUnavailable
response.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handleNotFound
public RejectionHandler.Builder handleNotFound(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route)
Handles the special "not found" case using the givenRoute
.- Parameters:
route
- (undocumented)- Returns:
- (undocumented)
-
result
public RejectionHandler result()
-
-