List of usage examples for org.springframework.vault.core.lease.event SecretLeaseCreatedEvent getSecrets
public Map<String, Object> getSecrets()
From source file:org.springframework.vault.core.env.LeaseAwareVaultPropertySource.java
/** * Hook method to handle a {@link SecretLeaseEvent}. * * @param leaseEvent must not be {@literal null}. * @param properties reference to property storage of this property source. *///from w w w . j a v a2 s .c om protected void handleLeaseEvent(SecretLeaseEvent leaseEvent, Map<String, String> properties) { if (leaseEvent.getSource() != getRequestedSecret()) { return; } if (leaseEvent instanceof SecretLeaseExpiredEvent || leaseEvent instanceof BeforeSecretLeaseRevocationEvent || leaseEvent instanceof SecretLeaseCreatedEvent) { properties.clear(); } if (leaseEvent instanceof SecretLeaseCreatedEvent) { SecretLeaseCreatedEvent created = (SecretLeaseCreatedEvent) leaseEvent; properties.putAll(doTransformProperties(toStringMap(created.getSecrets()))); } }