public interface Connection
Modifier and Type | Method and Description |
---|---|
SubsonicResponse |
createPlaylist(java.util.List<java.lang.String> songsList,
java.lang.String name)
Creates a new playlist with the specified songs list and name
|
SubsonicResponse |
deletePlaylist(java.lang.String playlistId)
Deletes the specified playlist
|
java.io.InputStream |
download(java.lang.String uniqueId)
Gets a stream of an element (directory or song) to be downloaded.
|
GetAlbumsResponse |
getAlbumsList(GetAlbumsType type)
Gets a list of 10 albums of the specified type
|
GetAlbumsResponse |
getAlbumsList(GetAlbumsType type,
int size)
Gets the defined number of albums of the specified type
|
GetAlbumsResponse |
getAlbumsList(GetAlbumsType type,
int size,
int offset)
Gets the defined number of albums of the specified type
|
java.awt.image.BufferedImage |
getCoverArt(java.lang.String coverId)
Returns a cover art specified by the provided ID and a size of 100x100 pixels
|
java.awt.image.BufferedImage |
getCoverArt(java.lang.String coverArt,
int size)
Returns a cover art defined by the provided ID and a specified size
|
GetIndexesResponse |
getIndexes()
Gets a list of all the directories (indexes) in the root of all music folders
|
GetIndexesResponse |
getIndexes(long modifiedSince)
Gets a list of all the directories (indexes) in the root of all music folders that has been modified after the specified timestamp
|
GetIndexesResponse |
getIndexes(java.lang.String musicFolderId)
Gets a list of all the directories (indexes) in the root of the specified music folder
|
GetIndexesResponse |
getIndexes(java.lang.String musicFolderId,
long modifiedSince)
Gets a list of all the directories (indexes) in the root of the specified music folder that has been modified after the specified timestamp
|
GetLicenseResponse |
getLicense()
Gets detailed information about current server license
|
GetMusicDirectoryResponse |
getMusicDirectory(java.lang.String uniqueFolderId)
Returns all the albums and songs in specified directory
|
GetMusicFoldersResponse |
getMusicFolders()
Gets the available music folders list
|
GetPlaylistResponse |
getPlaylist(java.lang.String playlistId)
Gets information about a specific playlist including songs list on that playlist
|
GetPlaylistsResponse |
getPlaylists()
Gets the playlists available for the current user
|
GetPodcastResponse |
getPodcastEpisodes(java.lang.String podcastId)
Gets the episodes of the specified podcast
|
GetPodcastsResponse |
getPodcasts()
Gets the list of podcasts in the server
|
GetRandomSongsResponse |
getRandomSongs()
Gets a list of 10 random songs in all music folders
|
GetRandomSongsResponse |
getRandomSongs(java.lang.String folderId)
Gets a list of 10 random songs in a specific music folder
|
GetRandomSongsResponse |
getRandomSongs(java.lang.String folderId,
int size)
Gets a defined number of random songs in a specific music folder
|
java.lang.String |
getStreamURL(java.lang.String uniqueId)
Returns a valid URL for streaming a song from the current Subsonic server specified by its ID
|
java.lang.String |
getStreamURL(java.lang.String uniqueId,
int maxBitRate)
Returns a valid URL for streaming a song from the current Subsonic server specified by its ID
|
boolean |
ping()
Checks connectivity with current Subsonic server.
|
SearchResponse |
search(java.lang.String query)
Gets a list of max 20 artists, albums and songs that meet the specified query.
|
SearchResponse |
search(java.lang.String query,
int count)
Gets the specified number of artists, albums and songs that meet the specified query.
|
SearchResponse |
search(java.lang.String query,
int count,
int offset)
Gets the specified number of artists, albums and songs that meet the specified query.
|
SubsonicResponse |
setRating(AlbumRating rating)
Sets an album rating
|
java.io.InputStream |
stream(java.lang.String uniqueId)
Gets the stream of a song to be played.
|
java.io.InputStream |
stream(java.lang.String uniqueId,
int maxBitRate)
Gets the stream of a song to be played.
|
boolean ping()
GetLicenseResponse getLicense() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
GetLicenseResponse
object with the server license informationSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetMusicFoldersResponse getMusicFolders() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
GetMusicFoldersResponse
object with the folders listSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetIndexesResponse getIndexes() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
GetIndexesResponse
object with the indexes listSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetIndexesResponse getIndexes(java.lang.String musicFolderId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
musicFolderId
- Id of the music folder to be listedGetIndexesResponse
object with the indexes listSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetIndexesResponse getIndexes(long modifiedSince) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
modifiedSince
- Timestamp in millisecondsGetIndexesResponse
object with the indexes listSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetIndexesResponse getIndexes(java.lang.String musicFolderId, long modifiedSince) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
musicFolderId
- Id of the music folder to be listedmodifiedSince
- Timestamp in millisecondsGetIndexesResponse
object with the indexes listSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetMusicDirectoryResponse getMusicDirectory(java.lang.String uniqueFolderId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
uniqueFolderId
- ID of the directory to be listedGetMusicDirectoryResponse
object with the albums and songsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200SearchResponse search(java.lang.String query) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
query
- Search criterionSearchResponse
object with the artists, albums and songsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200SearchResponse search(java.lang.String query, int count) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
query
- Search criterioncount
- Max number of artists, albums and songs to returnSearchResponse
object with the artists, albums and songsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200SearchResponse search(java.lang.String query, int count, int offset) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
query
- Search criterioncount
- Max number of artists, albums and songs to returnoffset
- Index to start returning results. For pagination purposesSearchResponse
object with the artists, albums and songsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetPlaylistsResponse getPlaylists() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
GetPlaylistsResponse
object with the playlists availableSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetPlaylistResponse getPlaylist(java.lang.String playlistId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, javax.xml.ws.http.HTTPException
playlistId
- ID of the playlist to be returnedGetPlaylistResponse
object with information about the specified playlistSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200SubsonicResponse createPlaylist(java.util.List<java.lang.String> songsList, java.lang.String name) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
songsList
- List of IDs of songs that will form the playlistname
- Name to be asigned to the playlistSubsonicResponse
objectSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200SubsonicResponse deletePlaylist(java.lang.String playlistId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
playlistId
- ID of the playlist to be deletedSubsonicResponse
objectSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetAlbumsResponse getAlbumsList(GetAlbumsType type) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
type
- Type of the albums to be returned. Valid types are defined in GetAlbumsType
GetAlbumsResponse
object with the list of albumsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetAlbumsType
GetAlbumsResponse getAlbumsList(GetAlbumsType type, int size) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
type
- Type of the albums to be returned. Valid types are defined in GetAlbumsType
size
- Number of albums to returnGetAlbumsResponse
object with the list of albumsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetAlbumsResponse getAlbumsList(GetAlbumsType type, int size, int offset) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
type
- Type of the albums to be returned. Valid types are defined in GetAlbumsType
size
- Number of albums to returnoffset
- Index to start returning results. For pagination purposesGetAlbumsResponse
object with the list of albumsSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetRandomSongsResponse getRandomSongs() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
GetRandomSongsResponse
object with the list of songsSubsonicException
- If a Subsonic error occurscom.google.gson.JsonSyntaxException
java.io.IOException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetRandomSongsResponse getRandomSongs(java.lang.String folderId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
folderId
- ID of the music folder used to get the songs listGetRandomSongsResponse
object with the list of songscom.google.gson.JsonSyntaxException
java.io.IOException
SubsonicException
- If a Subsonic error occursInvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetRandomSongsResponse getRandomSongs(java.lang.String folderId, int size) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
folderId
- ID of the music folder used to get the songs listsize
- Number of songs the be returnedGetRandomSongsResponse
object with the list of songscom.google.gson.JsonSyntaxException
java.io.IOException
SubsonicException
- If a Subsonic error occursInvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetPodcastsResponse getPodcasts() throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
GetPodcastsResponse
object with the list of channels the server is subscribedSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200GetPodcastResponse getPodcastEpisodes(java.lang.String podcastId) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
podcastId
- ID of the podcast channel whose episodes have to be returnedGetPodcastResponse
object with the list of episodes of the podcastSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200SubsonicResponse setRating(AlbumRating rating) throws com.google.gson.JsonSyntaxException, java.io.IOException, SubsonicException, InvalidResponseException, CompatibilityException, javax.xml.ws.http.HTTPException
rating
- AlbumRating object with the album id and the rating to be set to that albumSubsonicResponse
objectSubsonicException
- If a Subsonic error occursjava.io.IOException
com.google.gson.JsonSyntaxException
InvalidResponseException
- If the Subsonic servers returns a non parseable responseCompatibilityException
- If this method is not compatible with the current serverjavax.xml.ws.http.HTTPException
- If the server response code is other than 200AlbumRating
java.io.InputStream download(java.lang.String uniqueId) throws javax.xml.ws.http.HTTPException, java.io.IOException, InvalidResponseException
uniqueId
- ID of the element to be downloadedInvalidResponseException
- If the Subsonic servers returns a non parseable responsejava.io.IOException
javax.xml.ws.http.HTTPException
- If the server response code is other than 200java.io.InputStream stream(java.lang.String uniqueId) throws javax.xml.ws.http.HTTPException, java.io.IOException, InvalidResponseException
uniqueId
- ID of the song to be playedInvalidResponseException
- If the Subsonic servers returns a non parseable responsejava.io.IOException
javax.xml.ws.http.HTTPException
- If the server response code is other than 200java.io.InputStream stream(java.lang.String uniqueId, int maxBitRate) throws java.io.IOException, InvalidResponseException, javax.xml.ws.http.HTTPException
uniqueId
- ID of the song to be playedmaxBitRate
- Max bitrate of the streamjava.io.IOException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200java.lang.String getStreamURL(java.lang.String uniqueId)
uniqueId
- ID of the song to be playedjava.lang.String getStreamURL(java.lang.String uniqueId, int maxBitRate)
uniqueId
- ID of the song to be playedmaxBitRate
- Max bitrate of the streamjava.awt.image.BufferedImage getCoverArt(java.lang.String coverId) throws java.io.IOException, InvalidResponseException, javax.xml.ws.http.HTTPException
coverId
- ID of the cover art to be returnedjava.io.IOException
InvalidResponseException
- If Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200java.awt.image.BufferedImage getCoverArt(java.lang.String coverArt, int size) throws java.io.IOException, InvalidResponseException, javax.xml.ws.http.HTTPException
coverArt
- ID of the cover art to be returnedsize
- Size in pixels of the returned imagejava.io.IOException
InvalidResponseException
- If the Subsonic servers returns a non parseable responsejavax.xml.ws.http.HTTPException
- If the server response code is other than 200