Packages

trait ServerBuilder extends AnyRef

Builder API to create server bindings.

Use Http.newServerAt() to create a builder, use methods to customize settings, and then call one of the bind* methods to bind a server.

Source
ServerBuilder.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerBuilder
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def adaptSettings(f: Function[ServerSettings, ServerSettings]): ServerBuilder

    Adapt the current configured settings with a function.

  2. abstract def bind(handlerProvider: HandlerProvider): CompletionStage[ServerBinding]

    Bind a new HTTP server and use the given handler provider to create an asynchronous handler akka.stream.javadsl.Flow for processing all incoming connections.

    Bind a new HTTP server and use the given handler provider to create an asynchronous handler akka.stream.javadsl.Flow for processing all incoming connections.

    Most importantly, you can pass a Route to this method because Route implements HandlerProvider.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

    Supports HTTP/2 on the same port if http2 support is enabled.

  3. abstract def bind(f: Function[HttpRequest, CompletionStage[HttpResponse]]): CompletionStage[ServerBinding]

    Bind a new HTTP server and use the given asynchronous handler akka.stream.javadsl.Flow for processing all incoming connections.

    Bind a new HTTP server and use the given asynchronous handler akka.stream.javadsl.Flow for processing all incoming connections.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

    Supports HTTP/2 on the same port if http2 support is enabled.

  4. abstract def bindFlow(handlerFlow: Flow[HttpRequest, HttpResponse, _]): CompletionStage[ServerBinding]

    Binds a new HTTP server at the given endpoint and uses the given handler akka.stream.scaladsl.Flow for processing all incoming connections.

    Binds a new HTTP server at the given endpoint and uses the given handler 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. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

  5. abstract def bindSync(f: Function[HttpRequest, HttpResponse]): CompletionStage[ServerBinding]

    Bind a new HTTP server at the given endpoint and uses the given handler akka.stream.javadsl.Flow for processing all incoming connections.

    Bind a new HTTP server at the given endpoint and uses the given handler akka.stream.javadsl.Flow for processing all incoming connections.

    The number of concurrently accepted connections can be configured by overriding the akka.http.server.max-connections setting. Please see the documentation in the reference.conf for more information about what kind of guarantees to expect.

    Supports HTTP/2 on the same port if http2 support is enabled.

  6. abstract def connectionSource(): Source[IncomingConnection, CompletionStage[ServerBinding]]

    Creates a akka.stream.javadsl.Source of akka.http.javadsl.IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Creates a akka.stream.javadsl.Source of akka.http.javadsl.IncomingConnection instances which represents a prospective HTTP server binding on the given endpoint.

    Note that each materialization will create a new binding, so

    * if the configured 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 akka.http.javadsl.ServerBinding.

    * if the configured 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 akka.http.javadsl.ServerBinding.

  7. abstract def enableHttps(context: HttpsConnectionContext): ServerBuilder

    Enable HTTPS for this binding with the given context.

  8. abstract def logTo(log: LoggingAdapter): ServerBuilder

    Use a custom logger

  9. abstract def onInterface(interface: String): ServerBuilder

    Change interface to bind to

  10. abstract def onPort(port: Int): ServerBuilder

    Change port to bind to

  11. abstract def withMaterializer(materializer: Materializer): ServerBuilder

    Use custom Materializer for the binding

  12. abstract def withSettings(settings: ServerSettings): ServerBuilder

    Use custom ServerSettings for the binding.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ServerBuilder toany2stringadd[ServerBuilder] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ServerBuilder, B)
    Implicit
    This member is added by an implicit conversion from ServerBuilder toArrowAssoc[ServerBuilder] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def ensuring(cond: (ServerBuilder) => Boolean, msg: => Any): ServerBuilder
    Implicit
    This member is added by an implicit conversion from ServerBuilder toEnsuring[ServerBuilder] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (ServerBuilder) => Boolean): ServerBuilder
    Implicit
    This member is added by an implicit conversion from ServerBuilder toEnsuring[ServerBuilder] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): ServerBuilder
    Implicit
    This member is added by an implicit conversion from ServerBuilder toEnsuring[ServerBuilder] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): ServerBuilder
    Implicit
    This member is added by an implicit conversion from ServerBuilder toEnsuring[ServerBuilder] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ServerBuilder toStringFormat[ServerBuilder] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (ServerBuilder, B)
    Implicit
    This member is added by an implicit conversion from ServerBuilder toArrowAssoc[ServerBuilder] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromServerBuilder to any2stringadd[ServerBuilder]

Inherited by implicit conversion StringFormat fromServerBuilder to StringFormat[ServerBuilder]

Inherited by implicit conversion Ensuring fromServerBuilder to Ensuring[ServerBuilder]

Inherited by implicit conversion ArrowAssoc fromServerBuilder to ArrowAssoc[ServerBuilder]

Ungrouped