@Deprecated public class Scrobbler extends Object
newScrobbler
.ResponseStatus
which contains
information if the operation was successful or not.proxy
property in the Caller
class in all its HTTP calls. If you need the
Scrobbler
to use a Proxy server, set it with Caller.setProxy(java.net.Proxy)
.Modifier and Type | Field and Description |
---|---|
private String |
clientId
Deprecated.
|
private String |
clientVersion
Deprecated.
|
private static String |
DEFAULT_HANDSHAKE_URL
Deprecated.
|
private String |
handshakeUrl
Deprecated.
|
private String |
nowPlayingUrl
Deprecated.
|
private String |
sessionId
Deprecated.
|
private String |
submissionUrl
Deprecated.
|
private String |
user
Deprecated.
|
Modifier | Constructor and Description |
---|---|
private |
Scrobbler(String clientId,
String clientVersion,
String user)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ResponseStatus |
handshake(Session session)
Deprecated.
Performs a web-service handshake.
|
ResponseStatus |
handshake(String password)
Deprecated.
Performs a standard handshake with the user's password.
|
static Scrobbler |
newScrobbler(String clientId,
String clientVersion,
String user)
Deprecated.
Creates a new
Scrobbler instance bound to the specified user . |
ResponseStatus |
nowPlaying(String artist,
String track)
Deprecated.
Submits 'now playing' information.
|
ResponseStatus |
nowPlaying(String artist,
String track,
String album,
int length,
int tracknumber)
Deprecated.
Submits 'now playing' information.
|
private ResponseStatus |
performHandshake(String url)
Deprecated.
Internally performs the handshake operation by calling the given
url and examining the response. |
void |
setHandshakeURL(String handshakeUrl)
Deprecated.
Sets the URL to use to perform a handshake.
|
ResponseStatus |
submit(Collection<SubmissionData> data)
Deprecated.
Scrobbles up to 50 songs at once.
|
ResponseStatus |
submit(String artist,
String track,
String album,
int length,
int tracknumber,
Source source,
long startTime)
Deprecated.
Scrobbles a song.
|
ResponseStatus |
submit(SubmissionData data)
Deprecated.
Scrobbles a song.
|
private static final String DEFAULT_HANDSHAKE_URL
private String handshakeUrl
private final String clientVersion
private String nowPlayingUrl
private String submissionUrl
public void setHandshakeURL(String handshakeUrl)
handshakeUrl
- The new handshake url.public static Scrobbler newScrobbler(String clientId, String clientVersion, String user)
Scrobbler
instance bound to the specified user
.clientId
- The client id (or "tst")clientVersion
- The client version (or "1.0")user
- The last.fm userScrobbler
instancepublic ResponseStatus handshake(String password) throws IOException
password
- The user's passwordIOException
- on I/O errorspublic ResponseStatus handshake(Session session) throws IOException
session
- An authenticated Session.IOException
- on I/O errorsAuthenticator
private ResponseStatus performHandshake(String url) throws IOException
url
and examining the response.url
- The URL to callIOException
- on I/O errorspublic ResponseStatus nowPlaying(String artist, String track) throws IOException
artist
- The artist's nametrack
- The track's titleIOException
- on I/O errorspublic ResponseStatus nowPlaying(String artist, String track, String album, int length, int tracknumber) throws IOException
artist
- The artist's nametrack
- The track's titlealbum
- The album or null
length
- The length of the track in secondstracknumber
- The position of the track in the album or -1IOException
- on I/O errorspublic ResponseStatus submit(String artist, String track, String album, int length, int tracknumber, Source source, long startTime) throws IOException
artist
- The artist's nametrack
- The track's titlealbum
- The album or null
length
- The length of the track in secondstracknumber
- The position of the track in the album or -1source
- The source of the trackstartTime
- The time the track started playing in UNIX timestamp format and UTC time zoneIOException
- on I/O errorspublic ResponseStatus submit(SubmissionData data) throws IOException
data
- Contains song informationIOException
- on I/O errorspublic ResponseStatus submit(Collection<SubmissionData> data) throws IOException
Collection
passed. Songs must be in
chronological order of their play, that means the track first in the list has been played before the track second
in the list and so on.data
- A list of song infosIOException
- on I/O errorsIllegalArgumentException
- if data contains more than 50 entriesWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses