Package com.amilesend.tvdb.client
Class ApiClientFactory
java.lang.Object
com.amilesend.tvdb.client.ApiClientFactory
Factory used to simplify configuring and obtaining authenticated client instances to access TheTVDB v4 API.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionApiClientFactory
(String apiKey) Creates a newApiClientFactory
instance used to configure an authenticated TVDB client. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Authenticates and sets the default ApiClient configuration.Gets the authenticatedApiClient
instance.Forces (re)authentication for theApiClient
.
-
Constructor Details
-
ApiClientFactory
Creates a newApiClientFactory
instance used to configure an authenticated TVDB client.- Parameters:
apiKey
- the API key used to obtain the auth token
-
-
Method Details
-
authenticateDefaultClient
Authenticates and sets the default ApiClient configuration.- Throws:
ApiException
- if an error occurred while obtaining the auth token
-
getAuthenticatedClient
Gets the authenticatedApiClient
instance.- Returns:
- the authenticated client instance
- Throws:
ApiException
- if an error occurred while obtaining the auth token
-
refreshAuthentication
Forces (re)authentication for theApiClient
.- Returns:
- the authenticated client instance
- Throws:
ApiException
- if an error occurred while obtaining the auth token
-