Interface CredentialStore

  • All Known Implementing Classes:
    FileCredentialStore

    @Deprecated
    @Beta
    public interface CredentialStore
    Deprecated.
    (to be removed in the future) Use DataStoreFactory with StoredCredential instead.
    Beta
    OAuth 2.0 credential persistence store interface to provide a fully pluggable storage mechanism.

    The user ID should be used as the primary key for storage, and the rest of the data consists of the access token, refresh token, and expiration time.

    Implementations should be thread safe.

    Since:
    1.7
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void delete​(java.lang.String userId, Credential credential)
      Deprecated.
      Deletes the credential of the given user ID.
      boolean load​(java.lang.String userId, Credential credential)
      Deprecated.
      Loads the credential for the given user ID.
      void store​(java.lang.String userId, Credential credential)
      Deprecated.
      Stores the credential of the given user ID.
    • Method Detail

      • load

        boolean load​(java.lang.String userId,
                     Credential credential)
              throws java.io.IOException
        Deprecated.
        Loads the credential for the given user ID.
        Parameters:
        userId - user ID whose credential needs to be loaded
        credential - credential whose access token, refresh token, and expiration time need to be set if the credential already exists in storage
        Returns:
        true if the credential has been successfully found and loaded or false otherwise
        Throws:
        java.io.IOException
      • store

        void store​(java.lang.String userId,
                   Credential credential)
            throws java.io.IOException
        Deprecated.
        Stores the credential of the given user ID.
        Parameters:
        userId - user ID whose credential needs to be stored
        credential - credential whose access token, refresh token, and expiration time need to be stored
        Throws:
        java.io.IOException
      • delete

        void delete​(java.lang.String userId,
                    Credential credential)
             throws java.io.IOException
        Deprecated.
        Deletes the credential of the given user ID.
        Parameters:
        userId - user ID whose credential needs to be deleted
        credential - credential to be deleted
        Throws:
        java.io.IOException