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 theHttpServer
. Configuration is expected to follow:- checking the
SourceContext
- checking
System.getProperty(String)
- using defaults
- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_CLUSTER_HOST_NAME
Name ofProperty
for the cluster host name.static java.lang.String
PROPERTY_CLUSTER_HTTP_PORT
Name ofProperty
for the cluster HTTP port.static java.lang.String
PROPERTY_CLUSTER_HTTPS_PORT
Name ofProperty
for the cluster HTTPS port.static java.lang.String
PROPERTY_DOMAIN
Name ofProperty
for the domain.static java.lang.String
PROPERTY_HTTP_PORT
Name ofProperty
for the HTTP port.static java.lang.String
PROPERTY_HTTPS_PORT
Name ofProperty
for the HTTPS port.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
createClientUrl(boolean isSecure, java.lang.String path)
Creates the client URL to call theHttpServer
.java.lang.String
getClusterHostName()
Obtains the name of the host for the server within the cluster.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.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.java.lang.String
getDomain()
Obtains the domain for the server.int
getHttpPort()
Obtains the HTTP port.int
getHttpsPort()
Obtains the HTTPS port.
-
-
-
Field Detail
-
PROPERTY_DOMAIN
static final java.lang.String PROPERTY_DOMAIN
Name ofProperty
for the domain.- See Also:
- Constant Field Values
-
PROPERTY_HTTP_PORT
static final java.lang.String PROPERTY_HTTP_PORT
Name ofProperty
for the HTTP port.- See Also:
- Constant Field Values
-
PROPERTY_HTTPS_PORT
static final java.lang.String PROPERTY_HTTPS_PORT
Name ofProperty
for the HTTPS port.- See Also:
- Constant Field Values
-
PROPERTY_CLUSTER_HOST_NAME
static final java.lang.String PROPERTY_CLUSTER_HOST_NAME
Name ofProperty
for the cluster host name.- See Also:
- Constant Field Values
-
PROPERTY_CLUSTER_HTTP_PORT
static final java.lang.String PROPERTY_CLUSTER_HTTP_PORT
Name ofProperty
for the cluster HTTP port.- See Also:
- Constant Field Values
-
PROPERTY_CLUSTER_HTTPS_PORT
static final java.lang.String PROPERTY_CLUSTER_HTTPS_PORT
Name ofProperty
for the cluster HTTPS port.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDomain
java.lang.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
java.lang.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
java.lang.String createClientUrl(boolean isSecure, java.lang.String path)
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
.
-
-