|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.ambient.collection.ampache.AmpacheClient
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 | |
|---|---|
String |
serverURL
Holds the server URL. |
| Constructor Summary | |
|---|---|
AmpacheClient(String serverURL)
Creates new object instance. |
|
| Method Summary | |
|---|---|
static String |
computePassphrase(String password,
String time)
Computes Ampache passphrase for given time and password. |
AmpacheInfo |
connect(String user,
String password)
Connects to the Ampache server. |
List<CategoryItem> |
getAlbums(String substring)
Returns albums from Ampache. |
List<TrackMetadataBean> |
getAlbumSongs(String albumId)
Returns tracks for given album. |
List<CategoryItem> |
getArtistAlbums(String artistId,
String substring)
Returns albums for given artist. |
List<CategoryItem> |
getArtists(String substring)
Returns artists from Ampache. |
List<TrackMetadataBean> |
getArtistSongs(String artistId)
Returns songs for given artist. |
List<CategoryItem> |
getGenreAlbums(String genreId,
String substring)
Returns albums for given genre. |
List<CategoryItem> |
getGenreArtists(String genreId,
String substring)
Returns artists for given genre. |
List<CategoryItem> |
getGenres(String substring)
Returns albums from Ampache. |
List<TrackMetadataBean> |
getGenreSongs(String genreId)
Returns songs for given genre. |
AmpacheInfo |
getInfo()
Returns server information. |
List<TrackMetadataBean> |
searchTracks(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 String serverURL
| Constructor Detail |
|---|
public AmpacheClient(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(String user,
String password)
throws AmpacheException,
IOException,
SAXException
user - optional userpassword - required password.
AmpacheException - if Ampache rejects to process the request.
IOException - if i/o error occurs.
SAXException
public static String computePassphrase(String password,
String time)
password - the passwordtime - the time
public AmpacheInfo getInfo()
null if not connected.
public List<CategoryItem> getArtists(String substring)
throws IOException,
SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<TrackMetadataBean> getArtistSongs(String artistId)
throws IOException,
SAXException,
AmpacheException
artistId - the artist ID.
AmpacheException
SAXException
IOException
public List<CategoryItem> getArtistAlbums(String artistId,
String substring)
throws IOException,
SAXException,
AmpacheException
artistId - the artist ID.substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<CategoryItem> getAlbums(String substring)
throws IOException,
SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<TrackMetadataBean> getAlbumSongs(String albumId)
throws IOException,
SAXException,
AmpacheException
albumId - the album ID.
AmpacheException
SAXException
IOException
public List<CategoryItem> getGenres(String substring)
throws IOException,
SAXException,
AmpacheException
substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<CategoryItem> getGenreArtists(String genreId,
String substring)
throws IOException,
SAXException,
AmpacheException
genreId - the genre id.substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<CategoryItem> getGenreAlbums(String genreId,
String substring)
throws IOException,
SAXException,
AmpacheException
genreId - the genre id.substring - optional substring which the album name must contain.
AmpacheException
SAXException
IOException
public List<TrackMetadataBean> getGenreSongs(String genreId)
throws IOException,
SAXException,
AmpacheException
genreId - the genre id.
AmpacheException
SAXException
IOException
public List<TrackMetadataBean> searchTracks(String substring)
throws IOException,
SAXException,
AmpacheException
substring - the substring to search for.
null, may be empty.
Sorted in no particular order.
IOException
SAXException
AmpacheException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||