public class OSSTokenCredential extends java.lang.Object implements Credential
| Modifier and Type | Field and Description | 
|---|---|
| static java.lang.String | GRAVITINO_OSS_SESSION_ACCESS_KEY_IDOSS access key ID used to access OSS data. | 
| static java.lang.String | GRAVITINO_OSS_SESSION_SECRET_ACCESS_KEYOSS secret access key used to access OSS data. | 
| static java.lang.String | GRAVITINO_OSS_TOKENOSS security token. | 
| static java.lang.String | OSS_TOKEN_CREDENTIAL_TYPEOSS token credential type. | 
CREDENTIAL_TYPE, EXPIRE_TIME_IN_MS| Constructor and Description | 
|---|
| OSSTokenCredential()This is the constructor that is used by credential factory to create an instance of credential
 according to the credential information. | 
| OSSTokenCredential(java.lang.String accessKeyId,
                  java.lang.String secretAccessKey,
                  java.lang.String securityToken,
                  long expireTimeInMS)Constructs an instance of  OSSTokenCredentialwith secret key and token. | 
| Modifier and Type | Method and Description | 
|---|---|
| java.lang.String | accessKeyId()Get oss access key ID. | 
| java.util.Map<java.lang.String,java.lang.String> | credentialInfo()Returns credential information. | 
| java.lang.String | credentialType()Returns the type of the credential. | 
| long | expireTimeInMs()Returns the expiration time of the credential in milliseconds since the epoch, 0 means not
 expire. | 
| void | initialize(java.util.Map<java.lang.String,java.lang.String> credentialInfo,
          long expireTimeInMs)Initialize the credential with the credential information. | 
| java.lang.String | secretAccessKey()Get oss secret access key. | 
| java.lang.String | securityToken()Get oss security token. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoPropertiespublic static final java.lang.String OSS_TOKEN_CREDENTIAL_TYPE
public static final java.lang.String GRAVITINO_OSS_SESSION_ACCESS_KEY_ID
public static final java.lang.String GRAVITINO_OSS_SESSION_SECRET_ACCESS_KEY
public static final java.lang.String GRAVITINO_OSS_TOKEN
public OSSTokenCredential(java.lang.String accessKeyId,
                          java.lang.String secretAccessKey,
                          java.lang.String securityToken,
                          long expireTimeInMS)
OSSTokenCredential with secret key and token.accessKeyId - The oss access key ID.secretAccessKey - The oss secret access key.securityToken - The oss security token.expireTimeInMS - The oss token expire time in ms.public OSSTokenCredential()
public java.lang.String credentialType()
CredentialcredentialType in interface Credentialpublic long expireTimeInMs()
CredentialexpireTimeInMs in interface Credentialpublic java.util.Map<java.lang.String,java.lang.String> credentialInfo()
CredentialcredentialInfo in interface Credentialpublic void initialize(java.util.Map<java.lang.String,java.lang.String> credentialInfo,
                       long expireTimeInMs)
CredentialThis method is invoked to deserialize the credential in client side.
initialize in interface CredentialcredentialInfo - The credential information from Credential.credentialInfo().expireTimeInMs - The expire-time from Credential.expireTimeInMs().public java.lang.String accessKeyId()
public java.lang.String secretAccessKey()
public java.lang.String securityToken()