=doc fix scaladoc warnings #18500
This commit is contained in:
parent
54fdc40f76
commit
2cdf447f6e
31 changed files with 92 additions and 93 deletions
|
|
@ -114,7 +114,7 @@ abstract class ClusterShardingGetStatsSpec extends MultiNodeSpec(ClusterSharding
|
|||
// make sure all nodes are up
|
||||
within(10.seconds) {
|
||||
awaitAssert {
|
||||
Cluster(system).state.members.count(_.status == MemberStatus.Up) should === (4)
|
||||
Cluster(system).state.members.count(_.status == MemberStatus.Up) should ===(4)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,16 +54,16 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
private[this] final val DefaultPortForProtocol = -1 // any negative value
|
||||
|
||||
/**
|
||||
* Creates a [[akka.stream.scaladsl.Source]] of [[IncomingConnection]] instances which represents a prospective HTTP server binding
|
||||
* Creates a [[akka.stream.scaladsl.Source]] of [[akka.http.scaladsl.Http.IncomingConnection]] instances which represents a prospective HTTP server binding
|
||||
* on the given `endpoint`.
|
||||
*
|
||||
* If the given port is 0 the resulting source can be materialized several times. Each materialization will
|
||||
* then be assigned a new local port by the operating system, which can then be retrieved by the materialized
|
||||
* [[ServerBinding]].
|
||||
* [[akka.http.scaladsl.Http.ServerBinding]].
|
||||
*
|
||||
* If the given port is non-zero subsequent materialization attempts of the produced source will immediately
|
||||
* fail, unless the first materialization has already been unbound. Unbinding can be triggered via the materialized
|
||||
* [[ServerBinding]].
|
||||
* [[akka.http.scaladsl.Http.ServerBinding]].
|
||||
*
|
||||
* If an [[ConnectionContext]] is given it will be used for setting up TLS encryption on the binding.
|
||||
* Otherwise the binding will be unencrypted.
|
||||
|
|
@ -94,13 +94,13 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
|
||||
/**
|
||||
* Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
|
||||
* [[Flow]] for processing all incoming connections.
|
||||
* [[akka.stream.scaladsl.Flow]] for processing all incoming connections.
|
||||
*
|
||||
* The number of concurrently accepted connections can be configured by overriding
|
||||
* the `akka.http.server.max-connections` setting.
|
||||
*
|
||||
* To configure additional settings for a server started using this method,
|
||||
* use the `akka.http.server` config section or pass in a [[ServerSettings]] explicitly.
|
||||
* use the `akka.http.server` config section or pass in a [[akka.http.scaladsl.settings.ServerSettings]] explicitly.
|
||||
*/
|
||||
def bindAndHandle(handler: Flow[HttpRequest, HttpResponse, Any],
|
||||
interface: String, port: Int = DefaultPortForProtocol,
|
||||
|
|
@ -135,13 +135,13 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
|
||||
/**
|
||||
* Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
|
||||
* [[Flow]] for processing all incoming connections.
|
||||
* [[akka.stream.scaladsl.Flow]] for processing all incoming connections.
|
||||
*
|
||||
* The number of concurrently accepted connections can be configured by overriding
|
||||
* the `akka.http.server.max-connections` setting.
|
||||
*
|
||||
* To configure additional settings for a server started using this method,
|
||||
* use the `akka.http.server` config section or pass in a [[ServerSettings]] explicitly.
|
||||
* use the `akka.http.server` config section or pass in a [[akka.http.scaladsl.settings.ServerSettings]] explicitly.
|
||||
*/
|
||||
def bindAndHandleSync(handler: HttpRequest ⇒ HttpResponse,
|
||||
interface: String, port: Int = DefaultPortForProtocol,
|
||||
|
|
@ -152,13 +152,13 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
|
||||
/**
|
||||
* Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
|
||||
* [[Flow]] for processing all incoming connections.
|
||||
* [[akka.stream.scaladsl.Flow]] for processing all incoming connections.
|
||||
*
|
||||
* The number of concurrently accepted connections can be configured by overriding
|
||||
* the `akka.http.server.max-connections` setting.
|
||||
*
|
||||
* To configure additional settings for a server started using this method,
|
||||
* use the `akka.http.server` config section or pass in a [[ServerSettings]] explicitly.
|
||||
* use the `akka.http.server` config section or pass in a [[akka.http.scaladsl.settings.ServerSettings]] explicitly.
|
||||
*/
|
||||
def bindAndHandleAsync(handler: HttpRequest ⇒ Future[HttpResponse],
|
||||
interface: String, port: Int = DefaultPortForProtocol,
|
||||
|
|
@ -171,16 +171,16 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
type ServerLayer = Http.ServerLayer
|
||||
|
||||
/**
|
||||
* Constructs a [[ServerLayer]] stage using the configured default [[ServerSettings]],
|
||||
* Constructs a [[akka.http.scaladsl.Http.ServerLayer]] stage using the configured default [[akka.http.scaladsl.settings.ServerSettings]],
|
||||
* configured using the `akka.http.server` config section.
|
||||
*
|
||||
* The returned [[BidiFlow]] can only be materialized once.
|
||||
* The returned [[akka.stream.scaladsl.BidiFlow]] can only be materialized once.
|
||||
*/
|
||||
def serverLayer()(implicit mat: Materializer): ServerLayer = serverLayer(ServerSettings(system))
|
||||
|
||||
/**
|
||||
* Constructs a [[ServerLayer]] stage using the given [[ServerSettings]]. The returned [[BidiFlow]] isn't reusable and
|
||||
* can only be materialized once. The `remoteAddress`, if provided, will be added as a header to each [[HttpRequest]]
|
||||
* Constructs a [[akka.http.scaladsl.Http.ServerLayer]] stage using the given [[akka.http.scaladsl.settings.ServerSettings]]. The returned [[akka.stream.scaladsl.BidiFlow]] isn't reusable and
|
||||
* can only be materialized once. The `remoteAddress`, if provided, will be added as a header to each [[akka.http.scaladsl.model.HttpRequest]]
|
||||
* this layer produces if the `akka.http.server.remote-address-header` configuration option is enabled.
|
||||
*/
|
||||
def serverLayer(settings: ServerSettings,
|
||||
|
|
@ -191,11 +191,11 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
// ** CLIENT ** //
|
||||
|
||||
/**
|
||||
* Creates a [[Flow]] representing a prospective HTTP client connection to the given endpoint.
|
||||
* Creates a [[akka.stream.scaladsl.Flow]] representing a prospective HTTP client connection to the given endpoint.
|
||||
* Every materialization of the produced flow will attempt to establish a new outgoing connection.
|
||||
*
|
||||
* To configure additional settings for requests made using this method,
|
||||
* use the `akka.http.client` config section or pass in a [[ClientConnectionSettings]] explicitly.
|
||||
* use the `akka.http.client` config section or pass in a [[akka.http.scaladsl.settings.ClientConnectionSettings]] explicitly.
|
||||
*/
|
||||
def outgoingConnection(host: String, port: Int = 80,
|
||||
localAddress: Option[InetSocketAddress] = None,
|
||||
|
|
@ -204,13 +204,13 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
_outgoingConnection(host, port, localAddress, settings, ConnectionContext.noEncryption(), log)
|
||||
|
||||
/**
|
||||
* Same as [[outgoingConnection]] but for encrypted (HTTPS) connections.
|
||||
* Same as [[#outgoingConnection]] but for encrypted (HTTPS) connections.
|
||||
*
|
||||
* If an explicit [[HttpsConnectionContext]] is given then it rather than the configured default [[HttpsConnectionContext]] will be used
|
||||
* for encryption on the connection.
|
||||
*
|
||||
* To configure additional settings for requests made using this method,
|
||||
* use the `akka.http.client` config section or pass in a [[ClientConnectionSettings]] explicitly.
|
||||
* use the `akka.http.client` config section or pass in a [[akka.http.scaladsl.settings.ClientConnectionSettings]] explicitly.
|
||||
*/
|
||||
def outgoingConnectionHttps(host: String, port: Int = 443,
|
||||
connectionContext: HttpsConnectionContext = defaultClientHttpsContext,
|
||||
|
|
@ -246,14 +246,14 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
type ClientLayer = Http.ClientLayer
|
||||
|
||||
/**
|
||||
* Constructs a [[ClientLayer]] stage using the configured default [[ClientConnectionSettings]],
|
||||
* Constructs a [[akka.http.scaladsl.Http.ClientLayer]] stage using the configured default [[akka.http.scaladsl.settings.ClientConnectionSettings]],
|
||||
* configured using the `akka.http.client` config section.
|
||||
*/
|
||||
def clientLayer(hostHeader: Host): ClientLayer =
|
||||
clientLayer(hostHeader, ClientConnectionSettings(system))
|
||||
|
||||
/**
|
||||
* Constructs a [[ClientLayer]] stage using the given [[ClientConnectionSettings]].
|
||||
* Constructs a [[akka.http.scaladsl.Http.ClientLayer]] stage using the given [[akka.http.scaladsl.settings.ClientConnectionSettings]].
|
||||
*/
|
||||
def clientLayer(hostHeader: Host,
|
||||
settings: ClientConnectionSettings,
|
||||
|
|
@ -263,7 +263,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
// ** CONNECTION POOL ** //
|
||||
|
||||
/**
|
||||
* Starts a new connection pool to the given host and configuration and returns a [[Flow]] which dispatches
|
||||
* Starts a new connection pool to the given host and configuration and returns a [[akka.stream.scaladsl.Flow]] which dispatches
|
||||
* the requests from all its materializations across this pool.
|
||||
* While the started host connection pool internally shuts itself down automatically after the configured idle
|
||||
* timeout it will spin itself up again if more requests arrive from an existing or a new client flow
|
||||
|
|
@ -287,7 +287,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
}
|
||||
|
||||
/**
|
||||
* Same as [[newHostConnectionPool]] but for encrypted (HTTPS) connections.
|
||||
* Same as [[#newHostConnectionPool]] but for encrypted (HTTPS) connections.
|
||||
*
|
||||
* If an explicit [[ConnectionContext]] is given then it rather than the configured default [[ConnectionContext]] will be used
|
||||
* for encryption on the connections.
|
||||
|
|
@ -306,7 +306,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
/**
|
||||
* INTERNAL API
|
||||
*
|
||||
* Starts a new connection pool to the given host and configuration and returns a [[Flow]] which dispatches
|
||||
* Starts a new connection pool to the given host and configuration and returns a [[akka.stream.scaladsl.Flow]] which dispatches
|
||||
* the requests from all its materializations across this pool.
|
||||
* While the started host connection pool internally shuts itself down automatically after the configured idle
|
||||
* timeout it will spin itself up again if more requests arrive from an existing or a new client flow
|
||||
|
|
@ -326,11 +326,11 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a [[Flow]] which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing
|
||||
* Returns a [[akka.stream.scaladsl.Flow]] which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing
|
||||
* HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool
|
||||
* configuration a separate connection pool is maintained.
|
||||
* The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured.
|
||||
* The returned [[Flow]] instances therefore remain valid throughout the lifetime of the application.
|
||||
* The returned [[akka.stream.scaladsl.Flow]] instances therefore remain valid throughout the lifetime of the application.
|
||||
*
|
||||
* The internal caching logic guarantees that there will never be more than a single pool running for the
|
||||
* given target host endpoint and configuration (in this ActorSystem).
|
||||
|
|
@ -354,7 +354,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
}
|
||||
|
||||
/**
|
||||
* Same as [[cachedHostConnectionPool]] but for encrypted (HTTPS) connections.
|
||||
* Same as [[#cachedHostConnectionPool]] but for encrypted (HTTPS) connections.
|
||||
*
|
||||
* If an explicit [[ConnectionContext]] is given then it rather than the configured default [[ConnectionContext]] will be used
|
||||
* for encryption on the connections.
|
||||
|
|
@ -372,11 +372,11 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a [[Flow]] which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing
|
||||
* Returns a [[akka.stream.scaladsl.Flow]] which dispatches incoming HTTP requests to the per-ActorSystem pool of outgoing
|
||||
* HTTP connections to the given target host endpoint. For every ActorSystem, target host and pool
|
||||
* configuration a separate connection pool is maintained.
|
||||
* The HTTP layer transparently manages idle shutdown and restarting of connections pools as configured.
|
||||
* The returned [[Flow]] instances therefore remain valid throughout the lifetime of the application.
|
||||
* The returned [[akka.stream.scaladsl.Flow]] instances therefore remain valid throughout the lifetime of the application.
|
||||
*
|
||||
* The internal caching logic guarantees that there will never be more than a single pool running for the
|
||||
* given target host endpoint and configuration (in this ActorSystem).
|
||||
|
|
@ -415,7 +415,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
clientFlow[T](settings) { request ⇒ request -> cachedGateway(request, settings, connectionContext, log) }
|
||||
|
||||
/**
|
||||
* Fires a single [[HttpRequest]] across the (cached) host connection pool for the request's
|
||||
* Fires a single [[akka.http.scaladsl.model.HttpRequest]] across the (cached) host connection pool for the request's
|
||||
* effective URI to produce a response future.
|
||||
*
|
||||
* If an explicit [[ConnectionContext]] is given then it rather than the configured default [[ConnectionContext]] will be used
|
||||
|
|
@ -435,7 +435,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a [[WebSocketClientLayer]] stage using the configured default [[ClientConnectionSettings]],
|
||||
* Constructs a [[akka.http.scaladsl.Http.WebSocketClientLayer]] stage using the configured default [[akka.http.scaladsl.settings.ClientConnectionSettings]],
|
||||
* configured using the `akka.http.client` config section.
|
||||
*
|
||||
* The layer is not reusable and must only be materialized once.
|
||||
|
|
@ -487,7 +487,7 @@ class HttpExt(private val config: Config)(implicit val system: ActorSystem) exte
|
|||
.joinMat(clientFlow)(Keep.both).run()
|
||||
|
||||
/**
|
||||
* Triggers an orderly shutdown of all host connections pools currently maintained by the [[ActorSystem]].
|
||||
* Triggers an orderly shutdown of all host connections pools currently maintained by the [[akka.actor.ActorSystem]].
|
||||
* The returned future is completed when all pools that were live at the time of this method call
|
||||
* have completed their shutdown process.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ object HttpRequest {
|
|||
* http://tools.ietf.org/html/rfc7230#section-5.5
|
||||
*
|
||||
* Throws an [[IllegalUriException]] if the URI is relative and the `headers` don't
|
||||
* include a valid [[Host]] header or if URI authority and [[Host]] header don't match.
|
||||
* include a valid [[akka.http.scaladsl.model.headers.Host]] header or if URI authority and [[akka.http.scaladsl.model.headers.Host]] header don't match.
|
||||
*/
|
||||
def effectiveUri(uri: Uri, headers: immutable.Seq[HttpHeader], securedConnection: Boolean, defaultHostHeader: Host): Uri = {
|
||||
val hostHeader = headers.collectFirst { case x: Host ⇒ x }
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ sealed trait Multipart extends jm.Multipart {
|
|||
def toStrict(timeout: FiniteDuration)(implicit fm: Materializer): Future[Multipart.Strict]
|
||||
|
||||
/**
|
||||
* Creates a [[MessageEntity]] from this multipart object.
|
||||
* Creates a [[akka.http.scaladsl.model.MessageEntity]] from this multipart object.
|
||||
*/
|
||||
def toEntity(charset: HttpCharset = HttpCharsets.`UTF-8`,
|
||||
boundary: String = BodyPartRenderer.randomBoundary())(implicit log: LoggingAdapter = NoLogging): MessageEntity = {
|
||||
|
|
@ -146,7 +146,7 @@ object Multipart {
|
|||
}
|
||||
|
||||
/**
|
||||
* The [[ContentDispositionType]] of the potentially present [[`Content-Disposition`]] header.
|
||||
* The [[akka.http.scaladsl.model.headers.ContentDispositionType]] of the potentially present [[`Content-Disposition`]] header.
|
||||
*/
|
||||
def dispositionType: Option[ContentDispositionType] =
|
||||
contentDispositionHeader.map(_.dispositionType)
|
||||
|
|
@ -510,7 +510,7 @@ object Multipart {
|
|||
def contentRange: ContentRange
|
||||
|
||||
/**
|
||||
* The [[RangeUnit]] for the `contentRange`.
|
||||
* The [[akka.http.scaladsl.model.headers.RangeUnit]] for the `contentRange`.
|
||||
*/
|
||||
def rangeUnit: RangeUnit
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import java.util.concurrent.CompletionStage
|
|||
|
||||
/**
|
||||
* A convenience class to derive from to get everything from HttpService and Directives into scope.
|
||||
* Implement the [[createRoute]] method to provide the Route and then call [[bindRoute]]
|
||||
* Implement the [[#createRoute]] method to provide the Route and then call [[#bindRoute]]
|
||||
* to start the server on the specified interface.
|
||||
*/
|
||||
abstract class HttpApp
|
||||
|
|
@ -20,7 +20,7 @@ abstract class HttpApp
|
|||
|
||||
/**
|
||||
* Starts an HTTP server on the given interface and port. Creates the route by calling the
|
||||
* user-implemented [[createRoute]] method and uses the route to handle requests of the server.
|
||||
* user-implemented [[#createRoute]] method and uses the route to handle requests of the server.
|
||||
*/
|
||||
def bindRoute(interface: String, port: Int, system: ActorSystem): CompletionStage[ServerBinding] =
|
||||
bindRoute(interface, port, createRoute(), system)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ abstract class RejectionHandler {
|
|||
def handleUnacceptedResponseEncodingRejection(ctx: RequestContext, supported: jl.Iterable[HttpEncoding]): RouteResult = passRejection()
|
||||
|
||||
/**
|
||||
* Callback called to handle rejection created by an [[akka.http.scaladsl.server.authentication.HttpAuthenticator]].
|
||||
* Callback called to handle rejection created by an [[akka.http.javadsl.server.values.HttpBasicAuthenticator]].
|
||||
* Signals that the request was rejected because the user could not be authenticated. The reason for the rejection is
|
||||
* specified in the cause.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package akka.http.javadsl.server
|
|||
* A marker interface to denote an element that handles a request.
|
||||
*
|
||||
* This is an opaque interface that cannot be implemented manually.
|
||||
* Instead, see the predefined routes in [[Directives]] and use the [[Directives.handleWith]]
|
||||
* Instead, see the predefined routes in [[Directives]] and use the [[Directives#handleWith]]
|
||||
* method to create custom routes.
|
||||
*/
|
||||
trait Route
|
||||
|
|
@ -133,8 +133,7 @@ abstract class PathDirectives extends MiscDirectives {
|
|||
* }
|
||||
* }}}
|
||||
*
|
||||
* For further information, refer to:
|
||||
* [[http://googlewebmastercentral.blogspot.de/2010/04/to-slash-or-not-to-slash.html]]
|
||||
* For further information, refer to: http://googlewebmastercentral.blogspot.de/2010/04/to-slash-or-not-to-slash.html
|
||||
*/
|
||||
def pathEndOrSingleSlash: Directive = RawPathPrefixForMatchers(List(PathMatchers.SLASH.optional, PathMatchers.END))
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ abstract class RangeDirectives extends PathDirectives {
|
|||
* it on the *inside* of the `conditional(...)` directive, i.e. `conditional(...)` must be
|
||||
* on a higher level in your route structure in order to function correctly.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc7233
|
||||
* For more information, see: https://tools.ietf.org/html/rfc7233
|
||||
*/
|
||||
@varargs def withRangeSupport(innerRoute: Route, moreInnerRoutes: Route*): Route = RangeSupport()(innerRoute, moreInnerRoutes.toList)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import akka.stream.javadsl.Flow
|
|||
abstract class WebSocketDirectives extends SchemeDirectives {
|
||||
/**
|
||||
* Handles websocket requests with the given handler and rejects other requests with a
|
||||
* [[ExpectedWebSocketRequestRejection]].
|
||||
* [[akka.http.scaladsl.server.ExpectedWebSocketRequestRejection]].
|
||||
*/
|
||||
def handleWebSocketMessages(handler: Flow[Message, Message, _]): Route =
|
||||
RouteStructure.HandleWebSocketMessages(handler)
|
||||
|
|
|
|||
|
|
@ -32,16 +32,16 @@ trait BasicCredentials {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implement this class to provide an HTTP Basic authentication check. The [[authenticate]] method needs to be implemented
|
||||
* Implement this class to provide an HTTP Basic authentication check. The [[#authenticate]] method needs to be implemented
|
||||
* to check if the supplied or missing credentials are authenticated and provide a domain level object representing
|
||||
* the user as a [[RequestVal]].
|
||||
* the user as a [[akka.http.javadsl.server.RequestVal]].
|
||||
*/
|
||||
abstract class HttpBasicAuthenticator[T](val realm: String) extends AbstractDirective with ExtractionImplBase[T] with RequestVal[T] {
|
||||
protected[http] implicit def classTag: ClassTag[T] = reflect.classTag[AnyRef].asInstanceOf[ClassTag[T]]
|
||||
def authenticate(credentials: BasicCredentials): CompletionStage[Optional[T]]
|
||||
|
||||
/**
|
||||
* Creates a return value for use in [[authenticate]] that successfully authenticates the requests and provides
|
||||
* Creates a return value for use in [[#authenticate]] that successfully authenticates the requests and provides
|
||||
* the given user.
|
||||
*/
|
||||
def authenticateAs(user: T): CompletionStage[Optional[T]] = CompletableFuture.completedFuture(Optional.of(user))
|
||||
|
|
|
|||
|
|
@ -32,16 +32,16 @@ trait OAuth2Credentials {
|
|||
}
|
||||
|
||||
/**
|
||||
* Implement this class to provide an OAuth 2 Bearer Token authentication check. The [[authenticate]] method needs to be implemented
|
||||
* Implement this class to provide an OAuth 2 Bearer Token authentication check. The [[#authenticate]] method needs to be implemented
|
||||
* to check if the supplied or missing credentials are authenticated and provide a domain level object representing
|
||||
* the user as a [[RequestVal]].
|
||||
* the user as a [[akka.http.javadsl.server.RequestVal]].
|
||||
*/
|
||||
abstract class OAuth2Authenticator[T](val realm: String) extends AbstractDirective with ExtractionImplBase[T] with RequestVal[T] {
|
||||
protected[http] implicit def classTag: ClassTag[T] = reflect.classTag[AnyRef].asInstanceOf[ClassTag[T]]
|
||||
def authenticate(credentials: OAuth2Credentials): CompletionStage[Optional[T]]
|
||||
|
||||
/**
|
||||
* Creates a return value for use in [[authenticate]] that successfully authenticates the requests and provides
|
||||
* Creates a return value for use in [[#authenticate]] that successfully authenticates the requests and provides
|
||||
* the given user.
|
||||
*/
|
||||
def authenticateAs(user: T): CompletionStage[Optional[T]] = CompletableFuture.completedFuture(Optional.of(user))
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import scala.reflect.ClassTag
|
|||
* It is also a RequestVal that allows to access dynamic parts of the part in a
|
||||
* handler.
|
||||
*
|
||||
* Using a PathMatcher with the [[Directives.path]] or [[Directives.pathPrefix]] directives
|
||||
* "consumes" a part of the path which is recorded in [[RequestContext.unmatchedPath]].
|
||||
* Using a PathMatcher with the [[akka.http.javadsl.server.Directives#path]] or [[akka.http.javadsl.server.Directives#pathPrefix]] directives
|
||||
* "consumes" a part of the path which is recorded in [[akka.http.javadsl.server.RequestContext#unmatchedPath]].
|
||||
*/
|
||||
trait PathMatcher[T] extends RequestVal[T] {
|
||||
def optional: PathMatcher[Optional[T]]
|
||||
|
|
|
|||
|
|
@ -19,20 +19,20 @@ sealed abstract class Marshaller[-A, +B] {
|
|||
|
||||
/**
|
||||
* Reuses this Marshaller's logic to produce a new Marshaller from another type `C` which overrides
|
||||
* the [[MediaType]] of the marshalling result with the given one.
|
||||
* Note that not all wrappings are legal. f the underlying [[MediaType]] has constraints with regard to the
|
||||
* charsets it allows the new [[MediaType]] must be compatible, since akka-http will never recode entities.
|
||||
* If the wrapping is illegal the [[Future]] produced by the resulting marshaller will contain a [[RuntimeException]].
|
||||
* the [[akka.http.scaladsl.model.MediaType]] of the marshalling result with the given one.
|
||||
* Note that not all wrappings are legal. f the underlying [[akka.http.scaladsl.model.MediaType]] has constraints with regard to the
|
||||
* charsets it allows the new [[akka.http.scaladsl.model.MediaType]] must be compatible, since akka-http will never recode entities.
|
||||
* If the wrapping is illegal the [[scala.concurrent.Future]] produced by the resulting marshaller will contain a [[RuntimeException]].
|
||||
*/
|
||||
def wrap[C, D >: B](newMediaType: MediaType)(f: C ⇒ A)(implicit mto: ContentTypeOverrider[D]): Marshaller[C, D] =
|
||||
wrapWithEC[C, D](newMediaType)(_ ⇒ f)
|
||||
|
||||
/**
|
||||
* Reuses this Marshaller's logic to produce a new Marshaller from another type `C` which overrides
|
||||
* the [[MediaType]] of the marshalling result with the given one.
|
||||
* Note that not all wrappings are legal. f the underlying [[MediaType]] has constraints with regard to the
|
||||
* charsets it allows the new [[MediaType]] must be compatible, since akka-http will never recode entities.
|
||||
* If the wrapping is illegal the [[Future]] produced by the resulting marshaller will contain a [[RuntimeException]].
|
||||
* the [[akka.http.scaladsl.model.MediaType]] of the marshalling result with the given one.
|
||||
* Note that not all wrappings are legal. f the underlying [[akka.http.scaladsl.model.MediaType]] has constraints with regard to the
|
||||
* charsets it allows the new [[akka.http.scaladsl.model.MediaType]] must be compatible, since akka-http will never recode entities.
|
||||
* If the wrapping is illegal the [[scala.concurrent.Future]] produced by the resulting marshaller will contain a [[RuntimeException]].
|
||||
*/
|
||||
def wrapWithEC[C, D >: B](newMediaType: MediaType)(f: ExecutionContext ⇒ C ⇒ A)(implicit cto: ContentTypeOverrider[D]): Marshaller[C, D] =
|
||||
Marshaller { implicit ec ⇒
|
||||
|
|
@ -149,7 +149,7 @@ sealed trait Marshalling[+A] {
|
|||
object Marshalling {
|
||||
|
||||
/**
|
||||
* A Marshalling to a specific [[ContentType]].
|
||||
* A Marshalling to a specific [[akka.http.scaladsl.model.ContentType]].
|
||||
*/
|
||||
final case class WithFixedContentType[A](contentType: ContentType,
|
||||
marshal: () ⇒ A) extends Marshalling[A] {
|
||||
|
|
@ -157,7 +157,7 @@ object Marshalling {
|
|||
}
|
||||
|
||||
/**
|
||||
* A Marshalling to a specific [[MediaType]] with a flexible charset.
|
||||
* A Marshalling to a specific [[akka.http.scaladsl.model.MediaType]] with a flexible charset.
|
||||
*/
|
||||
final case class WithOpenCharset[A](mediaType: MediaType.WithOpenCharset,
|
||||
marshal: HttpCharset ⇒ A) extends Marshalling[A] {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ final class MediaTypeNegotiator(requestHeaders: Seq[HttpHeader]) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given [[MediaType]] is accepted by the client.
|
||||
* Determines whether the given [[akka.http.scaladsl.model.MediaType]] is accepted by the client.
|
||||
*/
|
||||
def isAccepted(mediaType: MediaType): Boolean = qValueFor(mediaType) > 0f
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ abstract class Directive[L](implicit val ev: Tuple[L]) {
|
|||
|
||||
/**
|
||||
* Maps over this directive using the given function, which can produce either a tuple or any other value
|
||||
* (which will then we wrapped into a [[Tuple1]]).
|
||||
* (which will then we wrapped into a [[scala.Tuple1]]).
|
||||
*/
|
||||
def tmap[R](f: L ⇒ R)(implicit tupler: Tupler[R]): Directive[tupler.Out] =
|
||||
Directive[tupler.Out] { inner ⇒ tapply { values ⇒ inner(tupler(f(values))) } }(tupler.OutIsTuple)
|
||||
|
|
@ -70,7 +70,7 @@ abstract class Directive[L](implicit val ev: Tuple[L]) {
|
|||
Directive[R] { inner ⇒ tapply { values ⇒ f(values) tapply inner } }
|
||||
|
||||
/**
|
||||
* Creates a new [[Directive0]], which passes if the given predicate matches the current
|
||||
* Creates a new [[akka.http.scaladsl.server.Directive0]], which passes if the given predicate matches the current
|
||||
* extractions or rejects with the given rejections.
|
||||
*/
|
||||
def trequire(predicate: L ⇒ Boolean, rejections: Rejection*): Directive0 =
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import headers._
|
|||
|
||||
/**
|
||||
* A rejection encapsulates a specific reason why a Route was not able to handle a request. Rejections are gathered
|
||||
* up over the course of a Route evaluation and finally converted to [[spray.http.HttpResponse]]s by the
|
||||
* up over the course of a Route evaluation and finally converted to [[akka.http.scaladsl.model.HttpResponse]]s by the
|
||||
* `handleRejections` directive, if there was no way for the request to be completed.
|
||||
*/
|
||||
trait Rejection
|
||||
|
|
@ -125,7 +125,7 @@ object UnacceptedResponseEncodingRejection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Rejection created by an [[akka.http.scaladsl.server.authentication.HttpAuthenticator]].
|
||||
* Rejection created by an [[akka.http.javadsl.server.values.HttpBasicAuthenticator]].
|
||||
* Signals that the request was rejected because the user could not be authenticated. The reason for the rejection is
|
||||
* specified in the cause.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ trait RequestContext {
|
|||
def withRoutingSettings(settings: RoutingSettings): RequestContext
|
||||
|
||||
/**
|
||||
* Returns a copy of this context with the new [[ParserSettings]].
|
||||
* Returns a copy of this context with the new [[akka.http.scaladsl.settings.ParserSettings]].
|
||||
*/
|
||||
def withParserSettings(settings: ParserSettings): RequestContext
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ object Route {
|
|||
/**
|
||||
* Turns a `Route` into a server flow.
|
||||
*
|
||||
* This conversion is also implicitly available through [[RouteResult.route2HandlerFlow]].
|
||||
* This conversion is also implicitly available through [[RouteResult#route2HandlerFlow]].
|
||||
*/
|
||||
def handlerFlow(route: Route)(implicit routingSettings: RoutingSettings,
|
||||
parserSettings: ParserSettings,
|
||||
|
|
|
|||
|
|
@ -131,35 +131,35 @@ trait BasicDirectives {
|
|||
def extractUri: Directive1[Uri] = BasicDirectives._extractUri
|
||||
|
||||
/**
|
||||
* Runs its inner route with the given alternative [[ExecutionContextExecutor]].
|
||||
* Runs its inner route with the given alternative [[scala.concurrent.ExecutionContextExecutor]].
|
||||
*/
|
||||
def withExecutionContext(ec: ExecutionContextExecutor): Directive0 =
|
||||
mapRequestContext(_ withExecutionContext ec)
|
||||
|
||||
/**
|
||||
* Extracts the [[ExecutionContextExecutor]] from the [[RequestContext]].
|
||||
* Extracts the [[scala.concurrent.ExecutionContextExecutor]] from the [[akka.http.scaladsl.server.RequestContext]].
|
||||
*/
|
||||
def extractExecutionContext: Directive1[ExecutionContextExecutor] = BasicDirectives._extractExecutionContext
|
||||
|
||||
/**
|
||||
* Runs its inner route with the given alternative [[Materializer]].
|
||||
* Runs its inner route with the given alternative [[akka.stream.Materializer]].
|
||||
*/
|
||||
def withMaterializer(materializer: Materializer): Directive0 =
|
||||
mapRequestContext(_ withMaterializer materializer)
|
||||
|
||||
/**
|
||||
* Extracts the [[Materializer]] from the [[RequestContext]].
|
||||
* Extracts the [[akka.stream.Materializer]] from the [[akka.http.scaladsl.server.RequestContext]].
|
||||
*/
|
||||
def extractMaterializer: Directive1[Materializer] = BasicDirectives._extractMaterializer
|
||||
|
||||
/**
|
||||
* Runs its inner route with the given alternative [[LoggingAdapter]].
|
||||
* Runs its inner route with the given alternative [[akka.event.LoggingAdapter]].
|
||||
*/
|
||||
def withLog(log: LoggingAdapter): Directive0 =
|
||||
mapRequestContext(_ withLog log)
|
||||
|
||||
/**
|
||||
* Extracts the [[LoggingAdapter]] from the [[RequestContext]].
|
||||
* Extracts the [[akka.event.LoggingAdapter]] from the [[akka.http.scaladsl.server.RequestContext]].
|
||||
*/
|
||||
def extractLog: Directive1[LoggingAdapter] =
|
||||
BasicDirectives._extractLog
|
||||
|
|
@ -177,19 +177,19 @@ trait BasicDirectives {
|
|||
mapRequestContext(ctx ⇒ ctx.withRoutingSettings(f(ctx.settings)))
|
||||
|
||||
/**
|
||||
* Extracts the [[RoutingSettings]] from the [[RequestContext]].
|
||||
* Extracts the [[RoutingSettings]] from the [[akka.http.scaladsl.server.RequestContext]].
|
||||
*/
|
||||
def extractSettings: Directive1[RoutingSettings] =
|
||||
BasicDirectives._extractSettings
|
||||
|
||||
/**
|
||||
* Extracts the [[akka.http.scaladsl.settings.ParserSettings]] from the [[RequestContext]].
|
||||
* Extracts the [[akka.http.scaladsl.settings.ParserSettings]] from the [[akka.http.scaladsl.server.RequestContext]].
|
||||
*/
|
||||
def extractParserSettings: Directive1[ParserSettings] =
|
||||
BasicDirectives._extractParserSettings
|
||||
|
||||
/**
|
||||
* Extracts the [[RequestContext]] itself.
|
||||
* Extracts the [[akka.http.scaladsl.server.RequestContext]] itself.
|
||||
*/
|
||||
def extractRequestContext: Directive1[RequestContext] = BasicDirectives._extractRequestContext
|
||||
}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ trait PathDirectives extends PathMatchers with ImplicitPathMatcherConstruction w
|
|||
* }}}
|
||||
*
|
||||
* For further information, refer to:
|
||||
* [[http://googlewebmastercentral.blogspot.de/2010/04/to-slash-or-not-to-slash.html]]
|
||||
* @see [[http://googlewebmastercentral.blogspot.de/2010/04/to-slash-or-not-to-slash.html]]
|
||||
*/
|
||||
def pathEndOrSingleSlash: Directive0 = rawPathPrefix(Slash.? ~ PathEnd)
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ trait RangeDirectives {
|
|||
* it on the *inside* of the `conditional(...)` directive, i.e. `conditional(...)` must be
|
||||
* on a higher level in your route structure in order to function correctly.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/rfc7233
|
||||
* @see [[https://tools.ietf.org/html/rfc7233]]
|
||||
*/
|
||||
def withRangeSupport: Directive0 =
|
||||
extractRequestContext.flatMap { ctx ⇒
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ import HttpCharsets._
|
|||
import akka.stream.impl.fusing.SubSource
|
||||
|
||||
/**
|
||||
* Provides [[Multipart]] marshallers.
|
||||
* It is possible to configure the default parsing mode by providing an implicit [[ParserSettings]] instance.
|
||||
* Provides [[akka.http.scaladsl.model.Multipart]] marshallers.
|
||||
* It is possible to configure the default parsing mode by providing an implicit [[akka.http.scaladsl.settings.ParserSettings]] instance.
|
||||
*/
|
||||
trait MultipartUnmarshallers {
|
||||
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ trait AtLeastOnceDeliveryLike extends Eventsourced {
|
|||
* later if no matching `confirmDelivery` was performed.
|
||||
*
|
||||
* This method will throw [[AtLeastOnceDelivery.MaxUnconfirmedMessagesExceededException]]
|
||||
* if [[numberOfUnconfirmed]] is greater than or equal to [[#maxUnconfirmedMessages]].
|
||||
* if [[#numberOfUnconfirmed]] is greater than or equal to [[#maxUnconfirmedMessages]].
|
||||
*/
|
||||
def deliver(destination: ActorPath)(deliveryIdToMessage: Long ⇒ Any): Unit = {
|
||||
if (unconfirmed.size >= maxUnconfirmedMessages)
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ abstract class UntypedPersistentActor extends UntypedActor with Eventsourced wit
|
|||
* Unlike `persist` the persistent actor will continue to receive incoming commands between the
|
||||
* call to `persist` and executing it's `handler`. This asynchronous, non-stashing, version of
|
||||
* of persist should be used when you favor throughput over the "command-2 only processed after
|
||||
* command-1 effects' have been applied" guarantee, which is provided by the plain [[persist]] method.
|
||||
* command-1 effects' have been applied" guarantee, which is provided by the plain [[#persist]] method.
|
||||
*
|
||||
* An event `handler` may close over persistent actor state and modify it. The `sender` of a persisted
|
||||
* event is the sender of the corresponding command. This means that one can reply to a command
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ object TestSubscriber {
|
|||
private val self = this.asInstanceOf[Self]
|
||||
|
||||
/**
|
||||
* Expect and return a [[Subscription]].
|
||||
* Expect and return a [[org.reactivestreams.Subscription]].
|
||||
*/
|
||||
def expectSubscription(): Subscription = {
|
||||
_subscription = probe.expectMsgType[OnSubscribe].subscription
|
||||
|
|
@ -394,7 +394,7 @@ object TestSubscriber {
|
|||
*
|
||||
* By default `1` demand will be signalled in order to wake up a possibly lazy upstream.
|
||||
*
|
||||
* See also [[#expectSubscriptionAndComplete(Throwable, Boolean)]] if no demand should be signalled.
|
||||
* See also [[#expectSubscriptionAndComplete(cause: Throwable, signalDemand: Boolean)]] if no demand should be signalled.
|
||||
*/
|
||||
def expectSubscriptionAndError(cause: Throwable): Self =
|
||||
expectSubscriptionAndError(cause, signalDemand = true)
|
||||
|
|
@ -405,7 +405,7 @@ object TestSubscriber {
|
|||
* Expect subscription followed by immediate stream completion.
|
||||
* By default `1` demand will be signalled in order to wake up a possibly lazy upstream
|
||||
*
|
||||
* See also [[#expectSubscriptionAndError(Throwable)]].
|
||||
* See also [[#expectSubscriptionAndError(cause: Throwable)]].
|
||||
*/
|
||||
def expectSubscriptionAndError(cause: Throwable, signalDemand: Boolean): Self = {
|
||||
val sub = expectSubscription()
|
||||
|
|
@ -420,7 +420,7 @@ object TestSubscriber {
|
|||
* Expect subscription followed by immediate stream completion.
|
||||
* By default `1` demand will be signalled in order to wake up a possibly lazy upstream
|
||||
*
|
||||
* See also [[#expectSubscriptionAndComplete(Boolean)]] if no demand should be signalled.
|
||||
* See also [[#expectSubscriptionAndComplete(signalDemand: Boolean)]] if no demand should be signalled.
|
||||
*/
|
||||
def expectSubscriptionAndComplete(): Self =
|
||||
expectSubscriptionAndComplete(true)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import akka.stream.testkit._
|
|||
object TestSink {
|
||||
|
||||
/**
|
||||
* A Sink that materialized to a [[TestSubscriber.Probe]].
|
||||
* A Sink that materialized to a [[akka.stream.testkit.TestSubscriber.Probe]].
|
||||
*/
|
||||
def probe[T](system: ActorSystem): Sink[T, TestSubscriber.Probe[T]] =
|
||||
new Sink(scaladsl.TestSink.probe[T](system))
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import akka.stream.testkit._
|
|||
object TestSource {
|
||||
|
||||
/**
|
||||
* A Source that materializes to a [[TestPublisher.Probe]].
|
||||
* A Source that materializes to a [[akka.stream.testkit.TestPublisher.Probe]].
|
||||
*/
|
||||
def probe[T](system: ActorSystem): Source[T, TestPublisher.Probe[T]] =
|
||||
new Source(scaladsl.TestSource.probe[T](system))
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import akka.stream.testkit._
|
|||
object TestSink {
|
||||
|
||||
/**
|
||||
* A Sink that materialized to a [[TestSubscriber.Probe]].
|
||||
* A Sink that materialized to a [[akka.stream.testkit.TestSubscriber.Probe]].
|
||||
*/
|
||||
def probe[T](implicit system: ActorSystem): Sink[T, Probe[T]] =
|
||||
new Sink[T, TestSubscriber.Probe[T]](new StreamTestKit.ProbeSink(none, SinkShape(Inlet("ProbeSink.in"))))
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import akka.actor.ActorSystem;
|
|||
object TestSource {
|
||||
|
||||
/**
|
||||
* A Source that materializes to a [[TestPublisher.Probe]].
|
||||
* A Source that materializes to a [[akka.stream.testkit.TestPublisher.Probe]].
|
||||
*/
|
||||
def probe[T](implicit system: ActorSystem) = new Source[T, TestPublisher.Probe[T]](new StreamTestKit.ProbeSource(none, SourceShape(Outlet("ProbeSource.out"))))
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ object ScalaDSL {
|
|||
/**
|
||||
* This type of Behavior is created from a partial function from the declared
|
||||
* message type to the next behavior, flagging all unmatched messages as
|
||||
* [[ScalaDSL.Unhandled]]. All system signals are
|
||||
* [[#Unhandled]]. All system signals are
|
||||
* ignored by this behavior, which implies that a failure of a child actor
|
||||
* will be escalated unconditionally.
|
||||
*
|
||||
|
|
@ -324,7 +324,7 @@ object ScalaDSL {
|
|||
* A behavior combinator that feeds incoming messages and signals either into
|
||||
* the left or right sub-behavior and allows them to evolve independently of
|
||||
* each other. The message or signal is passed first into the left sub-behavior
|
||||
* and only if that results in [[Unhandled]] is it passed to the right
|
||||
* and only if that results in [[#Unhandled]] is it passed to the right
|
||||
* sub-behavior. When one of the sub-behaviors terminates the other takes over
|
||||
* exclusively. When both sub-behaviors respond to a [[Failed]] signal, the
|
||||
* response with the higher precedence is chosen (see [[Failed$]]).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue