net.dontdrinkandroot.lastfm.api.ws.fetcher
Class AbstractFetcher

java.lang.Object
  extended by net.dontdrinkandroot.lastfm.api.ws.fetcher.AbstractFetcher
All Implemented Interfaces:
Fetcher
Direct Known Subclasses:
DefaultFetcher

public abstract class AbstractFetcher
extends java.lang.Object
implements Fetcher


Field Summary
protected  java.net.URL baseUrl
          The base URL, needed if you want to proxy requests somewhere.
protected  javax.xml.parsers.DocumentBuilderFactory factory
           
protected  org.slf4j.Logger logger
           
 
Constructor Summary
AbstractFetcher()
           
 
Method Summary
protected  java.lang.String buildParameterString(java.util.Map<java.lang.String,java.lang.String> parameters)
           
protected  java.net.URL buildUrl(java.util.Map<java.lang.String,java.lang.String> parameters)
           
protected  java.net.HttpURLConnection openConnection(java.net.URL url)
           
protected  org.w3c.dom.Document parseDoc(java.io.InputStream is)
          Parse a Document from an XML InputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.dontdrinkandroot.lastfm.api.ws.fetcher.Fetcher
get, getWebRequestsPerSecond, post
 

Field Detail

baseUrl

protected java.net.URL baseUrl
The base URL, needed if you want to proxy requests somewhere.


logger

protected final org.slf4j.Logger logger

factory

protected final javax.xml.parsers.DocumentBuilderFactory factory
Constructor Detail

AbstractFetcher

public AbstractFetcher()
Method Detail

buildParameterString

protected java.lang.String buildParameterString(java.util.Map<java.lang.String,java.lang.String> parameters)

parseDoc

protected org.w3c.dom.Document parseDoc(java.io.InputStream is)
                                 throws LastfmWebServicesException
Parse a Document from an XML InputStream.

Parameters:
is - The InputStream to unmarshall.
Returns:
The Document that was parsed.
Throws:
LastfmWebServicesException - Thrown if reading the document fails.

buildUrl

protected java.net.URL buildUrl(java.util.Map<java.lang.String,java.lang.String> parameters)

openConnection

protected java.net.HttpURLConnection openConnection(java.net.URL url)
                                             throws LastfmWebServicesException
Throws:
LastfmWebServicesException


Copyright © 2013 dontdrinkandroot. All Rights Reserved.