Class OSSTokenCredential

java.lang.Object
org.apache.gravitino.credential.OSSTokenCredential
All Implemented Interfaces:
Credential

public class OSSTokenCredential extends Object implements Credential
OSS token credential.
  • Field Details

    • OSS_TOKEN_CREDENTIAL_TYPE

      public static final String OSS_TOKEN_CREDENTIAL_TYPE
      OSS token credential type.
      See Also:
    • GRAVITINO_OSS_SESSION_ACCESS_KEY_ID

      public static final String GRAVITINO_OSS_SESSION_ACCESS_KEY_ID
      OSS access key ID used to access OSS data.
      See Also:
    • GRAVITINO_OSS_SESSION_SECRET_ACCESS_KEY

      public static final String GRAVITINO_OSS_SESSION_SECRET_ACCESS_KEY
      OSS secret access key used to access OSS data.
      See Also:
    • GRAVITINO_OSS_TOKEN

      public static final String GRAVITINO_OSS_TOKEN
      OSS security token.
      See Also:
  • Constructor Details

    • OSSTokenCredential

      public OSSTokenCredential(String accessKeyId, String secretAccessKey, String securityToken, long expireTimeInMS)
      Constructs an instance of OSSTokenCredential with 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

      public String 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 interface Credential
      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 interface Credential
      Returns:
      the expiration time as a long.
    • credentialInfo

      public Map<String,String> credentialInfo()
      Description copied from interface: Credential
      Returns credential information.
      Specified by:
      credentialInfo in interface Credential
      Returns:
      a map of credential information.
    • initialize

      public void initialize(Map<String,String> credentialInfo, long expireTimeInMs)
      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 interface Credential
      Parameters:
      credentialInfo - The credential information from Credential.credentialInfo().
      expireTimeInMs - The expire-time from Credential.expireTimeInMs().
    • accessKeyId

      public String accessKeyId()
      Get oss access key ID.
      Returns:
      The oss access key ID.
    • secretAccessKey

      public String secretAccessKey()
      Get oss secret access key.
      Returns:
      The oss secret access key.
    • securityToken

      public String securityToken()
      Get oss security token.
      Returns:
      The oss security token.