|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.ambient.collection.ampache.AmpacheClient
@ThreadSafe public final class AmpacheClient
Contains utility methods to communicate with Ampache.
| Nested Class Summary | |
|---|---|
protected static class |
AmpacheClient.ErrorHandlingHandler
Superclass for all handlers handling Ampache output. |
| Field Summary | |
|---|---|
java.lang.String |
serverURL
Holds the server URL. |
| Constructor Summary | |
|---|---|
AmpacheClient(java.lang.String serverURL)
Creates new object instance. |
|
| Method Summary | |
|---|---|
static java.lang.String |
computePassphrase(java.lang.String password,
java.lang.String time)
Computes Ampache passphrase for given time and password. |
AmpacheInfo |
connect(java.lang.String user,
java.lang.String password)
Connects to the Ampache server. |
java.util.List<CategoryItem> |
getAlbums(java.lang.String substring)
Returns albums from Ampache. |
java.util.List<TrackMetadataBean> |
getAlbumSongs(java.lang.String albumId)
Returns tracks for given album. |
java.util.List<CategoryItem> |
getArtistAlbums(java.lang.String artistId,
java.lang.String substring)
Returns albums for given artist. |
java.util.List<CategoryItem> |
getArtists(java.lang.String substring)
Returns artists from Ampache. |
java.util.List<TrackMetadataBean> |
getArtistSongs(java.lang.String artistId)
Returns songs for given artist. |
java.util.List<CategoryItem> |
getGenreAlbums(java.lang.String genreId,
java.lang.String substring)
Returns albums for given genre. |
java.util.List<CategoryItem> |
getGenreArtists(java.lang.String genreId,
java.lang.String substring)
Returns artists for given genre. |
java.util.List<CategoryItem> |
getGenres(java.lang.String substring)
Returns albums from Ampache. |
java.util.List<TrackMetadataBean> |
getGenreSongs(java.lang.String genreId)
Returns songs for given genre. |
AmpacheInfo |
getInfo()
Returns server information. |
java.util.List<TrackMetadataBean> |
searchTracks(java.lang.String substring)
Search song which Song Title, Artist Name, Album Name or Genre Name contains given substring. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String serverURL
| Constructor Detail |
|---|
public AmpacheClient(java.lang.String serverURL)
serverURL - the URL where Ampache is running, for example
http://localhost/ampache. The object will
automatically add /server/xml.server.php to the
URL.| Method Detail |
|---|
public AmpacheInfo connect(java.lang.String user,
java.lang.String password)
throws AmpacheException,
java.io.IOException,
org.xml.sax.SAXException
user - optional userpassword - required password.
AmpacheException - if Ampache rejects to process the request.
java.io.IOException - if i/o error occurs.
org.xml.sax.SAXException
public static java.lang.String computePassphrase(java.lang.String password,
java.lang.String time)
password - the passwordtime - the time
public AmpacheInfo getInfo()
null if not connected.
public java.util.List<CategoryItem> getArtists(java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<TrackMetadataBean> getArtistSongs(java.lang.String artistId)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
artistId - the artist ID.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<CategoryItem> getArtistAlbums(java.lang.String artistId,
java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
artistId - the artist ID.substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<CategoryItem> getAlbums(java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<TrackMetadataBean> getAlbumSongs(java.lang.String albumId)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
albumId - the album ID.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<CategoryItem> getGenres(java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<CategoryItem> getGenreArtists(java.lang.String genreId,
java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
genreId - the genre id.substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<CategoryItem> getGenreAlbums(java.lang.String genreId,
java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
genreId - the genre id.substring - optional substring which the album name must contain.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<TrackMetadataBean> getGenreSongs(java.lang.String genreId)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
genreId - the genre id.
AmpacheException
org.xml.sax.SAXException
java.io.IOException
public java.util.List<TrackMetadataBean> searchTracks(java.lang.String substring)
throws java.io.IOException,
org.xml.sax.SAXException,
AmpacheException
substring - the substring to search for.
null, may be empty.
Sorted in no particular order.
java.io.IOException
org.xml.sax.SAXException
AmpacheException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||