Package org.apache.gravitino.credential
Class OSSTokenCredential
java.lang.Object
org.apache.gravitino.credential.OSSTokenCredential
- All Implemented Interfaces:
Credential
OSS token credential.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOSS access key ID used to access OSS data.static final StringOSS secret access key used to access OSS data.static final StringOSS security token.static final StringOSS token credential type.Fields inherited from interface org.apache.gravitino.credential.Credential
CREDENTIAL_TYPE, EXPIRE_TIME_IN_MS -
Constructor Summary
ConstructorsConstructorDescriptionThis is the constructor that is used by credential factory to create an instance of credential according to the credential information.OSSTokenCredential(String accessKeyId, String secretAccessKey, String securityToken, long expireTimeInMS) Constructs an instance ofOSSTokenCredentialwith secret key and token. -
Method Summary
Modifier and TypeMethodDescriptionGet oss access key ID.Returns credential information.Returns the type of the credential.longReturns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.voidinitialize(Map<String, String> credentialInfo, long expireTimeInMs) Initialize the credential with the credential information.Get oss secret access key.Get oss security token.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.gravitino.credential.Credential
toProperties
-
Field Details
-
OSS_TOKEN_CREDENTIAL_TYPE
OSS token credential type.- See Also:
-
GRAVITINO_OSS_SESSION_ACCESS_KEY_ID
OSS access key ID used to access OSS data.- See Also:
-
GRAVITINO_OSS_SESSION_SECRET_ACCESS_KEY
OSS secret access key used to access OSS data.- See Also:
-
GRAVITINO_OSS_TOKEN
OSS security token.- See Also:
-
-
Constructor Details
-
OSSTokenCredential
public OSSTokenCredential(String accessKeyId, String secretAccessKey, String securityToken, long expireTimeInMS) Constructs an instance ofOSSTokenCredentialwith secret key and token.- Parameters:
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.
-
OSSTokenCredential
public OSSTokenCredential()This is the constructor that is used by credential factory to create an instance of credential according to the credential information.
-
-
Method Details
-
credentialType
Description copied from interface:CredentialReturns the type of the credential. It should be the same as the credential type of the credential provider.- Specified by:
credentialTypein interfaceCredential- Returns:
- the credential type as a String.
-
expireTimeInMs
public long expireTimeInMs()Description copied from interface:CredentialReturns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.- Specified by:
expireTimeInMsin interfaceCredential- Returns:
- the expiration time as a long.
-
credentialInfo
Description copied from interface:CredentialReturns credential information.- Specified by:
credentialInfoin interfaceCredential- Returns:
- a map of credential information.
-
initialize
Description copied from interface:CredentialInitialize the credential with the credential information.This method is invoked to deserialize the credential in client side.
- Specified by:
initializein interfaceCredential- Parameters:
credentialInfo- The credential information fromCredential.credentialInfo().expireTimeInMs- The expire-time fromCredential.expireTimeInMs().
-
accessKeyId
Get oss access key ID.- Returns:
- The oss access key ID.
-
secretAccessKey
Get oss secret access key.- Returns:
- The oss secret access key.
-
securityToken
Get oss security token.- Returns:
- The oss security token.
-