java.lang.Object | |
↳ | fm.audiobox.core.config.Configuration |
Through this class you can control several behavior of the client such as HTTP client or JSON parser libraries.
Here a list of mandatory fields that must be set in order to set up the client:API Key
API Secret
setCredentialDataStore(fm.audiobox.core.store.CredentialDataStore)
setCredentialRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener)
HTTP Transport
JSON Factory
ConfigurationException
.
TIP: Setter methods of this class are chainable.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
enum | Configuration.Channels | AudioBox channels | |||||||||
enum | Configuration.Env | AudioBox environments. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Configuration()
Initiates a new Configuration ready for production.
| |||||||||||
Configuration(Configuration.Env environment)
Initiates a new Configuration.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
checkConfiguration()
Check configuration.
| ||||||||||
Class<? extends Albums> |
getAlbumsWrapperClass()
Gets the albums wrapper class.
| ||||||||||
String |
getApiKey()
Gets the API Consumer Key.
| ||||||||||
String |
getApiSecret()
Gets the API Consumer Secret.
| ||||||||||
String |
getApplicationName()
Gets the application name.
| ||||||||||
Class<? extends Artists> |
getArtistsWrapperClass()
Gets the artists wrapper class.
| ||||||||||
String |
getBaseUrl(Configuration.Channels channel, boolean secure)
Gets env base url based on the queried channel.
| ||||||||||
String |
getBaseUrl(Configuration.Channels channel)
Gets env base url based on the queried channel.
| ||||||||||
String |
getBaseUrl()
Gets API base url.
| ||||||||||
CredentialDataStore |
getCredentialDataStore()
Gets data store factory.
| ||||||||||
String |
getEnvHost(Configuration.Channels channel)
Gets Env base hostname
| ||||||||||
GenericUrl |
getEnvTokenUrl()
Gets env token url.
| ||||||||||
Configuration.Env |
getEnvironment()
Gets the
environment . | ||||||||||
Config |
getEnvironmentConfiguration(Configuration.Env environment)
Gets environment configuration.
| ||||||||||
synchronized ExceptionHandler |
getExceptionHandler()
Gets the configured
ExceptionHandler | ||||||||||
Class<? extends Genres> |
getGenresWrapperClass()
Gets the genres wrapper class.
| ||||||||||
HttpTransport |
getHttpTransport()
Gets HTTP transport.
| ||||||||||
JsonFactory |
getJsonFactory()
Gets JSON factory.
| ||||||||||
Class<? extends MediaFileWrapper> |
getMediaFileWrapperClass()
Gets the media file class.
| ||||||||||
Class<MediaFiles> |
getMediaFilesWrapperClass()
Gets the media files wrapper class.
| ||||||||||
CredentialRefreshListener |
getRefreshListener()
Gets the credential refresh listener.
| ||||||||||
String |
getUnsecureBaseUrl(Configuration.Channels channel)
Gets env base url based on the queried channel.
| ||||||||||
String |
getUserAgent()
Gets the user agent.
| ||||||||||
String |
getVersion()
Gets version.
| ||||||||||
Configuration |
setAlbumsWrapperClass(Class<Albums> klass)
Sets the albums wrapper class.
| ||||||||||
Configuration |
setApiKey(String apiKey)
Sets the API Consumer Key.
| ||||||||||
Configuration |
setApiSecret(String apiSecret)
Sets the API Consumer Secret.
| ||||||||||
Configuration |
setApplicationName(String applicationName)
Sets the application name.
| ||||||||||
Configuration |
setArtistsWrapperClass(Class<Artists> klass)
Sets the artists wrapper class.
| ||||||||||
Configuration |
setCredentialDataStore(CredentialDataStore credentialDataStore)
Sets the data store factory.
| ||||||||||
Configuration |
setCredentialRefreshListener(CredentialRefreshListener refreshListener)
Sets the credential refresh listener for the OAuth dance.
| ||||||||||
Configuration |
setEnvironment(Configuration.Env environment)
Changes the AudioBox environment (only useful in API development mode).
| ||||||||||
synchronized void |
setExceptionHandler(ExceptionHandler handler)
Sets a custom
ExceptionHandler | ||||||||||
Configuration |
setGenresWrapperClass(Class<Genres> klass)
Sets the genres wrapper class.
| ||||||||||
Configuration |
setHttpTransport(HttpTransport httpTransport)
Sets the HTTP transport.
| ||||||||||
Configuration |
setJsonFactory(JsonFactory jsonFactory)
Sets the JSON factory.
| ||||||||||
Configuration |
setMediaFileClass(Class<MediaFileWrapper> klass)
Sets the media file class.
| ||||||||||
Configuration |
setMediaFilesWrapperClass(Class<MediaFiles> klass)
Sets the media files wrapper class.
| ||||||||||
Configuration |
setVersion(String version)
Sets your application version.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Initiates a new Configuration ready for production.
Initiates a new Configuration.
environment | the to use. |
---|
Check configuration.
ConfigurationException | the configuration exception |
---|
Gets the albums wrapper class.
Gets the API Consumer Key.
Gets the API Consumer Secret.
Gets the application name.
Gets the artists wrapper class.
Gets env base url based on the queried channel.
channel | the channel to query |
---|---|
secure | whether to serve SSL protocol (if available for configured Environment) or not. |
Gets env base url based on the queried channel.
channel | the channel to query |
---|
Gets API base url.
Gets data store factory.
Gets Env base hostname
channel | the channel to query |
---|
Gets env token url.
Gets environment configuration.
environment | the environment |
---|
Gets the configured ExceptionHandler
ExceptionHandler
Gets the genres wrapper class.
Gets HTTP transport.
Gets JSON factory.
Gets the media file class.
Gets the media files wrapper class.
Gets the credential refresh listener.
Gets env base url based on the queried channel.
channel | the channel to query |
---|
Gets the user agent.
Gets version.
Sets the albums wrapper class.
Use this configuration method to set your own class to use as albums parser. Default isAlbums
.klass | the class to use for albums parsing. |
---|
Configuration
Sets the API Consumer Key.
To get one register your application here: https://audiobox.fm/oauth2/applicationsapiKey | the API Consumer Key |
---|
Configuration
Sets the API Consumer Secret.
To get one register your application here: https://audiobox.fm/oauth2/applicationsapiSecret | the API Consumer Secret |
---|
Configuration
Sets the application name.
applicationName | the application name |
---|
Configuration
Sets the artists wrapper class.
Use this configuration method to set your own class to use as artists parser. Default isArtists
.klass | the class to use for artists parsing. |
---|
Configuration
Sets the data store factory.
You should provide one like FileDataStoreFactory, MemoryDataStoreFactory or implementing one by extending the com.google.api.client.util.store.AbstractDataStoreFactory.credentialDataStore | the data store factory |
---|
Configuration
Sets the credential refresh listener for the OAuth dance.
refreshListener | the com.google.api.client.auth.oauth2.CredentialRefreshListener to set |
---|
Configuration
Changes the AudioBox environment (only useful in API development mode).
Do not use this method if you are working on a production application.Configuration
Sets a custom ExceptionHandler
handler | the ExceptionHandler to use for next (and subsequent) request. |
---|
Sets the genres wrapper class.
Use this configuration method to set your own class to use as genres parser. Default isGenres
.klass | the class to use for genres parsing. |
---|
Configuration
Sets the HTTP transport.
Should be one of:httpTransport | the http transport |
---|
Configuration
Sets the JSON factory.
Should be one of:jsonFactory | the json factory |
---|
Configuration
Sets the media file class.
Use this configuration method to set your own class to use for media file parsing. Default isMediaFileWrapper
.klass | the class to use for artists parsing. |
---|
Configuration
Sets the media files wrapper class.
Use this configuration method to set your own class to use as media files parser. Default isMediaFiles
.klass | the class to use for media files parsing. |
---|
Configuration