Interface RouteDirectives
-
- All Known Subinterfaces:
Directives
- All Known Implementing Classes:
Directives$,HttpApp,RouteDirectives$
public interface RouteDirectives
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> StandardRoutecomplete(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.Function0<T> v, Marshaller<T,RequestEntity> m)Completes the request using the given arguments.<T> StandardRoutecomplete(StatusCode status, scala.Function0<T> v, Marshaller<T,RequestEntity> m)Completes the request using the given arguments.StandardRoutecomplete(scala.Function0<ToResponseMarshallable> m)Completes the request using the given arguments.StandardRoutefailWith(java.lang.Throwable error)Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptionsdirective and its ExceptionHandler.StandardRoutehandle(scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> handler)Handle the request using a function.StandardRoutehandle(scala.PartialFunction<HttpRequest,scala.concurrent.Future<HttpResponse>> handler)Handle the request using an asynchronous partial function.StandardRoutehandle(scala.PartialFunction<HttpRequest,scala.concurrent.Future<HttpResponse>> handler, scala.collection.immutable.Seq<Rejection> rejections)Handle the request using an asynchronous partial function.StandardRoutehandleSync(scala.Function1<HttpRequest,HttpResponse> handler)Handle the request using a function.StandardRoutehandleSync(scala.PartialFunction<HttpRequest,HttpResponse> handler)Handle the request using a synchronous partial function.StandardRoutehandleSync(scala.PartialFunction<HttpRequest,HttpResponse> handler, scala.collection.immutable.Seq<Rejection> rejections)Handle the request using a synchronous partial function.StandardRouteredirect(Uri uri, StatusCodes.Redirection redirectionType)Completes the request with redirection response of the given type to the given URI.StandardRoutereject()Rejects the request with an empty set of rejections.StandardRoutereject(scala.collection.immutable.Seq<Rejection> rejections)Rejects the request with the given rejections.
-
-
-
Method Detail
-
reject
StandardRoute reject()
Rejects the request with an empty set of rejections.- Returns:
- (undocumented)
-
reject
StandardRoute reject(scala.collection.immutable.Seq<Rejection> rejections)
Rejects the request with the given rejections.- Parameters:
rejections- (undocumented)- Returns:
- (undocumented)
-
redirect
StandardRoute redirect(Uri uri, StatusCodes.Redirection redirectionType)
Completes the request with redirection response of the given type to the given URI.- Parameters:
uri- (undocumented)redirectionType- (undocumented)- Returns:
- (undocumented)
-
complete
StandardRoute complete(scala.Function0<ToResponseMarshallable> m)
Completes the request using the given arguments.- Parameters:
m- (undocumented)- Returns:
- (undocumented)
-
complete
<T> StandardRoute complete(StatusCode status, scala.Function0<T> v, Marshaller<T,RequestEntity> m)
Completes the request using the given arguments.- Parameters:
status- (undocumented)v- (undocumented)m- (undocumented)- Returns:
- (undocumented)
-
complete
<T> StandardRoute complete(StatusCode status, scala.collection.immutable.Seq<HttpHeader> headers, scala.Function0<T> v, Marshaller<T,RequestEntity> m)
Completes the request using the given arguments.- Parameters:
status- (undocumented)headers- (undocumented)v- (undocumented)m- (undocumented)- Returns:
- (undocumented)
-
failWith
StandardRoute failWith(java.lang.Throwable error)
Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptionsdirective and its ExceptionHandler.- Parameters:
error- (undocumented)- Returns:
- (undocumented)
-
handle
StandardRoute handle(scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> handler)
Handle the request using a function.- Parameters:
handler- (undocumented)- Returns:
- (undocumented)
-
handleSync
StandardRoute handleSync(scala.Function1<HttpRequest,HttpResponse> handler)
Handle the request using a function.- Parameters:
handler- (undocumented)- Returns:
- (undocumented)
-
handle
StandardRoute handle(scala.PartialFunction<HttpRequest,scala.concurrent.Future<HttpResponse>> handler)
Handle the request using an asynchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- Parameters:
handler- (undocumented)- Returns:
- (undocumented)
-
handle
StandardRoute handle(scala.PartialFunction<HttpRequest,scala.concurrent.Future<HttpResponse>> handler, scala.collection.immutable.Seq<Rejection> rejections)
Handle the request using an asynchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- Parameters:
rejections- The list of rejections to reject with if the handler is not defined for a request.handler- (undocumented)- Returns:
- (undocumented)
-
handleSync
StandardRoute handleSync(scala.PartialFunction<HttpRequest,HttpResponse> handler)
Handle the request using a synchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
When the partial function is not defined for a request, the request is rejected with an empty list of rejections which is equivalent to a "Not Found" rejection.
- Parameters:
handler- (undocumented)- Returns:
- (undocumented)
-
handleSync
StandardRoute handleSync(scala.PartialFunction<HttpRequest,HttpResponse> handler, scala.collection.immutable.Seq<Rejection> rejections)
Handle the request using a synchronous partial function.This directive can be used to include external components request processing components defined as PartialFunction (like those provided by akka-grpc) into a routing tree defined as routes.
- Parameters:
rejections- The list of rejections to reject with if the handler is not defined for a request.handler- (undocumented)- Returns:
- (undocumented)
-
-