Class HttpServerLocationImpl

    • Field Detail

      • DEFAULT_HTTP_PORT

        public static final int DEFAULT_HTTP_PORT
        Default HTTP port.
        See Also:
        Constant Field Values
      • DEFAULT_HTTPS_PORT

        public static final int DEFAULT_HTTPS_PORT
        Default HTTPS port.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HttpServerLocationImpl

        public HttpServerLocationImpl()
        Instantiate with defaults for testing.
      • HttpServerLocationImpl

        public HttpServerLocationImpl​(java.lang.String domain,
                                      int httpPort,
                                      int httpsPort)
        Instantiate for running single instance.
        Parameters:
        domain - Domain.
        httpPort - HTTP port.
        httpsPort - HTTPS port.
      • HttpServerLocationImpl

        public HttpServerLocationImpl​(java.lang.String domain,
                                      int httpPort,
                                      int httpsPort,
                                      java.lang.String clusterHostName)
        Instantiate for running in a cluster with same port mappings.
        Parameters:
        domain - Domain.
        httpPort - HTTP port.
        httpsPort - HTTPS port.
        clusterHostName - Cluster host name.
      • HttpServerLocationImpl

        public HttpServerLocationImpl​(java.lang.String domain,
                                      int httpPort,
                                      int httpsPort,
                                      java.lang.String clusterHostName,
                                      int clusterHttpPort,
                                      int clusterHttpsPort)
        Instantiate for running in a cluster.
        Parameters:
        domain - Domain.
        httpPort - HTTP port.
        httpsPort - HTTPS port.
        clusterHostName - Cluster host name.
        clusterHttpPort - Cluster HTTP port.
        clusterHttpsPort - Cluster HTTPS port.
    • Method Detail

      • getDefaultHostName

        public static java.lang.String getDefaultHostName()
        Obtains the default host name.
        Returns:
        Default Host name.
      • getDomain

        public java.lang.String getDomain()
        Description copied from interface: HttpServerLocation

        Obtains the domain for the server.

        This is as the client will see the server.

        Specified by:
        getDomain in interface HttpServerLocation
        Returns:
        Domain for the server.
      • getHttpPort

        public int getHttpPort()
        Description copied from interface: HttpServerLocation

        Obtains the HTTP port.

        This is as the client will see the server.

        Specified by:
        getHttpPort in interface HttpServerLocation
        Returns:
        HTTP port.
      • getHttpsPort

        public int getHttpsPort()
        Description copied from interface: HttpServerLocation

        Obtains the HTTPS port.

        This is as the client will see the server.

        Specified by:
        getHttpsPort in interface HttpServerLocation
        Returns:
        HTTPS port.
      • getClusterHostName

        public java.lang.String getClusterHostName()
        Description copied from interface: HttpServerLocation
        Obtains the name of the host for the server within the cluster. This name should be understood by all nodes within the cluster.
        Specified by:
        getClusterHostName in interface HttpServerLocation
        Returns:
        Name of the host within the cluster.
      • getClusterHttpPort

        public int getClusterHttpPort()
        Description copied from interface: HttpServerLocation
        The cluster may be behind a load balancer and the server may be running on a different port than expected by the client.
        Specified by:
        getClusterHttpPort in interface HttpServerLocation
        Returns:
        Actual port on the cluster host the server is running on.
      • getClusterHttpsPort

        public int getClusterHttpsPort()
        Description copied from interface: HttpServerLocation
        The cluster may be behind a load balancer and the server may be running on a different port than expected by the client.
        Specified by:
        getClusterHttpsPort in interface HttpServerLocation
        Returns:
        Actual secure port on the cluster host the server is running on.
      • createClientUrl

        public java.lang.String createClientUrl​(boolean isSecure,
                                                java.lang.String path)
        Description copied from interface: HttpServerLocation
        Creates the client URL to call the HttpServer.
        Specified by:
        createClientUrl in interface HttpServerLocation
        Parameters:
        isSecure - If secure URL.
        path - Path including query string and fragment.
        Returns:
        URL for the client to call on the HttpServer.