Interface Credential

All Known Implementing Classes:
ADLSTokenCredential, AwsIrsaCredential, AzureAccountKeyCredential, CredentialDTO, GCSTokenCredential, OSSSecretKeyCredential, OSSTokenCredential, S3SecretKeyCredential, S3TokenCredential

public interface Credential
Interface representing a credential with type, expiration time, and additional information.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Credential type in the credential.
    static final String
    Credential expire time in ms since the epoch.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    default Map<String,String>
    Converts the credential to properties to transfer the credential though API.
  • Field Details

  • Method Details

    • credentialType

      String credentialType()
      Returns the type of the credential. It should be the same as the credential type of the credential provider.
      Returns:
      the credential type as a String.
    • expireTimeInMs

      long expireTimeInMs()
      Returns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.
      Returns:
      the expiration time as a long.
    • credentialInfo

      Map<String,String> credentialInfo()
      Returns credential information.
      Returns:
      a map of credential information.
    • initialize

      void initialize(Map<String,String> credentialInfo, long expireTimeInMs)
      Initialize the credential with the credential information.

      This method is invoked to deserialize the credential in client side.

      Parameters:
      credentialInfo - The credential information from credentialInfo().
      expireTimeInMs - The expire-time from expireTimeInMs().
    • toProperties

      default Map<String,String> toProperties()
      Converts the credential to properties to transfer the credential though API.
      Returns:
      a map containing credential properties.