Package akka.http.scaladsl.server
Class HttpApp
- java.lang.Object
-
- akka.http.scaladsl.server.HttpApp
-
- All Implemented Interfaces:
ToNameReceptacleEnhancements
,Directives
,AttributeDirectives
,BasicDirectives
,CacheConditionDirectives
,CodingDirectives
,CookieDirectives
,CorsDirectives
,DebuggingDirectives
,ExecutionDirectives
,FileAndResourceDirectives
,FileUploadDirectives
,FormFieldDirectives
,FormFieldDirectivesInstances
,FramedEntityStreamingDirectives
,FutureDirectives
,HeaderDirectives
,HostDirectives
,MarshallingDirectives
,MethodDirectives
,MiscDirectives
,ParameterDirectives
,ParameterDirectivesInstances
,PathDirectives
,RangeDirectives
,RespondWithDirectives
,RouteDirectives
,SchemeDirectives
,SecurityDirectives
,TimeoutDirectives
,WebSocketDirectives
,ImplicitPathMatcherConstruction
,PathMatchers
,RouteConcatenation
public abstract class HttpApp extends java.lang.Object implements Directives
Deprecated.HttpApp this doesn't reflect the latest Akka APIs. Since 10.2.0.DEPRECATED, consider https://developer.lightbend.com/guides/akka-http-quickstart-scala/ insteadBootstrap 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 interface akka.http.scaladsl.server.directives.FileAndResourceDirectives
FileAndResourceDirectives.DirectoryRenderer, FileAndResourceDirectives.DirectoryRenderer$, FileAndResourceDirectives.LowLevelDirectoryRenderer, FileAndResourceDirectives.ResourceFile, FileAndResourceDirectives.ResourceFile$
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.server.directives.FormFieldDirectives
FormFieldDirectives.FieldDef<T>, FormFieldDirectives.FieldDef$, FormFieldDirectives.FieldMagnet, FormFieldDirectives.FieldMagnet$, FormFieldDirectives.FieldSpec, FormFieldDirectives.FieldSpec$, FormFieldDirectives.Impl$
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.server.directives.ParameterDirectives
ParameterDirectives.ParamDef<T>, ParameterDirectives.ParamDef$, ParameterDirectives.ParamMagnet, ParameterDirectives.ParamMagnet$, ParameterDirectives.ParamSpec, ParameterDirectives.ParamSpec$
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.server.directives.PathDirectives
PathDirectives.TrailingRetryRejection$
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.server.PathMatchers
PathMatchers.HexIntNumber$, PathMatchers.HexLongNumber$, PathMatchers.IntNumber$, PathMatchers.LongNumber$, PathMatchers.NumberMatcher<T>, PathMatchers.PathEnd$, PathMatchers.Remaining$, PathMatchers.RemainingPath$, PathMatchers.Segment$, PathMatchers.Slash$
-
Nested classes/interfaces inherited from interface akka.http.scaladsl.server.RouteConcatenation
RouteConcatenation.RouteWithConcatenation
-
-
Constructor Summary
Constructors Constructor Description HttpApp()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description scala.util.Try<Http.ServerBinding>
binding()
Deprecated.It tries to retrieve theServerBinding
if the server has been successfully started.PathMatcher<scala.Tuple1<java.lang.Object>>
DoubleNumber()
Deprecated.PathMatchers.HexIntNumber$
HexIntNumber()
Deprecated.Accessor for nested Scala objectPathMatchers.HexLongNumber$
HexLongNumber()
Deprecated.Accessor for nested Scala objectPathMatchers.IntNumber$
IntNumber()
Deprecated.Accessor for nested Scala objectPathMatcher<scala.Tuple1<java.util.UUID>>
JavaUUID()
Deprecated.PathMatchers.LongNumber$
LongNumber()
Deprecated.Accessor for nested Scala objectPathMatcher<scala.runtime.BoxedUnit>
Neutral()
Deprecated.PathMatchers.PathEnd$
PathEnd()
Deprecated.Accessor for nested Scala objectprotected void
postHttpBinding(Http.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(scala.util.Try<akka.Done> attempt, akka.actor.ActorSystem system)
Deprecated.Hook that will be called just after the server termination.PathMatchers.Remaining$
Remaining()
Deprecated.Accessor for nested Scala objectPathMatchers.RemainingPath$
RemainingPath()
Deprecated.Accessor for nested Scala objectprotected abstract scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>>
routes()
Deprecated.Override to implement the routes that will be served by this http server.PathMatchers.Segment$
Segment()
Deprecated.Accessor for nested Scala objectPathMatcher<scala.Tuple1<scala.collection.immutable.List<java.lang.String>>>
Segments()
Deprecated.PathMatchers.Slash$
Slash()
Deprecated.Accessor for nested Scala objectvoid
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 providedActorSystem
.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 andActorSystem
.void
startServer(java.lang.String host, int port, ServerSettings settings, scala.Option<akka.actor.ActorSystem> system)
Deprecated.Start a server on the specified host and port, using the provided settings andActorSystem
if present.protected java.util.concurrent.atomic.AtomicReference<akka.actor.ActorSystem>
systemReference()
Deprecated.ActorSystem
used to start this server.protected scala.concurrent.Future<akka.Done>
waitForShutdownSignal(akka.actor.ActorSystem system, scala.concurrent.ExecutionContext ec)
Deprecated.Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface akka.http.scaladsl.server.directives.AttributeDirectives
attribute, optionalAttribute
-
Methods inherited from interface akka.http.scaladsl.server.directives.BasicDirectives
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, 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, textract, toStrictEntity, toStrictEntity, tprovide, withExecutionContext, withLog, withMaterializer, withSettings
-
Methods inherited from interface akka.http.scaladsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
-
Methods inherited from interface akka.http.scaladsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
-
Methods inherited from interface akka.http.scaladsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, findCookie, optionalCookie, setCookie
-
Methods inherited from interface akka.http.scaladsl.server.directives.CorsDirectives
cors, cors
-
Methods inherited from interface akka.http.scaladsl.server.directives.DebuggingDirectives
logRequest, logRequestResult, logResult
-
Methods inherited from interface akka.http.scaladsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
-
Methods inherited from interface akka.http.scaladsl.server.directives.FileAndResourceDirectives
_defaultClassLoader, conditionalFor, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResourceDirectory, listDirectoryContents
-
Methods inherited from interface akka.http.scaladsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
-
Methods inherited from interface akka.http.scaladsl.server.directives.FormFieldDirectives
formField, formFieldMap, formFieldMultiMap, formFields, formFieldSeq
-
Methods inherited from interface akka.http.scaladsl.server.directives.FormFieldDirectivesInstances
formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formField, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields, formFields
-
Methods inherited from interface akka.http.scaladsl.server.directives.FramedEntityStreamingDirectives
asSourceOf, asSourceOf, asSourceOfInternal
-
Methods inherited from interface akka.http.scaladsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onCompleteWithBreaker, onSuccess
-
Methods inherited from interface akka.http.scaladsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, optionalValue
-
Methods inherited from interface akka.http.scaladsl.server.directives.HostDirectives
extractHost, host, host, host
-
Methods inherited from interface akka.http.scaladsl.server.ImplicitPathMatcherConstruction
_regex2PathMatcher, _segmentStringToPathMatcher, _stringExtractionPair2PathMatcher, _stringNameOptionReceptacle2PathMatcher, _valueMap2PathMatcher
-
Methods inherited from interface akka.http.scaladsl.server.directives.MarshallingDirectives
as, completeWith, entity, handleWith, instanceOf
-
Methods inherited from interface akka.http.scaladsl.server.directives.MethodDirectives
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
-
Methods inherited from interface akka.http.scaladsl.server.directives.MiscDirectives
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
-
Methods inherited from interface akka.http.scaladsl.server.directives.ParameterDirectives
parameter, parameterMap, parameterMultiMap, parameters, parameterSeq
-
Methods inherited from interface akka.http.scaladsl.server.directives.ParameterDirectivesInstances
parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameter, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters, parameters
-
Methods inherited from interface akka.http.scaladsl.server.directives.PathDirectives
ignoreTrailingSlash, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffixTest, rawPathPrefix, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing
-
Methods inherited from interface akka.http.scaladsl.server.PathMatchers
not, nothingMatcher, Segments, Segments, separateOnSlashes
-
Methods inherited from interface akka.http.scaladsl.server.directives.RangeDirectives
withRangeSupport
-
Methods inherited from interface akka.http.scaladsl.server.directives.RespondWithDirectives
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, respondWithHeaders
-
Methods inherited from interface akka.http.scaladsl.server.RouteConcatenation
_enhanceRouteWithConcatenation, concat
-
Methods inherited from interface akka.http.scaladsl.server.directives.RouteDirectives
complete, complete, complete, failWith, handle, handle, handle, handleSync, handleSync, handleSync, redirect, reject, reject
-
Methods inherited from interface akka.http.scaladsl.server.directives.SchemeDirectives
extractScheme, scheme
-
Methods inherited from interface akka.http.scaladsl.server.directives.SecurityDirectives
authenticateBasic, authenticateBasicAsync, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2PF, authenticateOAuth2PFAsync, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorize, authorizeAsync, authorizeAsync, extractCredentials, extractCredentialsAndAuthenticateOrRejectWithChallenge
-
Methods inherited from interface akka.http.scaladsl.server.directives.TimeoutDirectives
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
-
Methods inherited from interface akka.http.scaladsl.common.ToNameReceptacleEnhancements
_string2NR, _symbol2NR
-
Methods inherited from interface akka.http.scaladsl.server.directives.WebSocketDirectives
extractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
-
-
-
-
Method Detail
-
DoubleNumber
public PathMatcher<scala.Tuple1<java.lang.Object>> DoubleNumber()
Deprecated.- Specified by:
DoubleNumber
in interfacePathMatchers
-
HexIntNumber
public PathMatchers.HexIntNumber$ HexIntNumber()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
HexIntNumber
in interfacePathMatchers
- Returns:
- (undocumented)
-
HexLongNumber
public PathMatchers.HexLongNumber$ HexLongNumber()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
HexLongNumber
in interfacePathMatchers
- Returns:
- (undocumented)
-
IntNumber
public PathMatchers.IntNumber$ IntNumber()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
IntNumber
in interfacePathMatchers
- Returns:
- (undocumented)
-
JavaUUID
public PathMatcher<scala.Tuple1<java.util.UUID>> JavaUUID()
Deprecated.- Specified by:
JavaUUID
in interfacePathMatchers
-
LongNumber
public PathMatchers.LongNumber$ LongNumber()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
LongNumber
in interfacePathMatchers
- Returns:
- (undocumented)
-
Neutral
public PathMatcher<scala.runtime.BoxedUnit> Neutral()
Deprecated.- Specified by:
Neutral
in interfacePathMatchers
-
PathEnd
public PathMatchers.PathEnd$ PathEnd()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
PathEnd
in interfacePathMatchers
- Returns:
- (undocumented)
-
Remaining
public PathMatchers.Remaining$ Remaining()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
Remaining
in interfacePathMatchers
- Returns:
- (undocumented)
-
RemainingPath
public PathMatchers.RemainingPath$ RemainingPath()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
RemainingPath
in interfacePathMatchers
- Returns:
- (undocumented)
-
Segment
public PathMatchers.Segment$ Segment()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
Segment
in interfacePathMatchers
- Returns:
- (undocumented)
-
Segments
public PathMatcher<scala.Tuple1<scala.collection.immutable.List<java.lang.String>>> Segments()
Deprecated.- Specified by:
Segments
in interfacePathMatchers
-
Slash
public PathMatchers.Slash$ Slash()
Deprecated.Description copied from interface:PathMatchers
Accessor for nested Scala object- Specified by:
Slash
in interfacePathMatchers
- Returns:
- (undocumented)
-
binding
public scala.util.Try<Http.ServerBinding> binding()
Deprecated.It tries to retrieve theServerBinding
if the server has been successfully started. It fails otherwise. You can use this method to attempt to retrieve theServerBinding
at any point in time to, for example, stop the server due to unexpected circumstances.- Returns:
- (undocumented)
-
postHttpBinding
protected void postHttpBinding(Http.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.- Parameters:
binding
- (undocumented)
-
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.- Parameters:
cause
- (undocumented)
-
postServerShutdown
protected void postServerShutdown(scala.util.Try<akka.Done> attempt, 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. Theattempt
parameter is represented with aTry
type that is successful only if the server was successfully shut down.- Parameters:
attempt
- (undocumented)system
- (undocumented)
-
routes
protected abstract scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> routes()
Deprecated.Override to implement the routes that will be served by this http server.- Returns:
- (undocumented)
-
startServer
public void startServer(java.lang.String host, int port)
Deprecated.Start a server on the specified host and port. Note that this method is blocking- Parameters:
host
- (undocumented)port
- (undocumented)
-
startServer
public void startServer(java.lang.String host, int port, akka.actor.ActorSystem system)
Deprecated.Start a server on the specified host and port, using the providedActorSystem
. Note that this method is blocking- Parameters:
system
- ActorSystem to use for starting the app, ifnull
is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.host
- (undocumented)port
- (undocumented)
-
startServer
public void startServer(java.lang.String host, int port, ServerSettings settings)
Deprecated.Start a server on the specified host and port, using the provided settings. Note that this method is blocking.- Parameters:
host
- (undocumented)port
- (undocumented)settings
- (undocumented)
-
startServer
public 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 andActorSystem
. Note that this method is blocking.- Parameters:
system
- ActorSystem to use for starting the app, ifnull
is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.host
- (undocumented)port
- (undocumented)settings
- (undocumented)
-
startServer
public void startServer(java.lang.String host, int port, ServerSettings settings, scala.Option<akka.actor.ActorSystem> system)
Deprecated.Start a server on the specified host and port, using the provided settings andActorSystem
if present. Note that this method is blocking.- Parameters:
system
- ActorSystem to use for starting the app, ifNone
is passed in a new default ActorSystem will be created instead, which will be terminated when the server is stopped.host
- (undocumented)port
- (undocumented)settings
- (undocumented)
-
systemReference
protected java.util.concurrent.atomic.AtomicReference<akka.actor.ActorSystem> systemReference()
Deprecated.ActorSystem
used to start this server. Stopping this system will interfere with the proper functioning condition of the server.- Returns:
- (undocumented)
-
waitForShutdownSignal
protected scala.concurrent.Future<akka.Done> waitForShutdownSignal(akka.actor.ActorSystem system, scala.concurrent.ExecutionContext ec)
Deprecated.Hook that lets the user specify the future that will signal the shutdown of the server whenever completed.- Parameters:
system
- (undocumented)ec
- (undocumented)- Returns:
- (undocumented)
-
-