Class CertificateEventPublisher
java.lang.Object
org.springframework.vault.core.certificate.CertificateEventPublisher
- All Implemented Interfaces:
InitializingBean
- Direct Known Subclasses:
CertificateContainer
Publisher for
CertificateEvents.
This publisher dispatches events to CertificateListener and
CertificateErrorListener. Instances are thread-safe once
initialized.
- Author:
- Mark Paluch
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSimpleCertificateErrorListenerimplementation to log errors. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCertificateListener(CertificateListener listener) Add aCertificateListenerto the container.voidaddErrorListener(CertificateErrorListener listener) Add aCertificateErrorListenerto the container.voidprotected voidonCertificateExpired(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when aCertificateexpires.protected voidonCertificateObtained(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when a certificate was obtained.protected voidonCertificateRotated(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when certificates were rotated.protected voidonError(RequestedCertificate requestedCertificate, Exception e) Hook method called when an error occurred during certificate issuance or retrieval.voidRemove aCertificateErrorListener.voidremoveCertificateListener(CertificateListener listener) Remove aCertificateListener.
-
Constructor Details
-
CertificateEventPublisher
public CertificateEventPublisher()
-
-
Method Details
-
addCertificateListener
Add aCertificateListenerto the container. The listener starts receiving events as soon as possible.- Parameters:
listener- lease listener, must not be null.
-
removeCertificateListener
Remove aCertificateListener.- Parameters:
listener- must not be null.
-
addErrorListener
Add aCertificateErrorListenerto the container. The listener starts receiving events as soon as possible.- Parameters:
listener- lease listener, must not be null.
-
removeCertificateErrorListener
Remove aCertificateErrorListener.- Parameters:
listener- must not be null.
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
onCertificateObtained
protected void onCertificateObtained(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when a certificate was obtained. The default implementation is to notifyCertificateListener. Implementations can override this method in subclasses.- Parameters:
requestedCertificate- must not be null.certificate- must not be null.- See Also:
-
onCertificateRotated
protected void onCertificateRotated(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when certificates were rotated. The default implementation is to notifyCertificateListener. Implementations can override this method in subclasses.- Parameters:
requestedCertificate- must not be null.certificate- must not be null.- See Also:
-
onCertificateExpired
protected void onCertificateExpired(RequestedCertificate requestedCertificate, Certificate certificate) Hook method called when aCertificateexpires. The default implementation is to notifyCertificateListener. Implementations can override this method in subclasses.- Parameters:
requestedCertificate- must not be null.certificate- must not be null.- See Also:
-
onError
Hook method called when an error occurred during certificate issuance or retrieval. The default implementation notifiesCertificateErrorListener. Implementations can override this method in subclasses.- Parameters:
requestedCertificate- must not be null.e- the causing exception.- See Also:
-