@Public
@Evolving
public class AccessTokenTimer
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static long |
EXPIRE_BUFFER_MS |
| Constructor | Description |
|---|---|
AccessTokenTimer() |
|
AccessTokenTimer(org.apache.hadoop.util.Timer timer) |
| Modifier and Type | Method | Description |
|---|---|---|
long |
getNextRefreshMSSinceEpoch() |
Get next time we should refresh the token.
|
void |
setExpiresIn(java.lang.String expiresIn) |
Set when the access token will expire as reported by the oauth server,
ie in seconds from now.
|
void |
setExpiresInMSSinceEpoch(java.lang.String expiresInMSSinceEpoch) |
Set when the access token will expire in milliseconds from epoch,
as required by the WebHDFS configuration.
|
boolean |
shouldRefresh() |
Return true if the current token has expired or will expire within the
EXPIRE_BUFFER_MS (to give ample wiggle room for the call to be made to
the server).
|
public static final long EXPIRE_BUFFER_MS
public AccessTokenTimer()
public AccessTokenTimer(org.apache.hadoop.util.Timer timer)
timer - Timer instance for unit testingpublic void setExpiresIn(java.lang.String expiresIn)
expiresIn - Access time expiration as reported by OAuth serverpublic void setExpiresInMSSinceEpoch(java.lang.String expiresInMSSinceEpoch)
expiresInMSSinceEpoch - Access time expiration in ms since epoch.public long getNextRefreshMSSinceEpoch()
public boolean shouldRefresh()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.