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 class
CmsLetsEncryptConfiguration.Mode
Enum which represents different modes that control which domains OpenCms puts into the certificate configuration.static class
CmsLetsEncryptConfiguration.Trigger
Enum 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.String
ATTR_CERTCONFIG
Attribute name for the certificate configuration path.static java.lang.String
ATTR_HOST
Attribute name for the host.static java.lang.String
ATTR_MODE
Attribute name for the mode.static java.lang.String
ATTR_PORT
Attribute name for the port.static java.lang.String
ATTR_TRIGGER
Attribute name for the trigger mode.static CmsElementWithAttrsParamConfigHelper
CONFIG_HELPER
Helper for parsing / generating the configuration.static CmsLetsEncryptConfiguration.Trigger
DEFAULT_TRIGGER
The default trigger mode.static java.lang.String
N_LETSENCRYPT
Node 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 void
addConfigurationParameter(java.lang.String paramName, java.lang.String paramValue)
Adds a configuration parameter to this parameter configurable class instance.java.lang.String
getCertConfigPath()
Gets the path where the certificate configuration should be written to.CmsParameterConfiguration
getConfiguration()
Returns the parameters of this configurable class instance, ornull
if the class does not need any parameters.java.lang.String
getHost()
Gets the host name for the LetsEncrypt docker container.CmsLetsEncryptConfiguration.Mode
getMode()
Gets the configured mode, or null if no mode or an invalid mode have been configured.int
getPort()
Gets the configured port, or -1 if the port is not set or has an invalid value.CmsLetsEncryptConfiguration.Trigger
getTrigger()
Gets the trigger mode.void
initConfiguration()
Initializes a configuration after all parameters have been added.boolean
isValidAndEnabled()
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_CmsConfigurationParameterHandler
Adds a configuration parameter to this parameter configurable class instance.- Specified by:
addConfigurationParameter
in 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_CmsConfigurationParameterHandler
Returns the parameters of this configurable class instance, ornull
if the class does not need any parameters.- Specified by:
getConfiguration
in interfaceI_CmsConfigurationParameterHandler
- Returns:
- the parameters of this configurable class instance,
or
null
if 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_CmsConfigurationParameterHandler
Initializes a configuration after all parameters have been added.- Specified by:
initConfiguration
in 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
-
-