org.stanwood.media.source
Interface ISource

All Superinterfaces:
IExtension
All Known Implementing Classes:
HybridFilmSource, TagChimpSource, XBMCSource

public interface ISource
extends IExtension

This interfaces should be implemented by classes used to retrive information from a source.


Method Summary
 IEpisode getEpisode(ISeason season, int episodeNum, java.io.File file)
          Called to retrieve the information on a episode
 IFilm getFilm(java.lang.String filmId, java.net.URL url, java.io.File filmFile)
          This will get a film from the source.
 ExtensionInfo<? extends ISource> getInfo()
          Used to get the source information details
 java.lang.String getParameter(java.lang.String key)
          Used to get the value of a source parameter.
 ISeason getSeason(IShow show, int seasonNum)
          This will get a season from the source.
 IShow getShow(java.lang.String showId, java.net.URL url, java.io.File file)
          This will get a show from the source.
 IEpisode getSpecial(ISeason season, int specialNumber, java.io.File file)
          This gets a special episode from the source.
 SearchResult searchMedia(java.lang.String name, java.lang.String year, Mode mode, java.lang.Integer part)
          This is called to search the source for media details
 void setMediaDirConfig(MediaDirectory dir)
          Called to tell the source which media directory is been processed
 void setParameter(java.lang.String key, java.lang.String value)
          Used to set source parameters.
 

Method Detail

getEpisode

IEpisode getEpisode(ISeason season,
                    int episodeNum,
                    java.io.File file)
                    throws SourceException,
                           java.net.MalformedURLException,
                           java.io.IOException
Called to retrieve the information on a episode

Parameters:
season - The season the episode belongs too
episodeNum - The number of the episode
file - The special file if looking up a files details, or NULL
Returns:
The episode
Throws:
SourceException - Thrown if their is a problem retrieving the data
java.net.MalformedURLException - Thrown if their is a problem creating URL's
java.io.IOException - Throw if their is a IO related problem

getSeason

ISeason getSeason(IShow show,
                  int seasonNum)
                  throws SourceException,
                         java.io.IOException
This will get a season from the source. If the season can't be found, then it will return null.

Parameters:
show - The show the season belongs too
seasonNum - The number of the season that is to be fetched
Returns:
The season if it can be found, otherwise null.
Throws:
SourceException - Thrown if their is a problem retrieving the data
java.io.IOException - Thrown if their is a I/O related problem.

getShow

IShow getShow(java.lang.String showId,
              java.net.URL url,
              java.io.File file)
              throws SourceException,
                     java.net.MalformedURLException,
                     java.io.IOException
This will get a show from the source. If the show can't be found, then it will return null.

Parameters:
showId - The id of the show to get.
url - String url of the show
file - The media file if looking up a files details, or NULL
Returns:
The show if it can be found, otherwise null.
Throws:
SourceException - Thrown if their is a problem retrieving the data
java.net.MalformedURLException - Thrown if their is a problem creating URL's
java.io.IOException - Thrown if their is a I/O related problem.

getFilm

IFilm getFilm(java.lang.String filmId,
              java.net.URL url,
              java.io.File filmFile)
              throws SourceException,
                     java.net.MalformedURLException,
                     java.io.IOException
This will get a film from the source. If the film can't be found, then it will return null.

Parameters:
filmId - The id of the film
url - The URL used to lookup the film
filmFile - The film file if looking up a files details, or NULL
Returns:
The film, or null if it can't be found
Throws:
SourceException - Thrown if their is a problem retrieving the data
java.net.MalformedURLException - Thrown if their is a problem creating URL's
java.io.IOException - Thrown if their is a I/O related problem.

getSpecial

IEpisode getSpecial(ISeason season,
                    int specialNumber,
                    java.io.File file)
                    throws SourceException,
                           java.net.MalformedURLException,
                           java.io.IOException
This gets a special episode from the source. If it can't be found, then it will return null;

Parameters:
season - The season the special episode belongs too
specialNumber - The number of the special episode too get
file - The special file if looking up a files details, or NULL
Returns:
The special episode, or null if it can't be found
Throws:
SourceException - Thrown if their is a problem retrieving the data
java.net.MalformedURLException - Thrown if their is a problem creating URL's
java.io.IOException - Thrown if their is a I/O related problem.

setParameter

void setParameter(java.lang.String key,
                  java.lang.String value)
                  throws SourceException

Used to set source parameters. If the key is not supported by this source, then a SourceException is thrown.

Parameters:
key - The key of the parameter
value - The value of the parameter
Throws:
SourceException - Throw if the key is not supported by this source.

getParameter

java.lang.String getParameter(java.lang.String key)
                              throws SourceException

Used to get the value of a source parameter. If the key is not supported by this source, then a SourceException is thrown.

Parameters:
key - The key of the parameter
Returns:
The value of the parameter
Throws:
SourceException - Throw if the key is not supported by this source.

setMediaDirConfig

void setMediaDirConfig(MediaDirectory dir)
                       throws SourceException
Called to tell the source which media directory is been processed

Parameters:
dir - The media directory
Throws:
SourceException - Thrown if their is a problem with the source

searchMedia

SearchResult searchMedia(java.lang.String name,
                         java.lang.String year,
                         Mode mode,
                         java.lang.Integer part)
                         throws SourceException
This is called to search the source for media details

Parameters:
name - The search term
year - The year to search for or empty string if not needed
mode - The mode of the search
part - The part number to search for
Returns:
The search result or NULL if it could not be found
Throws:
SourceException - Thrown if their is a problem with the source

getInfo

ExtensionInfo<? extends ISource> getInfo()
Used to get the source information details

Returns:
the source information details