Package org.opencms.letsencrypt
Class CmsLetsEncryptConfiguration
- java.lang.Object
-
- org.opencms.letsencrypt.CmsLetsEncryptConfiguration
-
- All Implemented Interfaces:
I_CmsConfigurationParameterHandler
public class CmsLetsEncryptConfiguration extends java.lang.Object implements I_CmsConfigurationParameterHandler
Configuration class containing the LetsEncrypt configuration settings OpenCms needed by OpenCms.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCmsLetsEncryptConfiguration.ModeEnum which represents different modes that control which domains OpenCms puts into the certificate configuration.static classCmsLetsEncryptConfiguration.TriggerEnum which represents the different types of events that LetsEncrypt updates should be triggered by.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_CERTCONFIGAttribute name for the certificate configuration path.static java.lang.StringATTR_HOSTAttribute name for the host.static java.lang.StringATTR_MODEAttribute name for the mode.static java.lang.StringATTR_PORTAttribute name for the port.static java.lang.StringATTR_TRIGGERAttribute name for the trigger mode.static CmsElementWithAttrsParamConfigHelperCONFIG_HELPERHelper for parsing / generating the configuration.static CmsLetsEncryptConfiguration.TriggerDEFAULT_TRIGGERThe default trigger mode.static java.lang.StringN_LETSENCRYPTNode name.-
Fields inherited from interface org.opencms.configuration.I_CmsConfigurationParameterHandler
ADD_PARAMETER_METHOD, INIT_CONFIGURATION_METHOD
-
-
Constructor Summary
Constructors Constructor Description CmsLetsEncryptConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)Adds a configuration parameter to this parameter configurable class instance.java.lang.StringgetCertConfigPath()Gets the path where the certificate configuration should be written to.CmsParameterConfigurationgetConfiguration()Returns the parameters of this configurable class instance, ornullif the class does not need any parameters.java.lang.StringgetHost()Gets the host name for the LetsEncrypt docker container.CmsLetsEncryptConfiguration.ModegetMode()Gets the configured mode, or null if no mode or an invalid mode have been configured.intgetPort()Gets the configured port, or -1 if the port is not set or has an invalid value.CmsLetsEncryptConfiguration.TriggergetTrigger()Gets the trigger mode.voidinitConfiguration()Initializes a configuration after all parameters have been added.booleanisValidAndEnabled()Checks if the configuration is enabled and does not have missing settings.
-
-
-
Field Detail
-
ATTR_CERTCONFIG
public static final java.lang.String ATTR_CERTCONFIG
Attribute name for the certificate configuration path.- See Also:
- Constant Field Values
-
ATTR_HOST
public static final java.lang.String ATTR_HOST
Attribute name for the host.- See Also:
- Constant Field Values
-
ATTR_MODE
public static final java.lang.String ATTR_MODE
Attribute name for the mode.- See Also:
- Constant Field Values
-
ATTR_PORT
public static final java.lang.String ATTR_PORT
Attribute name for the port.- See Also:
- Constant Field Values
-
ATTR_TRIGGER
public static final java.lang.String ATTR_TRIGGER
Attribute name for the trigger mode.- See Also:
- Constant Field Values
-
N_LETSENCRYPT
public static final java.lang.String N_LETSENCRYPT
Node name.- See Also:
- Constant Field Values
-
CONFIG_HELPER
public static final CmsElementWithAttrsParamConfigHelper CONFIG_HELPER
Helper for parsing / generating the configuration.
-
DEFAULT_TRIGGER
public static final CmsLetsEncryptConfiguration.Trigger DEFAULT_TRIGGER
The default trigger mode.
-
-
Constructor Detail
-
CmsLetsEncryptConfiguration
public CmsLetsEncryptConfiguration()
-
-
Method Detail
-
addConfigurationParameter
public void addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Description copied from interface:I_CmsConfigurationParameterHandlerAdds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameterin interfaceI_CmsConfigurationParameterHandler- Parameters:
paramName- the name of the parameterparamValue- the value for the parameter- See Also:
I_CmsConfigurationParameterHandler.addConfigurationParameter(java.lang.String, java.lang.String)
-
getCertConfigPath
public java.lang.String getCertConfigPath()
Gets the path where the certificate configuration should be written to.- Returns:
- the certificate configuration target path
-
getConfiguration
public CmsParameterConfiguration getConfiguration()
Description copied from interface:I_CmsConfigurationParameterHandlerReturns the parameters of this configurable class instance, ornullif the class does not need any parameters.- Specified by:
getConfigurationin interfaceI_CmsConfigurationParameterHandler- Returns:
- the parameters of this configurable class instance,
or
nullif the class does not need any parameters - See Also:
I_CmsConfigurationParameterHandler.getConfiguration()
-
getHost
public java.lang.String getHost()
Gets the host name for the LetsEncrypt docker container.The host name is used to signal to the LetsEncrypt container that the configuration has been updated.
- Returns:
- the host name of the LetsEncrypt container
-
getMode
public CmsLetsEncryptConfiguration.Mode getMode()
Gets the configured mode, or null if no mode or an invalid mode have been configured.- Returns:
- the mode
-
getPort
public int getPort()
Gets the configured port, or -1 if the port is not set or has an invalid value.The port is used to signal to the LetsEncrypt docker container that the certificate configuration has changed.
- Returns:
- the configured port
-
getTrigger
public CmsLetsEncryptConfiguration.Trigger getTrigger()
Gets the trigger mode.- Returns:
- the trigger mode
-
initConfiguration
public void initConfiguration()
Description copied from interface:I_CmsConfigurationParameterHandlerInitializes a configuration after all parameters have been added.- Specified by:
initConfigurationin interfaceI_CmsConfigurationParameterHandler- See Also:
I_CmsConfigurationParameterHandler.initConfiguration()
-
isValidAndEnabled
public boolean isValidAndEnabled()
Checks if the configuration is enabled and does not have missing settings.- Returns:
- true if the configuration is enabled and does not have missing settings
-
-