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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getBindAddress()
Gets the bind address.java.lang.String
getDescription()
Gets the description of the port configuration.java.lang.String[]
getExcludedSecureProtocols()
Gets the excluded secure protocols.java.security.KeyStore
getKeyStore()
Gets the KeyStore from a PKCS#12 identity property and password.java.security.KeyStore
getKeyStore(java.lang.StringBuilder pwReturn)
Gets the KeyStore from a PKCS#12 identity property and password.java.lang.String
getKeyStorePassword()
Gets the KeyStore password.java.lang.String
getLetsEncryptDomainNames()
Gets the Let's Encrypt domain name(s) associated with this port configuration.java.util.Set<java.lang.String>
getLetsEncryptDomainNamesSet()
Gets a new set of Let's Encrypt domain name(s) associated with this port configuration.java.lang.String
getPortDescription()
Gets the description of the port configuration.int
getPortEnd()
Gets the port end in a range.int
getPortStart()
Gets the port start in a range.<T> T
getProperty(java.lang.String name, java.lang.Class<T> propClass)
Gets a runtime property based on a HashMap.int
getProtocol()
Gets the protocol to use.java.lang.String
getType()
Gets the type of port: HTTP or HTTPS.boolean
isFrontEndSecured()
Returns if the connection is secure by means of a front-end proxy, load balancer, etc.void
setConfig(PortConfig config)
Sets the Jetty server connector configuration used with this configuration.<T> T
setProperty(java.lang.String name, T property, java.lang.Class<T> propClass)
Sets a runtime property based on a HashMap.
-
-
-
Method Detail
-
getType
java.lang.String getType()
Gets the type of port: HTTP or HTTPS.- Returns:
- The type string, or "Undefined" if undefined.
-
getDescription
java.lang.String getDescription()
Gets the description of the port configuration.- Returns:
- The description, "ports NN to MM, PROTOCOL" or "port NN, PROTOCOL" if not defined.
-
getPortDescription
java.lang.String getPortDescription()
Gets the description of the port configuration.- Returns:
- The description, "ports NN to MM, PROTOCOL" or "port NN, PROTOCOL" if not defined.
-
getPortStart
int getPortStart()
Gets the port start in a range.- Returns:
- The port start, or -1 if not defined.
-
getPortEnd
int getPortEnd()
Gets the port end in a range.- Returns:
- The port end, or "getPortStart()" value if not defined.
-
getProtocol
int getProtocol()
Gets the protocol to use.- Returns:
- The protocol: 0=HTTP, 1=HTTPS, or -1 if not defined.
-
isFrontEndSecured
boolean 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.
-
getBindAddress
java.lang.String getBindAddress()
Gets the bind address.- Returns:
- The bind address, or null if not defined (never empty string).
-
getKeyStorePassword
java.lang.String getKeyStorePassword()
Gets the KeyStore password.- Returns:
- The password, null for none.
-
getKeyStore
java.security.KeyStore getKeyStore() throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException, java.security.UnrecoverableEntryException
Gets the KeyStore from a PKCS#12 identity property and password.- Returns:
- The configured KeyStore, or null if not defined.
- Throws:
java.security.KeyStoreException
- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.java.security.NoSuchAlgorithmException
- If the algorithm used to check the integrity of the KeyStore cannot be found.java.security.cert.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.java.io.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.java.security.UnrecoverableEntryException
- For errors in keystore.
-
getKeyStore
java.security.KeyStore getKeyStore(java.lang.StringBuilder pwReturn) throws java.security.KeyStoreException, java.security.NoSuchAlgorithmException, java.security.cert.CertificateException, java.io.IOException, java.security.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:
java.security.KeyStoreException
- If no Provider supports a KeyStoreSpi implementation for the PKCS#12 type.java.security.NoSuchAlgorithmException
- If the algorithm used to check the integrity of the KeyStore cannot be found.java.security.cert.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.java.io.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.java.security.UnrecoverableEntryException
- For errors in keystore.
-
setProperty
<T> T setProperty(java.lang.String name, T property, java.lang.Class<T> propClass) throws java.lang.ClassCastException
Sets 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:
java.lang.ClassCastException
- If the object is not null and is not assignable to the type T.
-
getProperty
<T> T getProperty(java.lang.String name, java.lang.Class<T> propClass) throws java.lang.ClassCastException
Gets 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:
java.lang.ClassCastException
- If the object is not null and is not assignable to the type T.
-
getLetsEncryptDomainNames
java.lang.String 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.
-
getLetsEncryptDomainNamesSet
java.util.Set<java.lang.String> getLetsEncryptDomainNamesSet()
Gets 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.
-
setConfig
void setConfig(PortConfig config)
Sets the Jetty server connector configuration used with this configuration.- Parameters:
config
- The configuration instance.
-
getExcludedSecureProtocols
java.lang.String[] getExcludedSecureProtocols()
Gets the excluded secure protocols.- Returns:
- Empty string for none, otherwise e.g. "TLSv1", "TLSv1.1".
-
-