Class ApiClientFactory

java.lang.Object
com.amilesend.tvdb.client.ApiClientFactory

public class ApiClientFactory extends Object
Factory used to simplify configuring and obtaining authenticated client instances to access TheTVDB v4 API.
See Also:
  • Constructor Details

    • ApiClientFactory

      public ApiClientFactory(String apiKey)
      Creates a new ApiClientFactory instance used to configure an authenticated TVDB client.
      Parameters:
      apiKey - the API key used to obtain the auth token
  • Method Details

    • authenticateDefaultClient

      public void authenticateDefaultClient() throws ApiException
      Authenticates and sets the default ApiClient configuration.
      Throws:
      ApiException - if an error occurred while obtaining the auth token
    • getAuthenticatedClient

      public ApiClient getAuthenticatedClient() throws ApiException
      Gets the authenticated ApiClient instance.
      Returns:
      the authenticated client instance
      Throws:
      ApiException - if an error occurred while obtaining the auth token
    • refreshAuthentication

      public ApiClient refreshAuthentication() throws ApiException
      Forces (re)authentication for the ApiClient.
      Returns:
      the authenticated client instance
      Throws:
      ApiException - if an error occurred while obtaining the auth token