public class TemporaryCredentials extends Object implements Credentials
| Modifier and Type | Field and Description |
|---|---|
protected String |
accessKeyId |
protected String |
accessKeySecret |
static double |
DEFAULT_EXPIRED_FACTOR |
protected long |
expiration |
protected double |
expiredFactor |
protected long |
lastUpdated |
protected String |
securityToken |
| Constructor and Description |
|---|
TemporaryCredentials(String accessKeyId,
String accessKeySecret,
String securityToken,
long expiration,
long lastUpdated)
Constructs TemporaryCredentials.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAccessKeyId() |
String |
getAccessKeySecret() |
String |
getSecurityToken() |
void |
setAccessKeyId(String accessKeyId) |
void |
setAccessKeySecret(String accessKeySecret) |
void |
setSecurityToken(String securityToken) |
boolean |
shouldRefresh()
Whether the credentials should be refreshed.
|
TemporaryCredentials |
withExpiredFactor(double expiredFactor)
Constructs TemporaryCredentials.
|
public static final double DEFAULT_EXPIRED_FACTOR
protected String accessKeyId
protected String accessKeySecret
protected String securityToken
protected long expiration
protected long lastUpdated
protected double expiredFactor
public TemporaryCredentials(String accessKeyId, String accessKeySecret, String securityToken, long expiration, long lastUpdated)
expiration - the expiration of the credentials, in millisecond format.lastUpdated - the last updated time of the credentials, in millisecond format.public boolean shouldRefresh()
public TemporaryCredentials withExpiredFactor(double expiredFactor)
expiredFactor - the expiration factor of the credentials, the
value should be less than 1.0 and greater than 0. Determines when
to refresh the credentials.public String getAccessKeyId()
getAccessKeyId in interface Credentialspublic String getAccessKeySecret()
getAccessKeySecret in interface Credentialspublic String getSecurityToken()
getSecurityToken in interface Credentialspublic void setAccessKeyId(String accessKeyId)
setAccessKeyId in interface Credentialspublic void setAccessKeySecret(String accessKeySecret)
setAccessKeySecret in interface Credentialspublic void setSecurityToken(String securityToken)
setSecurityToken in interface CredentialsCopyright © 2024. All Rights Reserved.