public class SecretLeaseEventPublisher extends Object implements InitializingBean
SecretLeaseEvent
s.
This publisher dispatches events to LeaseListener
and
LeaseErrorListener
. Instances are thread-safe once
initialized
.
SecretLeaseEvent
,
LeaseListener
,
LeaseErrorListener
Modifier and Type | Class and Description |
---|---|
static class |
SecretLeaseEventPublisher.LoggingErrorListener
Simple
LeaseErrorListener implementation to log errors. |
Constructor and Description |
---|
SecretLeaseEventPublisher() |
Modifier and Type | Method and Description |
---|---|
void |
addErrorListener(LeaseErrorListener listener)
Add a
LeaseErrorListener to the container. |
void |
addLeaseListener(LeaseListener listener)
Add a
LeaseListener to the container. |
void |
afterPropertiesSet() |
protected void |
onAfterLeaseRenewed(RequestedSecret requestedSecret,
Lease lease)
Hook method called when a
Lease is renewed. |
protected void |
onAfterLeaseRevocation(RequestedSecret requestedSecret,
Lease lease)
Hook method called after triggering revocation for a
Lease . |
protected void |
onBeforeLeaseRevocation(RequestedSecret requestedSecret,
Lease lease)
Hook method called before triggering revocation for a
Lease . |
protected void |
onError(RequestedSecret requestedSecret,
Lease lease,
Exception e)
Hook method called when an error occurred during secret retrieval, lease renewal,
and other Vault interactions.
|
protected void |
onLeaseExpired(RequestedSecret requestedSecret,
Lease lease)
Hook method called when a
Lease expires. |
protected void |
onSecretsObtained(RequestedSecret requestedSecret,
Lease lease,
Map<String,Object> body)
Hook method called when secrets were obtained.
|
void |
removeLeaseErrorListener(LeaseErrorListener listener)
Remove a
LeaseErrorListener . |
void |
removeLeaseListener(LeaseListener listener)
Remove a
LeaseListener . |
public void addLeaseListener(LeaseListener listener)
LeaseListener
to the container. The listener starts receiving events
as soon as possible.listener
- lease listener, must not be null.public void removeLeaseListener(LeaseListener listener)
LeaseListener
.listener
- must not be null.public void addErrorListener(LeaseErrorListener listener)
LeaseErrorListener
to the container. The listener starts receiving
events as soon as possible.listener
- lease listener, must not be null.public void removeLeaseErrorListener(LeaseErrorListener listener)
LeaseErrorListener
.listener
- must not be null.public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
protected void onSecretsObtained(RequestedSecret requestedSecret, Lease lease, Map<String,Object> body)
LeaseListener
. Implementations can override this method in
subclasses.requestedSecret
- must not be null.lease
- must not be null.body
- must not be null.protected void onAfterLeaseRenewed(RequestedSecret requestedSecret, Lease lease)
Lease
is renewed. The default implementation is
to notify LeaseListener
. Implementations can override this method in
subclasses.requestedSecret
- must not be null.lease
- must not be null.protected void onBeforeLeaseRevocation(RequestedSecret requestedSecret, Lease lease)
Lease
. The default
implementation is to notify LeaseListener
. Implementations can override
this method in subclasses.requestedSecret
- must not be null.lease
- must not be null.protected void onAfterLeaseRevocation(RequestedSecret requestedSecret, Lease lease)
Lease
. The default
implementation is to notify LeaseListener
. Implementations can override
this method in subclasses.requestedSecret
- must not be null.lease
- must not be null.protected void onLeaseExpired(RequestedSecret requestedSecret, Lease lease)
Lease
expires. The default implementation is to
notify LeaseListener
. Implementations can override this method in
subclasses.requestedSecret
- must not be null.lease
- must not be null.protected void onError(RequestedSecret requestedSecret, @Nullable Lease lease, Exception e)
LeaseErrorListener
. Implementations can override this method in subclasses.requestedSecret
- must not be null.lease
- may be nulle
- the causing exception.Copyright © 2016–2018 Pivotal Software, Inc.. All rights reserved.