Class Addresses
- java.lang.Object
-
- com.djrapitops.plan.delivery.webserver.Addresses
-
@Singleton public class Addresses extends java.lang.Object
In charge of address management.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 Summary
Constructors Constructor Description Addresses(PlanConfig config, DBSystem dbSystem, dagger.Lazy<ServerProperties> serverProperties, dagger.Lazy<WebServer> webserver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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()
-
-
-
Constructor Detail
-
Addresses
@Inject public Addresses(PlanConfig config, DBSystem dbSystem, dagger.Lazy<ServerProperties> serverProperties, dagger.Lazy<WebServer> webserver)
-
-
Method Detail
-
getMainAddress
public java.util.Optional<java.lang.String> getMainAddress()
-
getAccessAddress
public java.util.Optional<java.lang.String> getAccessAddress()
-
getFallbackLocalhostAddress
public java.lang.String getFallbackLocalhostAddress()
-
getProxyServerAddress
public java.util.Optional<java.lang.String> getProxyServerAddress()
-
getServerPropertyIP
public java.util.Optional<java.lang.String> getServerPropertyIP()
-
-