public class TLSCertificateReloadListener extends java.lang.Object implements LifecycleListener
LifecycleListener that may be used to monitor the expiration dates of TLS certificates and trigger
automatic reloading of the TLS configuration a set number of days before the TLS certificate expires.
This listener assumes there is some other process (certbot, cloud infrastructure, etc) that renews the certificate on a regular basis and replaces the current certificate with the new one.
This listener does NOT re-read the Tomcat configuration from server.xml. If you make changes to server.xml you must restart the Tomcat process to pick up those changes.
| Constructor and Description |
|---|
TLSCertificateReloadListener() |
| Modifier and Type | Method and Description |
|---|---|
int |
getCheckPeriod()
Get the time, in seconds, between reloading checks.
|
int |
getDaysBefore()
Get the number of days before the expiry of a TLS certificate that it is expected that the new certificate will
be in place and the reloading can be triggered.
|
void |
lifecycleEvent(LifecycleEvent event)
Acknowledge the occurrence of the specified event.
|
void |
setCheckPeriod(int checkPeriod)
Set the time, in seconds, between reloading checks.
|
void |
setDaysBefore(int daysBefore)
Set the number of days before the expiry of a TLS certificate that it is expected that the new certificate will
be in place and the reloading can be triggered.
|
public int getCheckPeriod()
The periodic process for LifecycleListener typically runs much more frequently than this listener
requires. This attribute controls the period between checks.
If not specified, a default of 86,400 seconds (24 hours) is used.
public void setCheckPeriod(int checkPeriod)
checkPeriod - The new time, in seconds, between reloading checkspublic int getDaysBefore()
If not specified, a default of 14 days is used.
public void setDaysBefore(int daysBefore)
daysBefore - the number of days before the expiry of the current certificate that reloading will be
triggeredpublic void lifecycleEvent(LifecycleEvent event)
LifecycleListenerlifecycleEvent in interface LifecycleListenerevent - LifecycleEvent that has occurredCopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.