Package com.iizix.comm
Class PortConfig
java.lang.Object
com.iizix.comm.PortConfig
Class used to hold information of the started port.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- final StringThe bind address,- nullfor none.- final IPortControllerInterface for the port control,- nullif in iiziGo (for now).- final StringThe external host name when front-end reverse-proxied, null for none.- final StringThe name of the external host, including a potential ":port" addition, or none if it's matching the port number.- final intThe external port number (1-65534) when front-end reverse-proxied, 0 for none.- final booleanFlag for secure port by means of front-end proxy, even if the- isHTTPSflag is false.- final booleanFlag for HTTPS.- final booleanThe secure connection flag.- final intThe (local) port number (1-65534).
- Constructor SummaryConstructorsConstructorDescription- PortConfig- (int port, boolean isHTTPS, boolean isFrontEndSecured, String bind, String externalHostName, int externalPort, IPortController controller) Constructor.
- Method SummaryModifier and TypeMethodDescription- getRemoteProtocolServerNameAndPort- (HttpServletRequest servletRequest) Gets the remote protocol, server name and port, e.g.- getRemoteProtocolServerNameAndPort- (HttpServletRequest servletRequest, boolean omitDefaultPort) Gets the remote protocol, server name and port, e.g.- getRemoteServerNameAndPort- (HttpServletRequest servletRequest) Gets the remote server name and port.- getRemoteServerNameAndPort- (HttpServletRequest servletRequest, boolean omitDefaultPort) Gets the remote server name and port.- boolean- isSamePortConfig- (PortConfig portConfig) Checks if two port configurations are equal: i.e.- voidRestarts the Jetty (HTTPS) server connector after Let's Encrypt domain certificate renewal.
- Field Details- portpublic final int portThe (local) port number (1-65534).
- isHTTPSpublic final boolean isHTTPSFlag for HTTPS.
- isFrontEndSecuredpublic final boolean isFrontEndSecuredFlag for secure port by means of front-end proxy, even if the- isHTTPSflag is false.
- isSecuredpublic final boolean isSecuredThe secure connection flag. The server may use a clear-text connection, but the client may use TLS if a front-end proxy is present.
- bindThe bind address,- nullfor none.
- externalHostNameThe external host name when front-end reverse-proxied, null for none.
- externalPortpublic final int externalPortThe external port number (1-65534) when front-end reverse-proxied, 0 for none.
- externalNameAndPortThe name of the external host, including a potential ":port" addition, or none if it's matching the port number.
- controllerInterface for the port control,- nullif in iiziGo (for now).
 
- Constructor Details- PortConfigpublic PortConfig- (int port, boolean isHTTPS, boolean isFrontEndSecured, String bind, String externalHostName, int externalPort, IPortController controller) Constructor.- Parameters:
- port- The port number, zero for none.
- isHTTPS- Flag for HTTPS.
- isFrontEndSecured- Flag for secure port by means of front-end reverse-proxy, even if the- isHTTPSflag is false.
- bind- The bind address, null for none.
- externalHostName- The external host name when front-end reverse-proxied, null for none.
- externalPort- The external port when front-end reverse-proxied, 0 for none.
- controller- The port controller, never null.
 
 
- Method Details- restartConnectorpublic void restartConnector()Restarts the Jetty (HTTPS) server connector after Let's Encrypt domain certificate renewal.
- isSamePortConfigChecks if two port configurations are equal: i.e. the same bind address (or none), the port number, front-end secured and the external host name and port.- Parameters:
- portConfig- Another port configuration.
- Returns:
- trueif the port configurations match,- falseotherwise.
 
- getRemoteServerNameAndPortGets the remote server name and port. The port is omitted if 80 for unsecure or 443 for secured connections.- Parameters:
- servletRequest- The servlet request.
- Returns:
- The remote server name and port (perhaps omitted if default value).
 
- getRemoteServerNameAndPortpublic String getRemoteServerNameAndPort- (HttpServletRequest servletRequest, boolean omitDefaultPort) Gets the remote server name and port. The port is optionally omitted if 80 for unsecure or 443 for secured connections.- Parameters:
- servletRequest- The servlet request.
- omitDefaultPort- Flag to omit the default port.
- Returns:
- The remote server name and port (perhaps omitted if default value).
 
- getRemoteProtocolServerNameAndPortGets the remote protocol, server name and port, e.g.- http://clear.text.server:8080or- https://secure.server.com. The port is omitted if 80 for unsecure or 443 for secured connections.- Returns:
- The protocol, remote server name and port (perhaps omitted if default value).
 
- getRemoteProtocolServerNameAndPortpublic String getRemoteProtocolServerNameAndPort- (HttpServletRequest servletRequest, boolean omitDefaultPort) Gets the remote protocol, server name and port, e.g.- http://clear.text.server:8080or- https://secure.server.com. The port is omitted if 80 for unsecure or 443 for secured connections.- Parameters:
- servletRequest- The servlet request.
- omitDefaultPort- Flag to omit the default port.
- Returns:
- The protocol, remote server name and port (perhaps omitted if default value).