Class RouteDirectives
java.lang.Object
akka.http.javadsl.server.directives.BasicDirectives
akka.http.javadsl.server.directives.CacheConditionDirectives
akka.http.javadsl.server.directives.CodingDirectives
akka.http.javadsl.server.directives.CookieDirectives
akka.http.javadsl.server.directives.DebuggingDirectives
akka.http.javadsl.server.directives.ExecutionDirectives
akka.http.javadsl.server.directives.FileAndResourceDirectives
akka.http.javadsl.server.directives.FileUploadDirectives
akka.http.javadsl.server.directives.FormFieldDirectives
akka.http.javadsl.server.directives.FutureDirectives
akka.http.javadsl.server.directives.HeaderDirectives
akka.http.javadsl.server.directives.AttributeDirectives
akka.http.javadsl.server.directives.HostDirectives
akka.http.javadsl.server.directives.MarshallingDirectives
akka.http.javadsl.server.directives.MethodDirectives
akka.http.javadsl.server.directives.MiscDirectives
akka.http.javadsl.server.directives.ParameterDirectives
akka.http.javadsl.server.directives.PathDirectives
akka.http.javadsl.server.directives.RangeDirectives
akka.http.javadsl.server.directives.RespondWithDirectives
akka.http.javadsl.server.directives.RouteDirectives
- Direct Known Subclasses:
SchemeDirectives
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomplete
(HttpResponse response) Completes the request using the given http response.complete
(RequestEntity entity) Completes the request as HTTP 200 OK with the given value as response entity.complete
(ResponseEntity entity) Completes the request as HTTP 200 OK with the given value as response entity.complete
(StatusCode status) Completes the request using the given status code.complete
(StatusCode status, RequestEntity entity) Completes the request using the given status code and response entity.complete
(StatusCode status, ResponseEntity entity) Completes the request using the given status code and response entity.complete
(StatusCode status, Iterable<HttpHeader> headers, RequestEntity entity) Completes the request using the given status code, headers, and response entity.complete
(StatusCode status, Iterable<HttpHeader> headers, ResponseEntity entity) Completes the request using the given status code, headers, and response entity.<T> RouteAdapter
complete
(StatusCode status, 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.complete
(StatusCode status, 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.complete
(Iterable<HttpHeader> headers, RequestEntity entity) Completes the request as HTTP 200 OK, adding the given headers and response entity.complete
(Iterable<HttpHeader> headers, ResponseEntity entity) Completes the request as HTTP 200 OK, adding the given headers and response entity.<T> RouteAdapter
complete
(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.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.Completes the request by marshalling the given future value into an http response.<T> RouteAdapter
completeOKWithFuture
(CompletionStage<T> value, Marshaller<T, RequestEntity> marshaller) Completes the request with anOK
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.Completes the request by marshalling the given future value into an http response.completeOKWithFutureString
(scala.concurrent.Future<String> value) Completes the request by marshalling the given future value into an http response.Completes the request by marshalling the given future value into an http response.<T> RouteAdapter
completeWithFuture
(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.completeWithFutureResponse
(scala.concurrent.Future<HttpResponse> value) Completes the request by marshalling the given future value into an http response.Completes the request using the given future status code.completeWithFutureStatus
(scala.concurrent.Future<StatusCode> status) Completes the request using the given future status code.Used to chain multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).Used to chain multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptions
directive and its ExceptionHandler.handle
(akka.japi.function.Function<HttpRequest, CompletionStage<HttpResponse>> handler) Handle the request using a function.handleSync
(akka.japi.function.Function<HttpRequest, HttpResponse> handler) Handle the request using a function.redirect
(Uri uri, StatusCode redirectionType) Completes the request with redirection response of the given type to the given URI.reject()
Rejects the request with an empty rejection (usually used for "no directive matched").Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.Deprecated.Deprecated.Use theRouteDirectives.concat
method instead.Methods inherited from class akka.http.javadsl.server.directives.RespondWithDirectives
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders
Methods inherited from class akka.http.javadsl.server.directives.RangeDirectives
withRangeSupport
Methods inherited from class akka.http.javadsl.server.directives.PathDirectives
ignoreTrailingSlash, 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, redirectToTrailingSlashIfMissing
Methods inherited from class akka.http.javadsl.server.directives.ParameterDirectives
parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue
Methods inherited from class akka.http.javadsl.server.directives.MiscDirectives
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
Methods inherited from class akka.http.javadsl.server.directives.MethodDirectives
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
Methods inherited from class akka.http.javadsl.server.directives.MarshallingDirectives
completeWith, entity, handleWith, request
Methods inherited from class akka.http.javadsl.server.directives.HostDirectives
extractHost, host, host, host, host
Methods inherited from class akka.http.javadsl.server.directives.AttributeDirectives
attribute, optionalAttribute
Methods inherited from class akka.http.javadsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF
Methods inherited from class akka.http.javadsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
Methods inherited from class akka.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
Methods inherited from class akka.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
Methods inherited from class akka.http.javadsl.server.directives.FileAndResourceDirectives
defaultContentTypeResolver, 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, listDirectoryContents
Methods inherited from class akka.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
Methods inherited from class akka.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
Methods inherited from class akka.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
Methods inherited from class akka.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
Methods inherited from class akka.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
Methods inherited from class akka.http.javadsl.server.directives.BasicDirectives
cancelRejection, 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, withSettings
-
Constructor Details
-
RouteDirectives
public RouteDirectives()
-
-
Method Details
-
complete
Completes the request using an HTTP 200 OK status code and the given body as UTF-8 entity.- Parameters:
body
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given http response.- Parameters:
response
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given status code.- Parameters:
status
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request by marshalling the given value into an http response.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
complete
public <T> RouteAdapter complete(StatusCode status, 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.- Parameters:
status
- (undocumented)headers
- (undocumented)value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
complete
public RouteAdapter complete(StatusCode status, Iterable<HttpHeader> headers, ResponseEntity entity) Completes the request using the given status code, headers, and response entity.- Parameters:
status
- (undocumented)headers
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given status code, headers, and response entity.- Parameters:
status
- (undocumented)headers
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
public <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.- Parameters:
status
- (undocumented)value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given status code and response entity.- Parameters:
status
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given status code and response entity.- Parameters:
status
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request using the given status code and the given body as UTF-8.- Parameters:
status
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
public <T> RouteAdapter complete(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.- Parameters:
headers
- (undocumented)value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request as HTTP 200 OK, adding the given headers and response entity.- Parameters:
headers
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request as HTTP 200 OK, adding the given headers and response entity.- Parameters:
headers
- (undocumented)entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request as HTTP 200 OK with the given value as response entity.- Parameters:
entity
- (undocumented)- Returns:
- (undocumented)
-
complete
Completes the request as HTTP 200 OK with the given value as response entity.- Parameters:
entity
- (undocumented)- Returns:
- (undocumented)
-
completeOK
Completes the request as HTTP 200 OK, marshalling the given value as response entity.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
completeOKWithFuture
public <T> RouteAdapter completeOKWithFuture(scala.concurrent.Future<T> value, Marshaller<T, RequestEntity> marshaller) Completes the request by marshalling the given value into an http response.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
completeOKWithFuture
Completes the request by marshalling the given future value into an http response.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
completeOKWithFuture
public <T> RouteAdapter completeOKWithFuture(CompletionStage<T> value, Marshaller<T, RequestEntity> marshaller) Completes the request with anOK
status code by marshalling the given value into an http response.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
completeOKWithFutureString
Completes the request by marshalling the given future value into an http response.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
completeOKWithFutureString
Completes the request by marshalling the given future value into an http response.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
completeWithFuture
public <T> RouteAdapter completeWithFuture(scala.concurrent.Future<T> value, Marshaller<T, HttpResponse> marshaller) Completes the request by marshalling the given value into an http response.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
completeWithFuture
Completes the request by marshalling the given future value into an http response.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
completeWithFuture
public <T> RouteAdapter completeWithFuture(CompletionStage<T> value, Marshaller<T, HttpResponse> marshaller) Completes the request by marshalling the given value into an http response.- Parameters:
value
- (undocumented)marshaller
- (undocumented)- Returns:
- (undocumented)
-
completeWithFutureResponse
Completes the request by marshalling the given future value into an http response.- Parameters:
value
- (undocumented)- Returns:
- (undocumented)
-
completeWithFutureStatus
Completes the request using the given future status code.- Parameters:
status
- (undocumented)- Returns:
- (undocumented)
-
completeWithFutureStatus
Completes the request using the given future status code.- Parameters:
status
- (undocumented)- Returns:
- (undocumented)
-
concat
Used to chain multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).- Parameters:
first
- (undocumented)alternatives
- (undocumented)- Returns:
- (undocumented)
-
concat
Used to chain multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).- Parameters:
first
- (undocumented)alternatives
- (undocumented)- Returns:
- (undocumented)
-
failWith
Bubbles the given error up the response chain, where it is dealt with by the closesthandleExceptions
directive and its ExceptionHandler.- Parameters:
error
- (undocumented)- Returns:
- (undocumented)
-
handle
Handle the request using a function.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
handleSync
Handle the request using a function.- Parameters:
handler
- (undocumented)- Returns:
- (undocumented)
-
redirect
Completes the request with redirection response of the given type to the given URI.- Parameters:
redirectionType
- A status code from StatusCodes, which must be a redirection type.uri
- (undocumented)- Returns:
- (undocumented)
-
reject
Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.- Parameters:
rejection
- (undocumented)rejections
- (undocumented)- Returns:
- (undocumented)
-
reject
Rejects the request with the given rejections, or with an empty set of rejections if no rejections are given.- Parameters:
rejection
- (undocumented)rejections
- (undocumented)- Returns:
- (undocumented)
-
reject
Rejects the request with an empty rejection (usually used for "no directive matched").- Returns:
- (undocumented)
-
route
Deprecated.Use theRouteDirectives.concat
method instead.Java-specific call added so you can chain together multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).- Parameters:
alternatives
- (undocumented)- Returns:
- (undocumented)
-
route
Deprecated.Use theRouteDirectives.concat
method instead.Java-specific call added so you can chain together multiple alternate routes using comma, rather than having to explicitly call route1.orElse(route2).orElse(route3).- Parameters:
alternatives
- (undocumented)- Returns:
- (undocumented)
-
RouteDirectives.concat
method instead.