public abstract class HttpApp extends java.lang.Object implements Directives
Bootstrap trait for Http Server. It helps booting up a pekko-http server by only defining the desired routes. It offers additional hooks to modify the default behavior.
RouteConcatenation.RouteWithConcatenation
FileAndResourceDirectives.DirectoryRenderer, FileAndResourceDirectives.DirectoryRenderer$, FileAndResourceDirectives.LowLevelDirectoryRenderer, FileAndResourceDirectives.ResourceFile, FileAndResourceDirectives.ResourceFile$
FormFieldDirectives.FieldDef<T>, FormFieldDirectives.FieldDef$, FormFieldDirectives.FieldMagnet, FormFieldDirectives.FieldMagnet$, FormFieldDirectives.FieldSpec, FormFieldDirectives.FieldSpec$, FormFieldDirectives.Impl$
ParameterDirectives.ParamDef<T>, ParameterDirectives.ParamDef$, ParameterDirectives.ParamMagnet, ParameterDirectives.ParamMagnet$, ParameterDirectives.ParamSpec, ParameterDirectives.ParamSpec$
PathDirectives.TrailingRetryRejection$
PathMatchers.HexIntNumber$, PathMatchers.HexLongNumber$, PathMatchers.IntNumber$, PathMatchers.LongNumber$, PathMatchers.NumberMatcher<T>, PathMatchers.PathEnd$, PathMatchers.Remaining$, PathMatchers.RemainingPath$, PathMatchers.Segment$, PathMatchers.Slash$
Constructor and Description |
---|
HttpApp()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
scala.util.Try<Http.ServerBinding> |
binding()
Deprecated.
It tries to retrieve the
ServerBinding if the server has been successfully started. |
PathMatcher<scala.Tuple1<java.lang.Object>> |
DoubleNumber()
Deprecated.
|
PathMatchers.HexIntNumber$ |
HexIntNumber()
Deprecated.
Accessor for nested Scala object
|
PathMatchers.HexLongNumber$ |
HexLongNumber()
Deprecated.
Accessor for nested Scala object
|
PathMatchers.IntNumber$ |
IntNumber()
Deprecated.
Accessor for nested Scala object
|
PathMatcher<scala.Tuple1<java.util.UUID>> |
JavaUUID()
Deprecated.
|
PathMatchers.LongNumber$ |
LongNumber()
Deprecated.
Accessor for nested Scala object
|
PathMatcher<scala.runtime.BoxedUnit> |
Neutral()
Deprecated.
|
PathMatchers.PathEnd$ |
PathEnd()
Deprecated.
Accessor for nested Scala object
|
protected 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<org.apache.pekko.Done> attempt,
org.apache.pekko.actor.ActorSystem system)
Deprecated.
Hook that will be called just after the server termination.
|
PathMatchers.Remaining$ |
Remaining()
Deprecated.
Accessor for nested Scala object
|
PathMatchers.RemainingPath$ |
RemainingPath()
Deprecated.
Accessor for nested Scala object
|
protected 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 object
|
PathMatcher<scala.Tuple1<scala.collection.immutable.List<java.lang.String>>> |
Segments()
Deprecated.
|
PathMatchers.Slash$ |
Slash()
Deprecated.
Accessor for nested Scala object
|
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,
org.apache.pekko.actor.ActorSystem system)
Deprecated.
Start a server on the specified host and port, using the provided
ActorSystem . |
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,
org.apache.pekko.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,
scala.Option<org.apache.pekko.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.atomic.AtomicReference<org.apache.pekko.actor.ActorSystem> |
systemReference()
Deprecated.
ActorSystem used to start this server. |
protected scala.concurrent.Future<org.apache.pekko.Done> |
waitForShutdownSignal(org.apache.pekko.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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_enhanceRouteWithConcatenation, concat
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
conditional, conditional, conditional, conditional
cookie, deleteCookie, deleteCookie, findCookie, optionalCookie, setCookie
logRequest, logRequestResult, logResult
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
handleExceptions, handleRejections
_defaultClassLoader, conditionalFor, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResourceDirectory, listDirectoryContents
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
formField, formFieldMap, formFieldMultiMap, formFields, formFieldSeq
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
completeOrRecoverWith, onComplete, onCompleteWithBreaker, onSuccess
checkSameOrigin, headerValue, headerValueByName, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, optionalValue
extractHost, host, host, host
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
parameter, parameterMap, parameterMultiMap, parameters, parameterSeq
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
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
ignoreTrailingSlash, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffixTest, rawPathPrefix, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing
not, nothingMatcher, Segments, Segments, separateOnSlashes
_regex2PathMatcher, _segmentStringToPathMatcher, _stringExtractionPair2PathMatcher, _stringNameOptionReceptacle2PathMatcher, _valueMap2PathMatcher
_string2NR, _symbol2NR
withRangeSupport
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, respondWithHeaders
complete, complete, complete, failWith, handle, handle, handle, handleSync, handleSync, handleSync, redirect, reject, reject
extractScheme, scheme
authenticateBasic, authenticateBasicAsync, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2PF, authenticateOAuth2PFAsync, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorize, authorizeAsync, authorizeAsync, extractCredentials, extractCredentialsAndAuthenticateOrRejectWithChallenge
extractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
asSourceOf, asSourceOf, asSourceOfInternal
as, completeWith, entity, handleWith, instanceOf
attribute, optionalAttribute
public PathMatcher<scala.Tuple1<java.lang.Object>> DoubleNumber()
DoubleNumber
in interface PathMatchers
public PathMatchers.HexIntNumber$ HexIntNumber()
PathMatchers
HexIntNumber
in interface PathMatchers
public PathMatchers.HexLongNumber$ HexLongNumber()
PathMatchers
HexLongNumber
in interface PathMatchers
public PathMatchers.IntNumber$ IntNumber()
PathMatchers
IntNumber
in interface PathMatchers
public PathMatcher<scala.Tuple1<java.util.UUID>> JavaUUID()
JavaUUID
in interface PathMatchers
public PathMatchers.LongNumber$ LongNumber()
PathMatchers
LongNumber
in interface PathMatchers
public PathMatcher<scala.runtime.BoxedUnit> Neutral()
Neutral
in interface PathMatchers
public PathMatchers.PathEnd$ PathEnd()
PathMatchers
PathEnd
in interface PathMatchers
public PathMatchers.Remaining$ Remaining()
PathMatchers
Remaining
in interface PathMatchers
public PathMatchers.RemainingPath$ RemainingPath()
PathMatchers
RemainingPath
in interface PathMatchers
public PathMatchers.Segment$ Segment()
PathMatchers
Segment
in interface PathMatchers
public PathMatcher<scala.Tuple1<scala.collection.immutable.List<java.lang.String>>> Segments()
Segments
in interface PathMatchers
public PathMatchers.Slash$ Slash()
PathMatchers
Slash
in interface PathMatchers
public scala.util.Try<Http.ServerBinding> binding()
ServerBinding
if the server has been successfully started. It fails otherwise.
You can use this method to attempt to retrieve the ServerBinding
at any point in time to, for example, stop the server due to unexpected circumstances.protected void postHttpBinding(Http.ServerBinding binding)
binding
- (undocumented)protected void postHttpBindingFailure(java.lang.Throwable cause)
cause
- (undocumented)protected void postServerShutdown(scala.util.Try<org.apache.pekko.Done> attempt, org.apache.pekko.actor.ActorSystem system)
attempt
parameter is represented with a Try
type that is successful only if the server was successfully shut down.attempt
- (undocumented)system
- (undocumented)protected abstract scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> routes()
public void startServer(java.lang.String host, int port)
host
- (undocumented)port
- (undocumented)public void startServer(java.lang.String host, int port, org.apache.pekko.actor.ActorSystem system)
ActorSystem
.
Note that this method is blocking
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.host
- (undocumented)port
- (undocumented)public void startServer(java.lang.String host, int port, ServerSettings settings)
host
- (undocumented)port
- (undocumented)settings
- (undocumented)public void startServer(java.lang.String host, int port, ServerSettings settings, org.apache.pekko.actor.ActorSystem system)
ActorSystem
.
Note that this method is blocking.
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.host
- (undocumented)port
- (undocumented)settings
- (undocumented)public void startServer(java.lang.String host, int port, ServerSettings settings, scala.Option<org.apache.pekko.actor.ActorSystem> system)
ActorSystem
if present.
Note that this method is blocking.
system
- ActorSystem to use for starting the app,
if None
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)protected java.util.concurrent.atomic.AtomicReference<org.apache.pekko.actor.ActorSystem> systemReference()
ActorSystem
used to start this server. Stopping this system will interfere with the proper functioning condition of the server.protected scala.concurrent.Future<org.apache.pekko.Done> waitForShutdownSignal(org.apache.pekko.actor.ActorSystem system, scala.concurrent.ExecutionContext ec)
system
- (undocumented)ec
- (undocumented)