@Singleton
public class Addresses
extends java.lang.Object
Possible scenarios (problem domain): - IP in server properties is 0.0.0.0 which is invalid - IP in server properties is empty string, which is invalid - Alternative IP is set in the Plan config - Proxy server is used as main webserver, this address has highest priority - Webserver is disabled, external webserver address in config should be used - Webserver uses either http or https - Webserver always has a port, but Alternative IP can be used to remove the port from the address
What are the addresses used in: - Given as links to commands - Redirection - Storing proxy server address in database
Constructor and Description |
---|
Addresses(PlanConfig config,
DBSystem dbSystem,
dagger.Lazy<ServerProperties> serverProperties,
dagger.Lazy<WebServer> webserver) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getAccessAddress() |
java.lang.String |
getFallbackLocalhostAddress() |
java.util.Optional<java.lang.String> |
getMainAddress() |
java.util.Optional<java.lang.String> |
getProxyServerAddress() |
java.util.Optional<java.lang.String> |
getServerPropertyIP() |
@Inject public Addresses(PlanConfig config, DBSystem dbSystem, dagger.Lazy<ServerProperties> serverProperties, dagger.Lazy<WebServer> webserver)
public java.util.Optional<java.lang.String> getMainAddress()
public java.util.Optional<java.lang.String> getAccessAddress()
public java.lang.String getFallbackLocalhostAddress()
public java.util.Optional<java.lang.String> getProxyServerAddress()
public java.util.Optional<java.lang.String> getServerPropertyIP()