Package org.apache.gravitino.credential
Class OSSSecretKeyCredential
java.lang.Object
org.apache.gravitino.credential.OSSSecretKeyCredential
- All Implemented Interfaces:
Credential
OSS secret key credential.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The static access key ID used to access OSS data.static final String
The static secret access key used to access OSS data.static final String
OSS secret key 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.OSSSecretKeyCredential
(String accessKeyId, String secretAccessKey) Constructs an instance ofOSSSecretKeyCredential
with the static OSS access key ID and secret access key. -
Method Summary
Modifier and TypeMethodDescriptionGet OSS static 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 OSS static secret access key.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
-
OSS_SECRET_KEY_CREDENTIAL_TYPE
OSS secret key credential type.- See Also:
-
GRAVITINO_OSS_STATIC_ACCESS_KEY_ID
The static access key ID used to access OSS data.- See Also:
-
GRAVITINO_OSS_STATIC_SECRET_ACCESS_KEY
The static secret access key used to access OSS data.- See Also:
-
-
Constructor Details
-
OSSSecretKeyCredential
Constructs an instance ofOSSSecretKeyCredential
with the static OSS access key ID and secret access key.- Parameters:
accessKeyId
- The OSS static access key ID.secretAccessKey
- The OSS static secret access key.
-
OSSSecretKeyCredential
public OSSSecretKeyCredential()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
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 fromcredentialInfo()
.expireTimeInMs
- The expire-time fromexpireTimeInMs()
.
-
accessKeyId
Get OSS static access key ID.- Returns:
- The OSS access key ID.
-
secretAccessKey
Get OSS static secret access key.- Returns:
- The OSS secret access key.
-