Package akka.http.javadsl.server
Class HttpApp
- 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
-
@Deprecated public abstract class HttpApp extends AllDirectives
Deprecated.HttpApp this doesn't reflect the latest Akka APIs, since 10.2.0DEPRECATED, consider https://developer.lightbend.com/guides/akka-http-quickstart-java/ instead Bootstrap trait for Http Server. It helps booting up an akka-http server by only defining the desired routes. It offers additional hooks to modify the default behavior.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.http.javadsl.server.directives.SecurityDirectives
SecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.atomic.AtomicReference<akka.actor.ActorSystem>
systemReference
Deprecated.Holds a reference to theActorSystem
used to start this server.
-
Constructor Summary
Constructors Constructor Description HttpApp()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
postHttpBinding(ServerBinding binding)
Deprecated.Hook that will be called just after the Http server binding is done.protected void
postHttpBindingFailure(java.lang.Throwable cause)
Deprecated.Hook that will be called in case the Http server binding fails.protected void
postServerShutdown(java.util.Optional<java.lang.Throwable> failure, akka.actor.ActorSystem system)
Deprecated.Hook that will be called just after the server termination.protected abstract Route
routes()
Deprecated.Override to implement the route that will be served by this http server.void
startServer(java.lang.String host, int port)
Deprecated.Start a server on the specified host and port.void
startServer(java.lang.String host, int port, akka.actor.ActorSystem system)
Deprecated.Start a server on the specified host and port, using the provided [[ActorSystem]] Note that this method is blocking.void
startServer(java.lang.String host, int port, ServerSettings settings)
Deprecated.Start a server on the specified host and port, using the provided settings.void
startServer(java.lang.String host, int port, ServerSettings settings, akka.actor.ActorSystem system)
Deprecated.Start a server on the specified host and port, using the provided settings and [[ActorSystem]].void
startServer(java.lang.String host, int port, ServerSettings settings, java.util.Optional<akka.actor.ActorSystem> system)
Deprecated.Start a server on the specified host and port, using the provided settings and [[ActorSystem]] if present.protected java.util.concurrent.CompletionStage<akka.Done>
waitForShutdownSignal(akka.actor.ActorSystem system)
Deprecated.Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.-
Methods inherited from class akka.http.javadsl.server.directives.CorsDirectives
cors, cors
-
Methods inherited from class akka.http.javadsl.server.directives.FramedEntityStreamingDirectives
attribute, authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, cancelRejection, cancelRejections, cancelRejections, checkSameOrigin, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeOKWithSource, completeOrRecoverWith, completeWith, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, completeWithSource, concat, concat, conditional, conditional, conditional, conditional, cookie, decodeRequest, decodeRequestWith, decodeRequestWith, defaultContentTypeResolver, defaultDirectoryRenderer, delete, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, encodeResponse, encodeResponseWith, entity, entityAsSourceOf, extract, extractActorSystem, extractClientIP, extractCredentials, extractDataBytes, extractEntity, extractExecutionContext, extractHost, extractLog, extractMatchedPath, extractMaterializer, extractMethod, extractOfferedWsProtocols, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractRequestTimeout, extractScheme, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUpgradeToWebSocket, extractUri, extractWebSocketUpgrade, failWith, fileUpload, fileUploadAll, formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional, get, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, handle, handleExceptions, handleRejections, handleSync, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol, handleWith, head, headerValue, headerValueByName, headerValueByType, headerValuePF, host, host, host, host, ignoreTrailingSlash, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents, logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, method, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess, optionalAttribute, optionalCookie, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, options, overrideMethodWithParameter, parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue, pass, patch, 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, post, provide, put, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, recoverRejections, recoverRejectionsWith, redirect, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing, reject, reject, reject, rejectEmptyResponse, request, requestEncodedWith, requestEntityEmpty, requestEntityPresent, respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, responseEncodingAccepted, route, route, scheme, selectPreferredLanguage, setCookie, setCookie, storeUploadedFile, storeUploadedFiles, toStrictEntity, toStrictEntity, validate, withExecutionContext, withLog, withMaterializer, withoutRequestTimeout, withoutSizeLimit, withPrecompressedMediaTypeSupport, withRangeSupport, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse, withSettings, withSizeLimit
-
Methods inherited from class akka.http.javadsl.server.directives.TimeoutDirectives
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
-
Methods inherited from class akka.http.javadsl.server.directives.WebSocketDirectives
extractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
-
Methods inherited from class akka.http.javadsl.server.directives.SecurityDirectives
authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentials
-
Methods inherited from class akka.http.javadsl.server.directives.SchemeDirectives
extractScheme, scheme
-
Methods inherited from class akka.http.javadsl.server.directives.RouteDirectives
complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, concat, concat, failWith, handle, handleSync, redirect, reject, reject, reject, route, route
-
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
-
-
-
-
Method Detail
-
startServer
public void startServer(java.lang.String host, int port) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Deprecated.Start a server on the specified host and port. Note that this method is blocking.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
startServer
public void startServer(java.lang.String host, int port, akka.actor.ActorSystem system) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Deprecated.Start a server on the specified host and port, using the provided [[ActorSystem]] Note that this method is blocking.- Parameters:
system
- ActorSystem to use for starting the app, if null is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
startServer
public void startServer(java.lang.String host, int port, ServerSettings settings) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Deprecated.Start a server on the specified host and port, using the provided settings. Note that this method is blocking.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
startServer
public void startServer(java.lang.String host, int port, ServerSettings settings, akka.actor.ActorSystem system) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Deprecated.Start a server on the specified host and port, using the provided settings and [[ActorSystem]]. Note that this method is blocking.- Parameters:
system
- ActorSystem to use for starting the app, if null is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
startServer
public void startServer(java.lang.String host, int port, ServerSettings settings, java.util.Optional<akka.actor.ActorSystem> system) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Deprecated.Start a server on the specified host and port, using the provided settings and [[ActorSystem]] if present. Note that this method is blocking. This method may throw anExecutionException
orInterruptedException
if the future that signals that the server should shutdown is interrupted or cancelled.- Parameters:
system
- ActorSystem to use for starting the app, if an empty Optional is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
postServerShutdown
protected void postServerShutdown(java.util.Optional<java.lang.Throwable> failure, akka.actor.ActorSystem system)
Deprecated.Hook that will be called just after the server termination. Override this method if you want to perform some cleanup actions after the server is stopped. Thefailure
parameter contains aThrowable
only if there has been a problem shutting down the server.
-
postHttpBinding
protected void postHttpBinding(ServerBinding binding)
Deprecated.Hook that will be called just after the Http server binding is done. Override this method if you want to perform some actions after the server is up.
-
postHttpBindingFailure
protected void postHttpBindingFailure(java.lang.Throwable cause)
Deprecated.Hook that will be called in case the Http server binding fails. Override this method if you want to perform some actions after the server binding failed.
-
waitForShutdownSignal
protected java.util.concurrent.CompletionStage<akka.Done> waitForShutdownSignal(akka.actor.ActorSystem system)
Deprecated.Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.
-
routes
protected abstract Route routes()
Deprecated.Override to implement the route that will be served by this http server.
-
-