|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.tuneology.avm.FreeDb
An API for the FreeDb song database.
This API is single threaded; if you want to use it in a multithreaded program, create an instance of the FreeDb object for each thread.
| Inner Class Summary | |
static class |
FreeDb.Site
A class to represent a FreeDb server site. |
| Constructor Summary | |
FreeDb(java.lang.String host,
int port,
java.lang.String appName,
java.lang.String version,
java.lang.String url,
java.lang.String encoding,
boolean useHttp,
java.lang.String proxyHost,
int proxyPort)
Create a FreeDb object, ready to make queries. |
|
| Method Summary | |
void |
close()
|
void |
get(java.lang.String categStr,
DiscInfo ent)
Fills in information about the album, given its discid key, |
java.lang.String[] |
getCateg(java.lang.String trackStr)
Returns a list of the possible entries for the disc. |
static java.lang.String |
getDefaultFreedbHost()
|
static java.lang.String |
getDefaultFreedbUrl()
|
static java.lang.String |
getHexId(int discId)
Translated a discid value from an integer to an 8-digit hex number . |
java.lang.String |
getLogOutput()
Returns the latest query and the result returned. |
java.lang.String |
getMotd()
Returns the server's message of the day. |
static java.lang.String |
getSepChar(DiscInfo tracks)
Returns a good guess for the character that separates the artist from the title in the information received from freedb regarding multi-artist CDs. |
FreeDb.Site[] |
getServers()
Returns a list of available servers. |
java.lang.String |
getServerStatus()
Returns the server's status. |
java.lang.String |
getServerVersion()
Returns the server's version information. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FreeDb(java.lang.String host,
int port,
java.lang.String appName,
java.lang.String version,
java.lang.String url,
java.lang.String encoding,
boolean useHttp,
java.lang.String proxyHost,
int proxyPort)
host - The hostname of the freedb server. If null, uses "freedb.freedb.org"port - The port number to use, or the default port if -1 is specified. The default port for
http service is 80, and the default port for TCP service is 8880.appName - The name of the application.version - The version of the application.url - The URL to use for the request. If null, uses "/~cddb/cddb.cgi".encoding - The name of the character encoding to use when
translating characters in FreeDb responses. If null, the default encoding is used.useHttp - If true, uses the http service. If false, uses the TCP service.proxyHost - The http proxy host (optional).proxyPort - The http proxy port number.| Method Detail |
public static java.lang.String getHexId(int discId)
discId - the integer value.
public java.lang.String[] getCateg(java.lang.String trackStr)
throws java.io.IOException,
java.lang.InterruptedException,
FreeDbException
trackStr - The list of tracks, formatted as required for freedb.java.io.IOException - if there is an error reading from the network.java.lang.InterruptedException - if the thread is interrupted.FreeDbException - if an error is returned by FreeDb.
public FreeDb.Site[] getServers()
throws java.io.IOException,
java.lang.InterruptedException,
FreeDbException
java.io.IOException - if there is an error reading from the network.java.lang.InterruptedException - if the thread is interrupted.FreeDbException - if an error is returned by FreeDb.
public void get(java.lang.String categStr,
DiscInfo ent)
throws java.io.IOException,
java.lang.InterruptedException,
FreeDbException
categ - the category string.ent - the entry to fill in.java.io.IOException - if there is an error reading from the network.java.lang.InterruptedException - if the thread is interrupted.FreeDbException - if an error is returned by FreeDb.
public java.lang.String getMotd()
throws java.lang.Exception
java.lang.Exception -
public java.lang.String getServerStatus()
throws java.lang.Exception
java.lang.Exception -
public java.lang.String getServerVersion()
throws java.lang.Exception
java.lang.Exception - public static java.lang.String getSepChar(DiscInfo tracks)
tracks - the array of tracks.public java.lang.String getLogOutput()
public static java.lang.String getDefaultFreedbHost()
public static java.lang.String getDefaultFreedbUrl()
public void close()
throws java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||