Class AuthManagerFactory

java.lang.Object
com.amilesend.discogs.connection.auth.AuthManagerFactory

public class AuthManagerFactory extends Object
Factory used to vend AuthManager instances used for Discogs.
See Also:
  • AuthManager
  • Constructor Details

    • AuthManagerFactory

      public AuthManagerFactory()
  • Method Details

    • newUnauthenticatedAuthManager

      public com.amilesend.client.connection.auth.NoOpAuthManager newUnauthenticatedAuthManager()
      Creates a new auth manager for unauthenticated requests.
      Returns:
      the no-op auth manager
      See Also:
      • NoOpAuthManager
    • newUserAuthenticatedAuthManager

      public KeySecretAuthManager newUserAuthenticatedAuthManager(KeySecretAuthInfo authInfo)
      Creates a new auth manager for a user-supplied key and secret.
      Parameters:
      authInfo - the auth info containing the key and secret
      Returns:
      the key-secret-based auth manager
      See Also:
    • newTokenAuthenticatedAuthManager

      public TokenAuthManager newTokenAuthenticatedAuthManager(TokenAuthInfo authInfo)
      Creates a new auth manager for a user-supplied access token and secret.
      Parameters:
      authInfo - the auth info containing the token and secret
      Returns:
      the token-based auth manager
      See Also:
    • newOAuthAuthManager

      public OAuthManager newOAuthAuthManager(okhttp3.OkHttpClient httpClient, KeySecretAuthInfo appCredentials, String userAgent, int receiverPort)
      Creates a new OAuth-based auth manager to execute the OAuth flow to acquire the OAuth access token.
      Parameters:
      httpClient - the configured OkHttp client connection
      appCredentials - the application credentials in the form of a key and secret
      userAgent - the user agent identifier
      receiverPort - the port of the OAuth callback listener is listening on
      Returns:
      the OAuth-based auth manager
      See Also:
    • newOAuthAuthManagerWithExistingToken

      public OAuthManager newOAuthAuthManagerWithExistingToken(okhttp3.OkHttpClient httpClient, KeySecretAuthInfo appCredentials, String userAgent, int receiverPort, OAuthInfo authInfo)
      Creates a new OAuth-based auth manager for an existing persisted OAuth token.
      Parameters:
      httpClient - the configured OkHttp client connection
      appCredentials - the application credentials in the form of a key and secret
      userAgent - the user agent identifier
      receiverPort - the port of the OAuth callback listener is listening on
      authInfo - the OAuth token information
      Returns:
      the OAuth-based auth manager
      See Also: