public abstract class RouteDirectives extends RespondWithDirectives
| Constructor and Description |
|---|
RouteDirectives() |
| Modifier and Type | Method and Description |
|---|---|
Route |
complete(HttpResponse response)
Completes the request using the given http response.
|
RouteAdapter |
complete(java.lang.Iterable<HttpHeader> headers,
RequestEntity entity)
Completes the request as HTTP 200 OK, adding the given headers and response entity.
|
RouteAdapter |
complete(java.lang.Iterable<HttpHeader> headers,
ResponseEntity entity)
Completes the request as HTTP 200 OK, adding the given headers and response entity.
|
<T> RouteAdapter |
complete(java.lang.Iterable<HttpHeader> headers,
T value,
Marshaller<T,RequestEntity> marshaller)
Completes the request as HTTP 200 OK, adding the given headers, and marshalling the given value as response entity.
|
RouteAdapter |
complete(RequestEntity entity)
Completes the request as HTTP 200 OK with the given value as response entity.
|
RouteAdapter |
complete(ResponseEntity entity)
Completes the request as HTTP 200 OK with the given value as response entity.
|
Route |
complete(StatusCode status)
Completes the request using the given status code.
|
RouteAdapter |
complete(StatusCode status,
java.lang.Iterable<HttpHeader> headers,
RequestEntity entity)
Completes the request using the given status code, headers, and response entity.
|
RouteAdapter |
complete(StatusCode status,
java.lang.Iterable<HttpHeader> headers,
ResponseEntity entity)
Completes the request using the given status code, headers, and response entity.
|
<T> RouteAdapter |
complete(StatusCode status,
java.lang.Iterable<HttpHeader> headers,
T value,
Marshaller<T,RequestEntity> marshaller)
Completes the request using the given status code and headers, marshalling the given value as response entity.
|
RouteAdapter |
complete(StatusCode status,
RequestEntity entity)
Completes the request using the given status code and response entity.
|
RouteAdapter |
complete(StatusCode status,
ResponseEntity entity)
Completes the request using the given status code and response entity.
|
RouteAdapter |
complete(StatusCode status,
java.lang.String entity)
Completes the request using the given status code and the given body as UTF-8.
|
<T> RouteAdapter |
complete(StatusCode status,
T value,
Marshaller<T,RequestEntity> marshaller)
Completes the request using the given status code, marshalling the given value as response entity.
|
Route |
complete(java.lang.String body)
Completes the request using an HTTP 200 OK status code and the given body as UTF-8 entity.
|
<T> RouteAdapter |
complete(T value,
Marshaller<T,HttpResponse> marshaller)
Completes the request by marshalling the given value into an http response.
|
<T> RouteAdapter |
completeOK(T value,
Marshaller<T,RequestEntity> marshaller)
Completes the request as HTTP 200 OK, marshalling the given value as response entity.
|
RouteAdapter |
completeOKWithFuture(java.util.concurrent.CompletionStage<RequestEntity> value)
Completes the request by marshalling the given future value into an http response.
|
<T> RouteAdapter |
completeOKWithFuture(java.util.concurrent.CompletionStage<T> value,
Marshaller<T,RequestEntity> marshaller)
Completes the request with an
OK status code by marshalling the given value into an http response. |
<T> RouteAdapter |
completeOKWithFuture(scala.concurrent.Future<T> value,
Marshaller<T,RequestEntity> marshaller)
Completes the request by marshalling the given value into an http response.
|
RouteAdapter |
completeOKWithFutureString(java.util.concurrent.CompletionStage<java.lang.String> value)
Completes the request by marshalling the given future value into an http response.
|
RouteAdapter |
completeOKWithFutureString(scala.concurrent.Future<java.lang.String> value)
Completes the request by marshalling the given future value into an http response.
|
RouteAdapter |
completeWithFuture(java.util.concurrent.CompletionStage<HttpResponse> value)
Completes the request by marshalling the given future value into an http response.
|
<T> RouteAdapter |
completeWithFuture(java.util.concurrent.CompletionStage<T> value,
Marshaller<T,HttpResponse> marshaller)
Completes the request by marshalling the given value into an http response.
|
<T> RouteAdapter |
completeWithFuture(scala.concurrent.Future<T> value,
Marshaller<T,HttpResponse> marshaller)
Completes the request by marshalling the given value into an http response.
|
RouteAdapter |
completeWithFutureResponse(scala.concurrent.Future<HttpResponse> value)
Completes the request by marshalling the given future value into an http response.
|
Route |
completeWithFutureStatus(java.util.concurrent.CompletionStage<StatusCode> status)
Completes the request using the given future status code.
|
Route |
completeWithFutureStatus(scala.concurrent.Future<StatusCode> status)
Completes the request using the given future status code.
|
Route |
concat(Route first,
Route... alternatives)
Used to chain multiple alternate routes using comma,
rather than having to explicitly call route1.orElse(route2).orElse(route3).
|
Route |
concat(Route first,
scala.collection.immutable.Seq<Route> alternatives)
Used to chain multiple alternate routes using comma,
rather than having to explicitly call route1.orElse(route2).orElse(route3).
|
Route |
failWith(java.lang.Throwable error)
Bubbles the given error up the response chain, where it is dealt with by the closest
handleExceptions
directive and its ExceptionHandler. |
Route |
handle(org.apache.pekko.japi.function.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler)
Handle the request using a function.
|
Route |
handleSync(org.apache.pekko.japi.function.Function<HttpRequest,HttpResponse> handler)
Handle the request using a function.
|
Route |
redirect(Uri uri,
StatusCode redirectionType)
Completes the request with redirection response of the given type to the given URI.
|
Route |
reject()
Rejects the request with an empty rejection (usually used for "no directive matched").
|
Route |
reject(Rejection rejection,
Rejection... rejections)
Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.
|
Route |
reject(Rejection rejection,
scala.collection.immutable.Seq<Rejection> rejections)
Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.
|
Route |
route(Route... alternatives)
Deprecated.
Use the
RouteDirectives.concat method instead. |
Route |
route(scala.collection.immutable.Seq<Route> alternatives)
Deprecated.
Use the
RouteDirectives.concat method instead. |
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaderswithRangeSupportignoreTrailingSlash, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissingparameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValueextractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimitdelete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, putcompleteWith, entity, handleWith, requestextractHost, host, host, host, hostattribute, optionalAttributecheckSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePFcompleteOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccessformField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptionalfileUpload, fileUploadAll, storeUploadedFile, storeUploadedFilesdefaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContentshandleExceptions, handleRejectionslogRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResultcookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookiedecodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupportconditional, conditional, conditional, conditionalcancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettingspublic Route complete(java.lang.String body)
body - (undocumented)public Route complete(HttpResponse response)
response - (undocumented)public Route complete(StatusCode status)
status - (undocumented)public <T> RouteAdapter complete(T value, Marshaller<T,HttpResponse> marshaller)
value - (undocumented)marshaller - (undocumented)public <T> RouteAdapter complete(StatusCode status, java.lang.Iterable<HttpHeader> headers, T value, Marshaller<T,RequestEntity> marshaller)
status - (undocumented)headers - (undocumented)value - (undocumented)marshaller - (undocumented)public RouteAdapter complete(StatusCode status, java.lang.Iterable<HttpHeader> headers, ResponseEntity entity)
status - (undocumented)headers - (undocumented)entity - (undocumented)public RouteAdapter complete(StatusCode status, java.lang.Iterable<HttpHeader> headers, RequestEntity entity)
status - (undocumented)headers - (undocumented)entity - (undocumented)public <T> RouteAdapter complete(StatusCode status, T value, Marshaller<T,RequestEntity> marshaller)
status - (undocumented)value - (undocumented)marshaller - (undocumented)public RouteAdapter complete(StatusCode status, ResponseEntity entity)
status - (undocumented)entity - (undocumented)public RouteAdapter complete(StatusCode status, RequestEntity entity)
status - (undocumented)entity - (undocumented)public RouteAdapter complete(StatusCode status, java.lang.String entity)
status - (undocumented)entity - (undocumented)public <T> RouteAdapter complete(java.lang.Iterable<HttpHeader> headers, T value, Marshaller<T,RequestEntity> marshaller)
headers - (undocumented)value - (undocumented)marshaller - (undocumented)public RouteAdapter complete(java.lang.Iterable<HttpHeader> headers, ResponseEntity entity)
headers - (undocumented)entity - (undocumented)public RouteAdapter complete(java.lang.Iterable<HttpHeader> headers, RequestEntity entity)
headers - (undocumented)entity - (undocumented)public RouteAdapter complete(ResponseEntity entity)
entity - (undocumented)public RouteAdapter complete(RequestEntity entity)
entity - (undocumented)public <T> RouteAdapter completeOK(T value, Marshaller<T,RequestEntity> marshaller)
value - (undocumented)marshaller - (undocumented)public <T> RouteAdapter completeOKWithFuture(scala.concurrent.Future<T> value, Marshaller<T,RequestEntity> marshaller)
value - (undocumented)marshaller - (undocumented)public RouteAdapter completeOKWithFuture(java.util.concurrent.CompletionStage<RequestEntity> value)
value - (undocumented)public <T> RouteAdapter completeOKWithFuture(java.util.concurrent.CompletionStage<T> value, Marshaller<T,RequestEntity> marshaller)
OK status code by marshalling the given value into an http response.value - (undocumented)marshaller - (undocumented)public RouteAdapter completeOKWithFutureString(scala.concurrent.Future<java.lang.String> value)
value - (undocumented)public RouteAdapter completeOKWithFutureString(java.util.concurrent.CompletionStage<java.lang.String> value)
value - (undocumented)public <T> RouteAdapter completeWithFuture(scala.concurrent.Future<T> value, Marshaller<T,HttpResponse> marshaller)
value - (undocumented)marshaller - (undocumented)public RouteAdapter completeWithFuture(java.util.concurrent.CompletionStage<HttpResponse> value)
value - (undocumented)public <T> RouteAdapter completeWithFuture(java.util.concurrent.CompletionStage<T> value, Marshaller<T,HttpResponse> marshaller)
value - (undocumented)marshaller - (undocumented)public RouteAdapter completeWithFutureResponse(scala.concurrent.Future<HttpResponse> value)
value - (undocumented)public Route completeWithFutureStatus(scala.concurrent.Future<StatusCode> status)
status - (undocumented)public Route completeWithFutureStatus(java.util.concurrent.CompletionStage<StatusCode> status)
status - (undocumented)public Route concat(Route first, Route... alternatives)
first - (undocumented)alternatives - (undocumented)public Route concat(Route first, scala.collection.immutable.Seq<Route> alternatives)
first - (undocumented)alternatives - (undocumented)public Route failWith(java.lang.Throwable error)
handleExceptions
directive and its ExceptionHandler.error - (undocumented)public Route handle(org.apache.pekko.japi.function.Function<HttpRequest,java.util.concurrent.CompletionStage<HttpResponse>> handler)
handler - (undocumented)public Route handleSync(org.apache.pekko.japi.function.Function<HttpRequest,HttpResponse> handler)
handler - (undocumented)public Route redirect(Uri uri, StatusCode redirectionType)
redirectionType - A status code from StatusCodes, which must be a redirection type.uri - (undocumented)public Route reject(Rejection rejection, Rejection... rejections)
rejection - (undocumented)rejections - (undocumented)public Route reject(Rejection rejection, scala.collection.immutable.Seq<Rejection> rejections)
rejection - (undocumented)rejections - (undocumented)public Route reject()
public Route route(Route... alternatives)
RouteDirectives.concat method instead.alternatives - (undocumented)public Route route(scala.collection.immutable.Seq<Route> alternatives)
RouteDirectives.concat method instead.alternatives - (undocumented)