Package net.officefloor.server.http
Interface HttpServerLocation
- All Known Implementing Classes:
HttpServerLocationImpl,MockHttpServer,MockWoofServer,MockWoofServerExtension,MockWoofServerRule
public interface HttpServerLocation
Location of the HTTP server.
Note the Property configuration is provided here to aid identifying
how to configure common settings for the HttpServer. Configuration is
expected to follow:
- checking the
SourceContext - checking
System.getProperty(String) - using defaults
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName ofPropertyfor the cluster host name.static final StringName ofPropertyfor the cluster HTTP port.static final StringName ofPropertyfor the cluster HTTPS port.static final StringName ofPropertyfor the domain.static final StringName ofPropertyfor the HTTP port.static final StringName ofPropertyfor the HTTPS port. -
Method Summary
Modifier and TypeMethodDescriptioncreateClientUrl(boolean isSecure, String path) Creates the client URL to call theHttpServer.Obtains the name of the host for the server within the cluster.intThe cluster may be behind a load balancer and the server may be running on a different port than expected by the client.intThe cluster may be behind a load balancer and the server may be running on a different port than expected by the client.Obtains the domain for the server.intObtains the HTTP port.intObtains the HTTPS port.
-
Field Details
-
PROPERTY_DOMAIN
Name ofPropertyfor the domain.- See Also:
-
PROPERTY_HTTP_PORT
Name ofPropertyfor the HTTP port.- See Also:
-
PROPERTY_HTTPS_PORT
Name ofPropertyfor the HTTPS port.- See Also:
-
PROPERTY_CLUSTER_HOST_NAME
Name ofPropertyfor the cluster host name.- See Also:
-
PROPERTY_CLUSTER_HTTP_PORT
Name ofPropertyfor the cluster HTTP port.- See Also:
-
PROPERTY_CLUSTER_HTTPS_PORT
Name ofPropertyfor the cluster HTTPS port.- See Also:
-
-
Method Details
-
getDomain
String getDomain()Obtains the domain for the server.
This is as the client will see the server.
- Returns:
- Domain for the server.
-
getHttpPort
int getHttpPort()Obtains the HTTP port.
This is as the client will see the server.
- Returns:
- HTTP port.
-
getHttpsPort
int getHttpsPort()Obtains the HTTPS port.
This is as the client will see the server.
- Returns:
- HTTPS port.
-
getClusterHostName
String getClusterHostName()Obtains the name of the host for the server within the cluster. This name should be understood by all nodes within the cluster.- Returns:
- Name of the host within the cluster.
-
getClusterHttpPort
int getClusterHttpPort()The cluster may be behind a load balancer and the server may be running on a different port than expected by the client.- Returns:
- Actual port on the cluster host the server is running on.
-
getClusterHttpsPort
int getClusterHttpsPort()The cluster may be behind a load balancer and the server may be running on a different port than expected by the client.- Returns:
- Actual secure port on the cluster host the server is running on.
-
createClientUrl
Creates the client URL to call theHttpServer.- Parameters:
isSecure- If secure URL.path- Path including query string and fragment.- Returns:
- URL for the client to call on the
HttpServer.
-