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 newApiClientFactoryinstance used to configure an authenticated TVDB client. -
Method Summary
Modifier and TypeMethodDescriptionvoidAuthenticates and sets the default ApiClient configuration.Gets the authenticatedApiClientinstance.Forces (re)authentication for theApiClient.
-
Constructor Details
-
ApiClientFactory
Creates a newApiClientFactoryinstance 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 authenticatedApiClientinstance.- 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
-