org.varienaja.util.coverart
Class AbstractCoverArtFinder

java.lang.Object
  extended by org.varienaja.util.coverart.AbstractCoverArtFinder
All Implemented Interfaces:
ICoverArtFinder
Direct Known Subclasses:
GoogleCoverArtFinder, YahooCoverArtFinder

public abstract class AbstractCoverArtFinder
extends java.lang.Object
implements ICoverArtFinder

Author:
Varienaja

Constructor Summary
AbstractCoverArtFinder()
           
 
Method Summary
abstract  java.net.URI constructSearchURI(java.lang.String band, java.lang.String albumtitle)
          Gets the URI to call, in order to search for Covers from a certain Album of a Band.
 java.util.List<CoverArtSearchResult> findCoverURLs(java.lang.String band, java.lang.String albumtitle)
          Searches one or multiple sources for CovereArt-images.
protected abstract  org.apache.log4j.Logger getLogger()
           
abstract  java.util.List<CoverArtSearchResult> procesSearchResult(java.io.InputStreamReader in)
          Processes the InputStream of the URI from constructSearchURI(), and extracts a list of CoverArtSearchResult objects from it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCoverArtFinder

public AbstractCoverArtFinder()
Method Detail

getLogger

protected abstract org.apache.log4j.Logger getLogger()
Returns:
A Logger to write log-statements to.

constructSearchURI

public abstract java.net.URI constructSearchURI(java.lang.String band,
                                                java.lang.String albumtitle)
                                         throws java.net.URISyntaxException
Gets the URI to call, in order to search for Covers from a certain Album of a Band.

Parameters:
band - The name of the Band.
albumtitle - The name of the Album.
Returns:
An URI.
Throws:
java.net.URISyntaxException - If both a scheme and a path are given but the path is relative, if the URI string constructed from the given components violates RFC 2396, or if the authority component of the string is present but cannot be parsed as a server-based authority.

procesSearchResult

public abstract java.util.List<CoverArtSearchResult> procesSearchResult(java.io.InputStreamReader in)
                                                                 throws java.io.IOException
Processes the InputStream of the URI from constructSearchURI(), and extracts a list of CoverArtSearchResult objects from it.

Parameters:
in - The InputStream
Returns:
A non-null List of CoverArtSearchResult objects.
Throws:
java.io.IOException - If an I/O error occurs.

findCoverURLs

public java.util.List<CoverArtSearchResult> findCoverURLs(java.lang.String band,
                                                          java.lang.String albumtitle)
Description copied from interface: ICoverArtFinder
Searches one or multiple sources for CovereArt-images.

Specified by:
findCoverURLs in interface ICoverArtFinder
Parameters:
band - The bandname to search for.
albumtitle - The albumtitle tot search for
Returns:
A non-null, sorted Collection of CoverArtSearchResult objects


Copyright © 2010 A.J.V.. All Rights Reserved.