public class Configuration
extends java.lang.Object
API KeyAPI SecretsetCredentialDataStore(fm.audiobox.core.store.CredentialDataStore)setCredentialRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener)HTTP TransportJSON FactoryConfigurationException.
TIP: Setter methods of this class are chainable.| Modifier and Type | Class and Description |
|---|---|
static class |
Configuration.Channels
AudioBox channels
|
static class |
Configuration.Env
AudioBox environments.
|
| Constructor and Description |
|---|
Configuration()
Initiates a new Configuration ready for production.
|
Configuration(Configuration.Env environment)
Initiates a new Configuration.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkConfiguration()
Check configuration.
|
java.lang.Class<? extends Albums> |
getAlbumsWrapperClass()
Gets the albums wrapper class.
|
java.lang.String |
getApiKey()
Gets the API Consumer Key.
|
java.lang.String |
getApiSecret()
Gets the API Consumer Secret.
|
java.lang.String |
getApplicationName()
Gets the application name.
|
java.lang.Class<? extends Artists> |
getArtistsWrapperClass()
Gets the artists wrapper class.
|
java.lang.String |
getBaseUrl()
Gets API base url.
|
java.lang.String |
getBaseUrl(Configuration.Channels channel)
Gets env base url based on the queried channel.
|
java.lang.String |
getBaseUrl(Configuration.Channels channel,
boolean secure)
Gets env base url based on the queried channel.
|
CredentialDataStore |
getCredentialDataStore()
Gets data store factory.
|
java.lang.String |
getEnvHost(Configuration.Channels channel)
Gets Env base hostname
|
Configuration.Env |
getEnvironment()
Gets the
environment. |
com.typesafe.config.Config |
getEnvironmentConfiguration(Configuration.Env environment)
Gets environment configuration.
|
com.google.api.client.http.GenericUrl |
getEnvTokenUrl()
Gets env token url.
|
ExceptionHandler |
getExceptionHandler()
Gets the configured
ExceptionHandler |
java.lang.Class<? extends Genres> |
getGenresWrapperClass()
Gets the genres wrapper class.
|
com.google.api.client.http.HttpTransport |
getHttpTransport()
Gets HTTP transport.
|
com.google.api.client.json.JsonFactory |
getJsonFactory()
Gets JSON factory.
|
java.lang.Class<MediaFiles> |
getMediaFilesWrapperClass()
Gets the media files wrapper class.
|
java.lang.Class<? extends MediaFileWrapper> |
getMediaFileWrapperClass()
Gets the media file class.
|
com.google.api.client.auth.oauth2.CredentialRefreshListener |
getRefreshListener()
Gets the credential refresh listener.
|
java.lang.String |
getUnsecureBaseUrl(Configuration.Channels channel)
Gets env base url based on the queried channel.
|
java.lang.String |
getUserAgent()
Gets the user agent.
|
java.lang.String |
getVersion()
Gets version.
|
Configuration |
setAlbumsWrapperClass(java.lang.Class<Albums> klass)
Sets the albums wrapper class.
|
Configuration |
setApiKey(java.lang.String apiKey)
Sets the API Consumer Key.
|
Configuration |
setApiSecret(java.lang.String apiSecret)
Sets the API Consumer Secret.
|
Configuration |
setApplicationName(java.lang.String applicationName)
Sets the application name.
|
Configuration |
setArtistsWrapperClass(java.lang.Class<Artists> klass)
Sets the artists wrapper class.
|
Configuration |
setCredentialDataStore(CredentialDataStore credentialDataStore)
Sets the data store factory.
|
Configuration |
setCredentialRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener)
Sets the credential refresh listener for the OAuth dance.
|
Configuration |
setEnvironment(Configuration.Env environment)
Deprecated.
|
void |
setExceptionHandler(ExceptionHandler handler)
Sets a custom
ExceptionHandler |
Configuration |
setGenresWrapperClass(java.lang.Class<Genres> klass)
Sets the genres wrapper class.
|
Configuration |
setHttpTransport(com.google.api.client.http.HttpTransport httpTransport)
Sets the HTTP transport.
|
Configuration |
setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
Sets the JSON factory.
|
Configuration |
setMediaFileClass(java.lang.Class<MediaFileWrapper> klass)
Sets the media file class.
|
Configuration |
setMediaFilesWrapperClass(java.lang.Class<MediaFiles> klass)
Sets the media files wrapper class.
|
Configuration |
setVersion(java.lang.String version)
Sets your application version.
|
public Configuration()
public Configuration(Configuration.Env environment)
environment - the to use.public Configuration setApiKey(java.lang.String apiKey)
apiKey - the API Consumer KeyConfigurationpublic Configuration setApiSecret(java.lang.String apiSecret)
apiSecret - the API Consumer SecretConfigurationpublic Configuration setHttpTransport(com.google.api.client.http.HttpTransport httpTransport)
httpTransport - the http transportConfigurationpublic Configuration setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
jsonFactory - the json factoryConfigurationpublic Configuration setCredentialDataStore(CredentialDataStore credentialDataStore)
com.google.api.client.util.store.AbstractDataStoreFactory.credentialDataStore - the data store factoryConfigurationpublic Configuration setCredentialRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener)
refreshListener - the CredentialRefreshListener to setConfigurationpublic Configuration setMediaFilesWrapperClass(java.lang.Class<MediaFiles> klass)
MediaFiles.klass - the class to use for media files parsing.Configurationpublic Configuration setAlbumsWrapperClass(java.lang.Class<Albums> klass)
Albums.klass - the class to use for albums parsing.Configurationpublic Configuration setGenresWrapperClass(java.lang.Class<Genres> klass)
Genres.klass - the class to use for genres parsing.Configurationpublic Configuration setArtistsWrapperClass(java.lang.Class<Artists> klass)
Artists.klass - the class to use for artists parsing.Configurationpublic Configuration setMediaFileClass(java.lang.Class<MediaFileWrapper> klass)
MediaFileWrapper.klass - the class to use for artists parsing.Configuration@Deprecated public Configuration setEnvironment(Configuration.Env environment)
Configurationpublic Configuration setApplicationName(java.lang.String applicationName)
applicationName - the application nameConfigurationpublic Configuration setVersion(java.lang.String version)
version - the version stringConfigurationpublic void setExceptionHandler(ExceptionHandler handler)
ExceptionHandlerhandler - the ExceptionHandler to use for next (and subsequent) request.public CredentialDataStore getCredentialDataStore()
public com.google.api.client.auth.oauth2.CredentialRefreshListener getRefreshListener()
CredentialRefreshListenerpublic com.typesafe.config.Config getEnvironmentConfiguration(Configuration.Env environment)
environment - the environmentpublic java.lang.String getBaseUrl()
public java.lang.String getBaseUrl(Configuration.Channels channel)
channel - the channel to querypublic java.lang.String getUnsecureBaseUrl(Configuration.Channels channel)
channel - the channel to querypublic java.lang.String getBaseUrl(Configuration.Channels channel, boolean secure)
channel - the channel to querysecure - whether to serve SSL protocol (if available for configured Environment) or not.public java.lang.String getEnvHost(Configuration.Channels channel)
channel - the channel to querypublic com.google.api.client.http.GenericUrl getEnvTokenUrl()
public java.lang.String getApiKey()
public java.lang.String getApiSecret()
public Configuration.Env getEnvironment()
environment.public com.google.api.client.http.HttpTransport getHttpTransport()
public com.google.api.client.json.JsonFactory getJsonFactory()
public java.lang.Class<MediaFiles> getMediaFilesWrapperClass()
public java.lang.Class<? extends MediaFileWrapper> getMediaFileWrapperClass()
public java.lang.Class<? extends Albums> getAlbumsWrapperClass()
public java.lang.Class<? extends Genres> getGenresWrapperClass()
public java.lang.Class<? extends Artists> getArtistsWrapperClass()
public java.lang.String getUserAgent()
public java.lang.String getApplicationName()
public java.lang.String getVersion()
public ExceptionHandler getExceptionHandler()
ExceptionHandlerExceptionHandlerpublic void checkConfiguration()
throws ConfigurationException
ConfigurationException - the configuration exception