public class DefaultFetcher extends AbstractFetcher implements Fetcher
baseUrl, factory, logger| Constructor and Description |
|---|
DefaultFetcher() |
| Modifier and Type | Method and Description |
|---|---|
protected LastfmResponse |
fetchResponse(HttpURLConnection conn) |
LastfmResponse |
get(Map<String,String> parameters)
Perform a get request to the Last.fm API.
|
double |
getWebRequestsPerSecond()
Get the current number of requests per second.
|
LastfmResponse |
post(Map<String,String> parameters)
Perform a post request to the Last.fm API.
|
buildParameterString, buildUrl, openConnection, parseDocpublic DefaultFetcher()
throws ParserConfigurationException
ParserConfigurationExceptionpublic LastfmResponse get(Map<String,String> parameters) throws LastfmWebServicesException
Fetcherget in interface Fetcherparameters - A Key/Value map of HTTP parameters.LastfmWebServicesException - Thrown on any fetching errors encountered.public LastfmResponse post(Map<String,String> parameters) throws LastfmWebServicesException
Fetcherpost in interface Fetcherparameters - A Key/Value map of HTTP parameters.LastfmWebServicesException - Thrown on any fetching errors encountered.public final double getWebRequestsPerSecond()
FetchergetWebRequestsPerSecond in interface Fetcherprotected LastfmResponse fetchResponse(HttpURLConnection conn) throws LastfmWebServicesException
LastfmWebServicesExceptionCopyright © 2013 dontdrinkandroot. All Rights Reserved.