Class CertificateReloadManager
- All Implemented Interfaces:
 org.infinispan.commons.api.Lifecycle
 This class is attached to Infinispan lifecycle, and it starts/stops together with the EmbeddedCacheManager.
 
 It provides two public methods, rotateCertificate() to force a certificate rotation without waiting for the
 configured period, and reloadCertificate() to force a certificate reloading from storage and schedule the
 next rotation.
 
When the timer expires, only the cluster coordinator generates a new certificate. It notifies the other cluster members that a new certificate is available in storage. Both the key and trust stores keep a hold of the old and the new certificates.
Last, but not least, it listens to topology changes and, if the coordinator crashes, the new re-elected coordinator will continue to perform its duties to rotate the certificate.
- 
Field Summary
Fields - 
Constructor Summary
ConstructorsConstructorDescriptionCertificateReloadManager(KeycloakSessionFactory sessionFactory, JGroupsCertificateHolder certificateHolder, int rotationDays)  - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateSelfSignedCertificate(long validForSeconds) longbooleanbooleanvoidonViewChanged(org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent event) voidReloads the certificate from storage.voidCreates and reload a new certificate.voidsetRotationSeconds(long seconds) voidstart()voidstop() 
- 
Field Details
- 
CERTIFICATE_ID
- See Also:
 
 
 - 
 - 
Constructor Details
- 
CertificateReloadManager
public CertificateReloadManager(KeycloakSessionFactory sessionFactory, JGroupsCertificateHolder certificateHolder, int rotationDays)  
 - 
 - 
Method Details
- 
start
public void start()- Specified by:
 startin interfaceorg.infinispan.commons.api.Lifecycle
 - 
stop
public void stop()- Specified by:
 stopin interfaceorg.infinispan.commons.api.Lifecycle
 - 
rotateCertificate
public void rotateCertificate()Creates and reload a new certificate. - 
reloadCertificate
public void reloadCertificate()Reloads the certificate from storage. - 
onViewChanged
public void onViewChanged(org.infinispan.notifications.cachemanagerlistener.event.ViewChangedEvent event)  - 
currentCertificate
 - 
setRotationSeconds
public void setRotationSeconds(long seconds)  - 
getRotationSeconds
public long getRotationSeconds() - 
isCoordinator
public boolean isCoordinator() - 
hasRotationTask
public boolean hasRotationTask() - 
generateSelfSignedCertificate
 
 -