Package com.iizix.server.prop
Class WebServerPortConfig
- All Implemented Interfaces:
- EventListener,- IGProp<GProp<?>[]>,- IPropCnr,- IWebServerPortConfig,- Cloneable
- Direct Known Subclasses:
- EditorWebServerPortConfig
Property container 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).
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe name for the bind address string property.- static final StringThe default password used for keystores, Let's Encrypt certificates, etc: "changeit".- static final StringDomain names.- static final StringProtocols to exclude: 0 = none, 1 = TLSv1.0, 2 = TLSv1.0 + 1.1.- static final StringName for property for external host name or address when reverse-proxied.- static final StringThe name of the port value when reverse-proxied.- static final StringIf the port is secure by means of a front-end proxy, even if the server protocol uses HTTP.- static final StringThe name for the flag to use HTTP/2.- static final StringThe name for the flag to use HTTP/3.- static final StringThe PKCS#12 identity password.- static final StringThe PKCS#12 identity.- static final StringDomain names associated with Let's Encrypt, comma separated list.- static final StringThe name of the port value.- static final StringThe protocol to use (HTTP or HTTPS).- static final StringThe name of the UDP port value for HTTP/3.- Fields inherited from class com.iizix.prop.PropCnr- EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID- Fields inherited from class com.iizix.prop.GProp- GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2- Fields inherited from interface com.iizix.prop.IGProp- EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
- Constructor SummaryConstructorsConstructorDescriptionCreates the port configuration without a name.- WebServerPortConfig- (Atom atom) Creates the port configuration with a name.
- Method SummaryModifier and TypeMethodDescription- clone()Creates a clone out of this property.- protected GProp<?>- convertLoadedProp- (GProp<?> childProp) Enables conversion or omission of a property loaded from XML.Gets the bind address.Gets the Jetty port controller.Gets the description of the port configuration.Gets the Let's Encrypt domain name associated with this port configuration.Gets the different domain names as String set.- 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.- getLetsEncryptDomain- (String domain) Gets the Let's Encrypt domain instance for a specific domain name.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.Gets the Let's Encrypt domain instances 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.- voidRestarts the Jetty (HTTPS) server connector after Let's Encrypt domain certificate renewal.- 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.- Methods inherited from class com.iizix.prop.PropCnr- __transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from class java.lang.Object- getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.prop.IGProp- addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from interface com.iizix.prop.IPropCnr- canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized- Methods inherited from interface com.iizix.prop.IWebServerPortConfig- isLocalHTTP, isLocalHTTPS, newPortConfig
- Field Details- PORTThe name of the port value.- See Also:
 
- PROTOCOLThe protocol to use (HTTP or HTTPS).- See Also:
 
- HTTP2The name for the flag to use HTTP/2.- See Also:
 
- HTTP3The name for the flag to use HTTP/3.- See Also:
 
- BIND_ADDRESSThe name for the bind address string property.- See Also:
 
- FRONT_END_SECUREDIf the port is secure by means of a front-end proxy, even if the server protocol uses HTTP.- See Also:
 
- EXTERNAL_HOST_NAMEName for property for external host name or address when reverse-proxied.- See Also:
 
- UDP_PORTThe name of the UDP port value for HTTP/3.- See Also:
 
- EXTERNAL_PORTThe name of the port value when reverse-proxied.- See Also:
 
- ID_PKCS12The PKCS#12 identity.- See Also:
 
- ID_PASSWORDThe PKCS#12 identity password.- See Also:
 
- DOMAIN_NAMESDomain names.- See Also:
 
- LETS_ENCRYPT_DOMAINSDomain names associated with Let's Encrypt, comma separated list.- See Also:
 
- DEFAULT_PASSWORDThe default password used for keystores, Let's Encrypt certificates, etc: "changeit".- See Also:
 
- EXCLUDE_TLS_VERSIONProtocols to exclude: 0 = none, 1 = TLSv1.0, 2 = TLSv1.0 + 1.1.- See Also:
 
 
- Constructor Details- WebServerPortConfigpublic WebServerPortConfig()Creates the port configuration without a name. The name must be set in all cases using the- setPropertyAtomcall.
- WebServerPortConfigCreates the port configuration with a name.- Parameters:
- atom- The name of the property.
 
 
- Method Details- convertLoadedPropEnables conversion or omission of a property loaded from XML.- This method is typically used to process changes of e.g. property types, e.g. from IntProp to NumberProp, in case of a change of property definitions. - Overrides:
- convertLoadedPropin class- PropCnr
- Parameters:
- childProp- The child property that is about to be added.
- Returns:
- The property to add, null to omit it. The default processing is to return the same property, i.e. childProp.
- Throws:
- PropException- for property errors.
 
- getTypeGets the type of port: HTTP or HTTPS.- Specified by:
- getTypein interface- IWebServerPortConfig
- Returns:
- The type string.
 
- isFrontEndSecuredpublic 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.- Specified by:
- isFrontEndSecuredin interface- IWebServerPortConfig
- Returns:
- true if secure and HTTPS is used by the client side, false otherwise.
 
- getDescriptionGets the description of the port configuration.- Specified by:
- getDescriptionin interface- IWebServerPortConfig
- Returns:
- The description, null for none.
 
- getPortDescriptionGets the description of the port configuration.- Specified by:
- getPortDescriptionin interface- IWebServerPortConfig
- Returns:
- The description of the port configuration as Port NNN, HTTP[S] [, bind address]...
 
- cloneCreates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.
- getPortpublic int getPort()Gets the (local) port.- Specified by:
- getPortin interface- IWebServerPortConfig
- 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.
 
- useHTTP2public boolean useHTTP2()Use HTTP/2 alongside with HTTP/1.x. This setting is also valid for clear-text connections, i.e. non-TLS connections.- Specified by:
- useHTTP2in interface- IWebServerPortConfig
- Returns:
- Enable HTTP/2 protocol flag, default true.
 
- useHTTP3public boolean 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.- Specified by:
- useHTTP3in interface- IWebServerPortConfig
- Returns:
- Enable HTTP/3 protocol flag, always falsefor clear-text connections.
 
- getUDPPortpublic int 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.- Specified by:
- getUDPPortin interface- IWebServerPortConfig
- Returns:
- The UDP port number for HTTP/3 connections.
 
- getProtocolpublic int getProtocol()Gets the protocol to use.- Specified by:
- getProtocolin interface- IWebServerPortConfig
- Returns:
- The protocol: 0=HTTP (default), 1=HTTPS.
 
- getBindAddressGets the bind address.- Specified by:
- getBindAddressin interface- IWebServerPortConfig
- Returns:
- The bind address, or null if not defined (never empty string).
 
- getExternalHostNameGets the name for property for external host name or address when reverse-proxied.- Specified by:
- getExternalHostNamein interface- IWebServerPortConfig
- Returns:
- The host name or IP address of the external access to the port when reverse-proxied, nullfor none, never empty string.
 
- getExternalPortpublic int getExternalPort()Gets the external port when front-end proxied.- Specified by:
- getExternalPortin interface- IWebServerPortConfig
- Returns:
- The external port number (1-65534), or 0 if not defined.
 
- getKeyStorePasswordGets the KeyStore password.- Specified by:
- getKeyStorePasswordin interface- IWebServerPortConfig
- Returns:
- The password, null for none.
 
- getKeyStorepublic KeyStore getKeyStore() throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, UnrecoverableEntryExceptionGets the KeyStore from a PKCS#12 identity property and password.- Specified by:
- getKeyStorein interface- IWebServerPortConfig
- 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.
 
- getKeyStorepublic KeyStore 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- Specified by:
- getKeyStorein interface- IWebServerPortConfig
- 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.- Specified by:
- setPropertyin interface- IWebServerPortConfig
- 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.- Specified by:
- getPropertyin interface- IWebServerPortConfig
- 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.
 
- getDomainNamesGets the Let's Encrypt domain name associated with this port configuration.- Returns:
- The domain name as e.g. "hello.example.com", or null if not associated with Let's Encrypt.
 
- getDomainNamesSetGets the different domain names as String set. The domains names set includes all defined domain names that are configured for this port.- Returns:
- A new set of domain names.
 
- getLetsEncryptDomainNamesGets the Let's Encrypt domain name(s) associated with this port configuration.- Specified by:
- getLetsEncryptDomainNamesin interface- IWebServerPortConfig
- 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.- Specified by:
- getLetsEncryptDomainNamesSetin interface- IWebServerPortConfig
- Returns:
- The domain name(s) as e.g. "hello.example.com", or empty list if not associated with Let's Encrypt.
 
- getLetsEncryptDomainsGets the Let's Encrypt domain instances associated with this port configuration.- Returns:
- The domain instance that are configured and found.
 
- getLetsEncryptDomainGets the Let's Encrypt domain instance for a specific domain name.- Parameters:
- domain- The domain name.
- Returns:
- The Let's encrypt domain for that name, null if not found.
 
- setConfigSets the Jetty server connector configuration used with this configuration.- Specified by:
- setConfigin interface- IWebServerPortConfig
- Parameters:
- config- The configuration instance.
 
- restartConnectorpublic void restartConnector()Restarts the Jetty (HTTPS) server connector after Let's Encrypt domain certificate renewal.
- getControllerGets the Jetty port controller.- Returns:
- The port controller, or null if not initialized.
 
- getExcludedSecureProtocolsGets the excluded secure protocols.- Specified by:
- getExcludedSecureProtocolsin interface- IWebServerPortConfig
- Returns:
- Empty string for none, otherwise e.g. "TLSv1", "TLSv1.1".