Package org.apache.gravitino.credential
Class S3TokenCredential
java.lang.Object
org.apache.gravitino.credential.S3TokenCredential
- All Implemented Interfaces:
Credential
S3 token credential.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
S3 session access key ID used to access S3 data.static final String
S3 session secret access key used to access S3 data.static final String
S3 session token.static final String
S3 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.S3TokenCredential
(String accessKeyId, String secretAccessKey, String sessionToken, long expireTimeInMS) Constructs an instance ofS3SecretKeyCredential
with session secret key and token. -
Method Summary
Modifier and TypeMethodDescriptionGet S3 session access key ID.Returns credential information.Returns the type of the credential.long
Returns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.void
initialize
(Map<String, String> credentialInfo, long expireTimeInMs) Initialize the credential with the credential information.Get S3 session secret access key.Get S3 session token.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.gravitino.credential.Credential
toProperties
-
Field Details
-
S3_TOKEN_CREDENTIAL_TYPE
S3 token credential type.- See Also:
-
GRAVITINO_S3_SESSION_ACCESS_KEY_ID
S3 session access key ID used to access S3 data.- See Also:
-
GRAVITINO_S3_SESSION_SECRET_ACCESS_KEY
S3 session secret access key used to access S3 data.- See Also:
-
GRAVITINO_S3_TOKEN
S3 session token.- See Also:
-
-
Constructor Details
-
S3TokenCredential
public S3TokenCredential(String accessKeyId, String secretAccessKey, String sessionToken, long expireTimeInMS) Constructs an instance ofS3SecretKeyCredential
with session secret key and token.- Parameters:
accessKeyId
- The S3 session access key ID.secretAccessKey
- The S3 session secret access key.sessionToken
- The S3 session token.expireTimeInMS
- The S3 session token expire time in ms.
-
S3TokenCredential
public S3TokenCredential()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:Credential
Returns the type of the credential. It should be the same as the credential type of the credential provider.- Specified by:
credentialType
in interfaceCredential
- Returns:
- the credential type as a String.
-
expireTimeInMs
public long expireTimeInMs()Description copied from interface:Credential
Returns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.- Specified by:
expireTimeInMs
in interfaceCredential
- Returns:
- the expiration time as a long.
-
credentialInfo
Description copied from interface:Credential
Returns credential information.- Specified by:
credentialInfo
in interfaceCredential
- Returns:
- a map of credential information.
-
initialize
Description copied from interface:Credential
Initialize the credential with the credential information.This method is invoked to deserialize the credential in client side.
- Specified by:
initialize
in interfaceCredential
- Parameters:
credentialInfo
- The credential information fromCredential.credentialInfo()
.expireTimeInMs
- The expire-time fromCredential.expireTimeInMs()
.
-
accessKeyId
Get S3 session access key ID.- Returns:
- The S3 access key ID.
-
secretAccessKey
Get S3 session secret access key.- Returns:
- The S3 secret access key.
-
sessionToken
Get S3 session token.- Returns:
- The S3 session token.
-