Package com.iizix.prop
Interface IWebServerPortConfig
- All Known Implementing Classes:
- EditorWebServerPortConfig,- WebServerPortConfig
public interface IWebServerPortConfig
Interface for the configuration of a Port "group" of the web server. A port group is defines a bind address for a single or a range of ports to use, and the protocol to bind to (HTTP or HTTPS).
- Method SummaryModifier and TypeMethodDescriptionGets the bind address.Gets the description of the port configuration.- String[]Gets the excluded secure protocols.Gets the name for property for external host name or address when reverse-proxied.- intGets the external port when front-end proxied.Gets the KeyStore from a PKCS#12 identity property and password.- getKeyStore- (StringBuilder pwReturn) Gets the KeyStore from a PKCS#12 identity property and password.Gets the KeyStore password.Gets the Let's Encrypt domain name(s) associated with this port configuration.Gets a new set of Let's Encrypt domain name(s) associated with this port configuration.- int- getPort()Gets the (local) port.Gets the description of the port configuration.- <T> T- getProperty- (String name, Class<T> propClass) Gets a runtime property based on a HashMap.- intGets the protocol to use.- getType()Gets the type of port: HTTP or HTTPS.- intRetrieves the local UDP port number to use for HTTP/3 connections.- booleanReturns if the connection is secure by means of a front-end proxy, load balancer, etc.- default booleanChecks if HTTP is used as the local protocol.- default booleanChecks if HTTPS is used as the local protocol.- default PortConfig- newPortConfig- (IPortController portController) Creates a new port configuration for the current settings and optional controller.- void- setConfig- (PortConfig config) Sets the Jetty server connector configuration used with this configuration.- <T> T- setProperty- (String name, T property, Class<T> propClass) Sets a runtime property based on a HashMap.- boolean- useHTTP2()Use HTTP/2 alongside with HTTP/1.x.- boolean- useHTTP3()Use HTTP/3 alongside with HTTP/2 and HTTP/1.x over secure TLS connections, requiring HTTP/2 also.
- Method Details- getTypeString getType()Gets the type of port: HTTP or HTTPS.- Returns:
- The type string.
 
- getDescriptionString getDescription()Gets the description of the port configuration.- Returns:
- The description or null if not defined.
 
- getPortDescriptionString getPortDescription()Gets the description of the port configuration.- Returns:
- The description of the port configuration as Port NNN, HTTP[S] [, bind address]...
 
- getPortint getPort()Gets the (local) port.- Returns:
- The local port number. If the port is undefined, the default port for the local protocol is used, i.e. 80 for HTTP or 443 for HTTPS. The value is always between 1 and 65534, otherwise the default port value is returned.
 
- getProtocolint getProtocol()Gets the protocol to use.- Returns:
- The protocol: 0=HTTP (default if not defined), 1=HTTPS.
 
- isLocalHTTPdefault boolean isLocalHTTP()Checks if HTTP is used as the local protocol.- Returns:
- trueif HTTP is used,- falseotherwise.
 
- isLocalHTTPSdefault boolean isLocalHTTPS()Checks if HTTPS is used as the local protocol.- Returns:
- trueif HTTPS is used,- falseotherwise.
 
- useHTTP2boolean useHTTP2()Use HTTP/2 alongside with HTTP/1.x. This setting is also valid for clear-text connections, i.e. non-TLS connections.- Returns:
- Enable HTTP/2 protocol flag.
 
- useHTTP3boolean useHTTP3()Use HTTP/3 alongside with HTTP/2 and HTTP/1.x over secure TLS connections, requiring HTTP/2 also. HTTP/3 uses an UDP port and not a TCP port.- Returns:
- Enable HTTP/3 protocol flag, always falsefor clear-text connections.
 
- getUDPPortint getUDPPort()Retrieves the local UDP port number to use for HTTP/3 connections. The port may be set to another value than the HTTPS port used for HTTP/1.1 and HTTP/2. If not modified by configuration, this port will have the same number as the TCP port.- Returns:
- The UDP port number for HTTP/3 connections.
 
- isFrontEndSecuredboolean isFrontEndSecured()Returns if the connection is secure by means of a front-end proxy, load balancer, etc. This means that the protocol can be HTTP but still be secure.- Returns:
- true if secure and HTTPS is used by the client side, false otherwise.
 
- getBindAddressString getBindAddress()Gets the bind address.- Returns:
- The bind address, or null if not defined (never empty string).
 
- getExternalHostNameString getExternalHostName()Gets the name for property for external host name or address when reverse-proxied.- Returns:
- The host name or IP address of the external access to the port when reverse-proxied, nullfor none.
 
- getExternalPortint getExternalPort()Gets the external port when front-end proxied.- Returns:
- The external port number, or -1 if not defined.
 
- getKeyStorePasswordString getKeyStorePassword()Gets the KeyStore password.- Returns:
- The password, null for none.
 
- getKeyStoreKeyStore getKeyStore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableEntryExceptionGets the KeyStore from a PKCS#12 identity property and password.- Returns:
- The configured KeyStore, or null if not defined.
- Throws:
- KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- NoSuchAlgorithmException- If the algorithm used to check the integrity of the KeyStore cannot be found.
- CertificateException- If any of the certificates in the KeyStore could not be loaded or the Let's Encrypt domain was not found and this configuration is associated with Let's Encrypt.
- IOException- If there is an I/O or format problem with the KeyStore data, if a password is required but not given, or if the given password was incorrect. If the error is due to a wrong password, the cause of the IOException should be an UnrecoverableKeyException.
- UnrecoverableEntryException- For errors in keystore.
 
- getKeyStoreKeyStore getKeyStore- (StringBuilder pwReturn) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableEntryException Gets the KeyStore from a PKCS#12 identity property and password. If the configuration is associated with a Let's Encrypt domain- Parameters:
- pwReturn- A StringBuilder instance that is filled with the password, null for none.
- Returns:
- The configured KeyStore, or null if not defined.
- Throws:
- KeyStoreException- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.
- NoSuchAlgorithmException- If the algorithm used to check the integrity of the KeyStore cannot be found.
- CertificateException- If any of the certificates in the KeyStore could not be loaded or the Let's Encrypt domain was not found and this configuration is associated with Let's Encrypt.
- IOException- If there is an I/O or format problem with the KeyStore data, if a password is required but not given, or if the given password was incorrect. If the error is due to a wrong password, the cause of the IOException should be an UnrecoverableKeyException.
- UnrecoverableEntryException- For errors in keystore.
 
- setPropertySets a runtime property based on a HashMap.- Parameters:
- name- The property name.
- property- The property, or null to remove it.
- propClass- The class of the property to return if replaced.
- Returns:
- The previous property, null for none.
- Throws:
- ClassCastException- If the object is not null and is not assignable to the type T.
 
- getPropertyGets a runtime property based on a HashMap.- Parameters:
- name- The property name.
- propClass- The class of the property to return if replaced.
- Returns:
- The property, null if not previously set.
- Throws:
- ClassCastException- If the object is not null and is not assignable to the type T.
 
- getLetsEncryptDomainNamesString getLetsEncryptDomainNames()Gets the Let's Encrypt domain name(s) associated with this port configuration.- Returns:
- The domain name(s) as e.g. "hello.example.com", or null if not associated with Let's Encrypt.
 
- getLetsEncryptDomainNamesSetGets a new set of Let's Encrypt domain name(s) associated with this port configuration.- Returns:
- The domain name(s) as e.g. "hello.example.com", or empty list if not associated with Let's Encrypt.
 
- setConfigSets the Jetty server connector configuration used with this configuration.- Parameters:
- config- The configuration instance.
 
- getExcludedSecureProtocolsString[] getExcludedSecureProtocols()Gets the excluded secure protocols.- Returns:
- Empty string for none, otherwise e.g. "TLSv1", "TLSv1.1".
 
- newPortConfigCreates a new port configuration for the current settings and optional controller.- Parameters:
- portController- The optional port controller, or null for none.
- Returns:
- The port configuration.