public abstract class LifecycleAwareSessionManagerSupport extends AuthenticationEventPublisher
TaskScheduler
and LifecycleAwareSessionManagerSupport.RefreshTrigger
. Typically used
within the framework itself.
Not intended to be used directly.
Modifier and Type | Class and Description |
---|---|
static class |
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger
LifecycleAwareSessionManagerSupport.RefreshTrigger implementation using a fixed timeout to schedule renewal
before a LoginToken expires. |
protected static class |
LifecycleAwareSessionManagerSupport.OneShotTrigger
This one-shot trigger creates only one execution time to trigger an execution only
once.
|
static interface |
LifecycleAwareSessionManagerSupport.RefreshTrigger
Common interface for trigger objects that determine the next execution time of a
refresh task.
|
Modifier and Type | Field and Description |
---|---|
protected Log |
logger
Logger available to subclasses.
|
static int |
REFRESH_PERIOD_BEFORE_EXPIRY
Refresh 5 seconds before the token expires.
|
Constructor and Description |
---|
LifecycleAwareSessionManagerSupport(TaskScheduler taskScheduler)
Create a
LifecycleAwareSessionManager given TaskScheduler . |
LifecycleAwareSessionManagerSupport(TaskScheduler taskScheduler,
LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger)
|
Modifier and Type | Method and Description |
---|---|
protected LifecycleAwareSessionManagerSupport.RefreshTrigger |
getRefreshTrigger() |
protected TaskScheduler |
getTaskScheduler() |
protected boolean |
isExpired(LoginToken loginToken)
Check whether the Token falls below its
validity threshold . |
protected boolean |
isTokenSelfLookupEnabled()
Returns whether token self-lookup is enabled to augment
VaultToken obtained
from a ClientAuthentication . |
void |
setLeaseStrategy(LeaseStrategy leaseStrategy)
Set the
LeaseStrategy for lease renewal error handling. |
void |
setTokenSelfLookupEnabled(boolean tokenSelfLookupEnabled)
Enables/disables token self-lookup.
|
addAuthenticationListener, addErrorListener, removeAuthenticationListener, removeErrorListener
public static final int REFRESH_PERIOD_BEFORE_EXPIRY
protected final Log logger
public LifecycleAwareSessionManagerSupport(TaskScheduler taskScheduler)
LifecycleAwareSessionManager
given TaskScheduler
. Using
DEFAULT_TRIGGER
to trigger refresh.taskScheduler
- must not be null.public LifecycleAwareSessionManagerSupport(TaskScheduler taskScheduler, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger)
LifecycleAwareSessionManager
given TaskScheduler
and
LifecycleAwareSessionManagerSupport.RefreshTrigger
.taskScheduler
- must not be null.refreshTrigger
- must not be null.protected boolean isTokenSelfLookupEnabled()
VaultToken
obtained
from a ClientAuthentication
. Self-lookup determines whether a token is
renewable and its TTL. Self lookup is skipped for LoginToken
. Self-lookup
requests decrement token usage count by one. Skipped for LoginToken
.
Self-lookup for tokens without a permission to access
auth/token/lookup-self
will fail gracefully and continue without token
renewal.
public void setTokenSelfLookupEnabled(boolean tokenSelfLookupEnabled)
VaultToken
obtained from a ClientAuthentication
. Self-lookup determines whether a
token is renewable and its TTL.tokenSelfLookupEnabled
- true to enable self-lookup,
false to disable self-lookup. Enabled by default.public void setLeaseStrategy(LeaseStrategy leaseStrategy)
LeaseStrategy
for lease renewal error handling.leaseStrategy
- the LeaseStrategy
, must not be null.protected TaskScheduler getTaskScheduler()
TaskScheduler
.protected LifecycleAwareSessionManagerSupport.RefreshTrigger getRefreshTrigger()
LifecycleAwareSessionManagerSupport.RefreshTrigger
.protected boolean isExpired(LoginToken loginToken)
validity threshold
.
Typically used to discard a token.loginToken
- must not be null.Copyright © 2016–2022 Pivotal Software, Inc.. All rights reserved.