Class IncomingConnection


  • public class IncomingConnection
    extends java.lang.Object
    Represents one accepted incoming HTTP connection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      akka.stream.javadsl.Flow<HttpResponse,​HttpRequest,​akka.NotUsed> flow()
      A flow representing the incoming requests and outgoing responses for this connection.
      <Mat> Mat handleWith​(akka.stream.javadsl.Flow<HttpRequest,​HttpResponse,​Mat> handler, akka.stream.Materializer materializer)
      Handles the connection with the given flow, which is materialized exactly once and the respective materialization result returned.
      void handleWithAsyncHandler​(akka.japi.function.Function<HttpRequest,​java.util.concurrent.CompletionStage<HttpResponse>> handler, int parallelism, akka.stream.Materializer materializer)
      Handles the connection with the given handler function.
      void handleWithAsyncHandler​(akka.japi.function.Function<HttpRequest,​java.util.concurrent.CompletionStage<HttpResponse>> handler, akka.stream.Materializer materializer)
      Handles the connection with the given handler function.
      void handleWithSyncHandler​(akka.japi.function.Function<HttpRequest,​HttpResponse> handler, akka.stream.Materializer materializer)
      Handles the connection with the given handler function.
      java.net.InetSocketAddress localAddress()
      The local address of this connection.
      java.net.InetSocketAddress remoteAddress()
      The address of the remote peer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • flow

        public akka.stream.javadsl.Flow<HttpResponse,​HttpRequest,​akka.NotUsed> flow()
        A flow representing the incoming requests and outgoing responses for this connection.

        Use Flow.join or one of the handleXXX methods to consume handle requests on this connection.

        Returns:
        (undocumented)
      • handleWith

        public <Mat> Mat handleWith​(akka.stream.javadsl.Flow<HttpRequest,​HttpResponse,​Mat> handler,
                                    akka.stream.Materializer materializer)
        Handles the connection with the given flow, which is materialized exactly once and the respective materialization result returned.
        Parameters:
        handler - (undocumented)
        materializer - (undocumented)
        Returns:
        (undocumented)
      • handleWithAsyncHandler

        public void handleWithAsyncHandler​(akka.japi.function.Function<HttpRequest,​java.util.concurrent.CompletionStage<HttpResponse>> handler,
                                           akka.stream.Materializer materializer)
        Handles the connection with the given handler function.
        Parameters:
        handler - (undocumented)
        materializer - (undocumented)
      • handleWithAsyncHandler

        public void handleWithAsyncHandler​(akka.japi.function.Function<HttpRequest,​java.util.concurrent.CompletionStage<HttpResponse>> handler,
                                           int parallelism,
                                           akka.stream.Materializer materializer)
        Handles the connection with the given handler function.
        Parameters:
        handler - (undocumented)
        parallelism - (undocumented)
        materializer - (undocumented)
      • handleWithSyncHandler

        public void handleWithSyncHandler​(akka.japi.function.Function<HttpRequest,​HttpResponse> handler,
                                          akka.stream.Materializer materializer)
        Handles the connection with the given handler function.
        Parameters:
        handler - (undocumented)
        materializer - (undocumented)
      • localAddress

        public java.net.InetSocketAddress localAddress()
        The local address of this connection.
        Returns:
        (undocumented)
      • remoteAddress

        public java.net.InetSocketAddress remoteAddress()
        The address of the remote peer.
        Returns:
        (undocumented)