Class CertificateEventPublisher

java.lang.Object
org.springframework.vault.core.certificate.CertificateEventPublisher
All Implemented Interfaces:
InitializingBean
Direct Known Subclasses:
CertificateContainer

public class CertificateEventPublisher extends Object implements InitializingBean
Publisher for CertificateEvents.

This publisher dispatches events to CertificateListener and CertificateErrorListener. Instances are thread-safe once initialized.

Author:
Mark Paluch
See Also:
  • Constructor Details

    • CertificateEventPublisher

      public CertificateEventPublisher()
  • Method Details

    • addCertificateListener

      public void addCertificateListener(CertificateListener listener)
      Add a CertificateListener to the container. The listener starts receiving events as soon as possible.
      Parameters:
      listener - lease listener, must not be null.
    • removeCertificateListener

      public void removeCertificateListener(CertificateListener listener)
      Parameters:
      listener - must not be null.
    • addErrorListener

      public void addErrorListener(CertificateErrorListener listener)
      Add a CertificateErrorListener to the container. The listener starts receiving events as soon as possible.
      Parameters:
      listener - lease listener, must not be null.
    • removeCertificateErrorListener

      public void removeCertificateErrorListener(CertificateErrorListener listener)
      Parameters:
      listener - must not be null.
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface InitializingBean
    • onCertificateObtained

      protected void onCertificateObtained(RequestedCertificate requestedCertificate, Certificate certificate)
      Hook method called when a certificate was obtained. The default implementation is to notify CertificateListener. 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 notify CertificateListener. 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 a Certificate expires. The default implementation is to notify CertificateListener. Implementations can override this method in subclasses.
      Parameters:
      requestedCertificate - must not be null.
      certificate - must not be null.
      See Also:
    • onError

      protected void onError(RequestedCertificate requestedCertificate, Exception e)
      Hook method called when an error occurred during certificate issuance or retrieval. The default implementation notifies CertificateErrorListener. Implementations can override this method in subclasses.
      Parameters:
      requestedCertificate - must not be null.
      e - the causing exception.
      See Also: