Class MqttPlugin
java.lang.Object
ecmwf.common.technical.ThreadService.ConfigurableRunnable
ecmwf.common.plugin.PluginThread
ecmwf.ecpds.mover.plugin.mqtt.MqttPlugin
- All Implemented Interfaces:
MBeanService, HttpCertificateProvider, Runnable
The Class MqttPlugin.
-
Field Summary
Fields inherited from class PluginThread
_params -
Constructor Summary
ConstructorsConstructorDescriptionMqttPlugin(String ref, Map<String, String> params) Instantiates a new http plugin. -
Method Summary
Modifier and TypeMethodDescriptionReturns a JSON-encoded snapshot of the TLS certificate currently loaded by this plugin's HTTPS server, or"{}"if no certificate is available.voiddeployCertificate(byte[] pkcs12Bytes, String keystorePassword) Deploys a new PKCS#12 keystore to this plugin's HTTPS server and hot-reloads the certificate without restarting the server (where supported).Gets the port(s) this plugin is actually listening on, read directly from the plugin's own live state (as opposed to re-deriving it from configuration by plugin ref/name, which is fragile and breaks whenever a plugin's configuration section name differs from what a caller assumes).Gets the plugin name.Gets the version.voidHot-reloads the TLS certificate from the keystore file currently on disk, without requiring a new keystore to be uploaded.booleanstart()Start.voidstop()Stop.Methods inherited from class PluginThread
callerBack, callerGone, configurableRun, getAttribute, getCaller, getMBeanInfo, getParam, getPluginContainer, getRef, handle, handle, invoke, setAttribute, setCaller, setPluginContainer, subscribe, unSubscribeMethods inherited from class ThreadService.ConfigurableRunnable
execute, execute, execute, getContextClassLoader, getPriority, getThreadName, interrupt, interrupted, isAlive, isStarted, join, join, run, setContextClassLoader, setForceCookie, setInheritCookie, setPriority, setThreadNameAndCookie
-
Constructor Details
-
MqttPlugin
-
-
Method Details
-
getPluginName
Gets the plugin name. Gets the plugin name.- Specified by:
getPluginNamein classPluginThread- Returns:
- the plugin name
-
getVersion
Gets the version. Gets the version.- Specified by:
getVersionin classPluginThread- Returns:
- the version
-
getListeningPorts
Gets the port(s) this plugin is actually listening on, read directly from the plugin's own live state (as opposed to re-deriving it from configuration by plugin ref/name, which is fragile and breaks whenever a plugin's configuration section name differs from what a caller assumes). Subclasses that open one or more network listeners should override this to return their actual bound port(s); the default returns an empty list, meaning "no listening port to report" (e.g. a plugin with no network listener of its own). Returns the mqtt and/or mqtts port(s) this plugin is actually listening on, read directly from this plugin's own live state (populated oncestart()has successfully started) rather than re-derived from configuration elsewhere.- Overrides:
getListeningPortsin classPluginThread- Returns:
- the listening port(s), or an empty list if none/not applicable
-
start
public boolean start()Start. Start.- Specified by:
startin classPluginThread- Returns:
- true, if successful
-
stop
-
buildCertificateJson
Returns a JSON-encoded snapshot of the TLS certificate currently loaded by this plugin's HTTPS server, or"{}"if no certificate is available.- Specified by:
buildCertificateJsonin interfaceHttpCertificateProvider- Returns:
- JSON string; never
null
-
deployCertificate
Deploys a new PKCS#12 keystore to this plugin's HTTPS server and hot-reloads the certificate without restarting the server (where supported).- Specified by:
deployCertificatein interfaceHttpCertificateProvider- Parameters:
pkcs12Bytes- the PKCS#12 keystore byteskeystorePassword- password for the keystore and private key- Throws:
Exception- if the deployment or reload fails
-
reloadCertificate
Description copied from interface:HttpCertificateProviderHot-reloads the TLS certificate from the keystore file currently on disk, without requiring a new keystore to be uploaded. Use this after replacing the keystore file via automation or a secrets manager.- Specified by:
reloadCertificatein interfaceHttpCertificateProvider- Throws:
Exception- if the reload fails
-