Class AuthManagerFactory
java.lang.Object
com.amilesend.discogs.connection.auth.AuthManagerFactory
Factory used to vend
AuthManager
instances used for Discogs.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnewOAuthAuthManager
(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.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.Creates a new auth manager for a user-supplied access token and secret.com.amilesend.client.connection.auth.NoOpAuthManager
Creates a new auth manager for unauthenticated requests.Creates a new auth manager for a user-supplied key and secret.
-
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:
-
newUserAuthenticatedAuthManager
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
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 connectionappCredentials
- the application credentials in the form of a key and secretuserAgent
- the user agent identifierreceiverPort
- 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 connectionappCredentials
- the application credentials in the form of a key and secretuserAgent
- the user agent identifierreceiverPort
- the port of the OAuth callback listener is listening onauthInfo
- the OAuth token information- Returns:
- the OAuth-based auth manager
- See Also:
-