Class AcousticBrainz
- java.lang.Object
-
- com.tagtraum.core.WebService
-
- com.tagtraum.ubermusic.acousticbrainz.AcousticBrainz
-
- All Implemented Interfaces:
UberMusic
public class AcousticBrainz extends WebService implements UberMusic
Web service implementing the
UberMusic
interface to download high level data from AcousticBrainz.The service may use a secondary
UberMusic
service to look up the necessary track MBID (seeaddMbidLookupService(UberMusic)
).- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from class com.tagtraum.core.WebService
HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT
-
-
Constructor Summary
Constructors Constructor Description AcousticBrainz()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMbidLookupService(UberMusic mbidLookupService)
Adds anUberMusic
service that is used to look up missing mbids.List<UberMusic>
getMbidLookupServices()
Service used to look up mbids.List<AudioSong>
lookup(AudioSong song)
Looks up metadata for a song.List<AudioSong>
lookup(String mbid)
-
Methods inherited from class com.tagtraum.core.WebService
cacheResource, clearCache, getCache, getConnectTimeOut, getDomFactory, getJSONArray, getJSONArray, getJSONObject, getJSONObject, getJSONObjectWithPayload, getMaxAge, getReadTimeOut, getRequestDelay, getSSLSocketFactory, getUserAgent, getXmlDocument, getXmlObject, handleStatusCode, isAcceptGzipContentEncoding, openConnection, openConnection, openInputStream, readURL, setAcceptGzipContentEncoding, setCache, setConnectTimeOut, setDomFactory, setMaxAge, setNextAllowedConnection, setReadTimeOut, setRequestDelay, setSSLSocketFactory, setUserAgent, toParameterString, useCacheOnly, waitForTurn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.ubermusic.UberMusic
getArtists, getSimilarArtists, lookup, lookup
-
-
-
-
Method Detail
-
getMbidLookupServices
public List<UberMusic> getMbidLookupServices()
Service used to look up mbids.- Returns:
- service
-
addMbidLookupService
public void addMbidLookupService(UberMusic mbidLookupService)
Adds anUberMusic
service that is used to look up missing mbids.- Parameters:
mbidLookupService
- mbid lookup service
-
lookup
public List<AudioSong> lookup(AudioSong song) throws IOException
Description copied from interface:UberMusic
Looks up metadata for a song.- Specified by:
lookup
in interfaceUberMusic
- Parameters:
song
- song (query by example)- Returns:
- reference songs, empty list, if the metadata is unavailable
- Throws:
IOException
- IOException
-
lookup
public List<AudioSong> lookup(String mbid) throws IOException
- Throws:
IOException
-
-