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.RouteWithConcatenationFileAndResourceDirectives.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, concatcancelRejection, 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, withSettingsconditional, conditional, conditional, conditionalcookie, deleteCookie, deleteCookie, findCookie, optionalCookie, setCookielogRequest, logRequestResult, logResultdecodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupporthandleExceptions, handleRejections_defaultClassLoader, conditionalFor, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResourceDirectory, listDirectoryContentsfileUpload, fileUploadAll, storeUploadedFile, storeUploadedFilesformField, formFieldMap, formFieldMultiMap, formFields, formFieldSeqformField, 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, formFieldscompleteOrRecoverWith, onComplete, onCompleteWithBreaker, onSuccesscheckSameOrigin, headerValue, headerValueByName, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, optionalValueextractHost, host, host, hostdelete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, putextractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimitparameter, parameterMap, parameterMultiMap, parameters, parameterSeqparameter, 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, parametersextractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponseignoreTrailingSlash, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffixTest, rawPathPrefix, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissingnot, nothingMatcher, Segments, Segments, separateOnSlashes_regex2PathMatcher, _segmentStringToPathMatcher, _stringExtractionPair2PathMatcher, _stringNameOptionReceptacle2PathMatcher, _valueMap2PathMatcher_string2NR, _symbol2NRwithRangeSupportrespondWithDefaultHeader, respondWithDefaultHeaders, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, respondWithHeaderscomplete, complete, complete, failWith, handle, handle, handle, handleSync, handleSync, handleSync, redirect, reject, rejectextractScheme, schemeauthenticateBasic, authenticateBasicAsync, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2PF, authenticateOAuth2PFAsync, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorize, authorizeAsync, authorizeAsync, extractCredentials, extractCredentialsAndAuthenticateOrRejectWithChallengeextractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocolasSourceOf, asSourceOf, asSourceOfInternalas, completeWith, entity, handleWith, instanceOfattribute, optionalAttributepublic PathMatcher<scala.Tuple1<java.lang.Object>> DoubleNumber()
DoubleNumber in interface PathMatcherspublic PathMatchers.HexIntNumber$ HexIntNumber()
PathMatchersHexIntNumber in interface PathMatcherspublic PathMatchers.HexLongNumber$ HexLongNumber()
PathMatchersHexLongNumber in interface PathMatcherspublic PathMatchers.IntNumber$ IntNumber()
PathMatchersIntNumber in interface PathMatcherspublic PathMatcher<scala.Tuple1<java.util.UUID>> JavaUUID()
JavaUUID in interface PathMatcherspublic PathMatchers.LongNumber$ LongNumber()
PathMatchersLongNumber in interface PathMatcherspublic PathMatcher<scala.runtime.BoxedUnit> Neutral()
Neutral in interface PathMatcherspublic PathMatchers.PathEnd$ PathEnd()
PathMatchersPathEnd in interface PathMatcherspublic PathMatchers.Remaining$ Remaining()
PathMatchersRemaining in interface PathMatcherspublic PathMatchers.RemainingPath$ RemainingPath()
PathMatchersRemainingPath in interface PathMatcherspublic PathMatchers.Segment$ Segment()
PathMatchersSegment in interface PathMatcherspublic PathMatcher<scala.Tuple1<scala.collection.immutable.List<java.lang.String>>> Segments()
Segments in interface PathMatcherspublic PathMatchers.Slash$ Slash()
PathMatchersSlash in interface PathMatcherspublic 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)