net.dontdrinkandroot.lastfm.api.ws
Class DefaultLastfmWebServices
java.lang.Object
net.dontdrinkandroot.lastfm.api.ws.AbstractLastfmWebServices
net.dontdrinkandroot.lastfm.api.ws.DefaultLastfmWebServices
- All Implemented Interfaces:
- LastfmWebServices
public class DefaultLastfmWebServices
- extends AbstractLastfmWebServices
|
Method Summary |
protected java.io.Serializable |
getFromCache(java.util.Map<java.lang.String,java.lang.String> parameters)
Try to fetch the result from cache. |
protected java.io.Serializable |
putToCache(java.util.Map<java.lang.String,java.lang.String> parameters,
java.io.Serializable result,
long timeToLive)
Store result in cache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultLastfmWebServices
public DefaultLastfmWebServices(java.lang.String key,
java.lang.String secret)
throws javax.xml.parsers.ParserConfigurationException
- Set up the WebServices with the required components.
- Parameters:
key - The last.fm API key, see http://www.last.fm/api/accountsecret - The last.fm API secret, see http://www.last.fm/api/account
- Throws:
javax.xml.parsers.ParserConfigurationException
DefaultLastfmWebServices
public DefaultLastfmWebServices(java.lang.String key,
java.lang.String secret,
Cache cache)
throws javax.xml.parsers.ParserConfigurationException
- Set up the WebServices with the required components.
- Parameters:
key - The last.fm API key, see http://www.last.fm/api/accountsecret - The last.fm API secret, see http://www.last.fm/api/accountcache - The cache implementation
- Throws:
javax.xml.parsers.ParserConfigurationException
DefaultLastfmWebServices
public DefaultLastfmWebServices(java.lang.String key,
java.lang.String secret,
Cache cache,
Fetcher fetcher)
getFromCache
protected java.io.Serializable getFromCache(java.util.Map<java.lang.String,java.lang.String> parameters)
- Try to fetch the result from cache.
- Specified by:
getFromCache in class AbstractLastfmWebServices
- Parameters:
id - Id to lookup.
- Returns:
- The entry if found or null.
putToCache
protected java.io.Serializable putToCache(java.util.Map<java.lang.String,java.lang.String> parameters,
java.io.Serializable result,
long timeToLive)
- Store result in cache.
- Specified by:
putToCache in class AbstractLastfmWebServices
- Parameters:
id - The id to store the entry for.result - The query result.timeToLive - The time to live for the cache entry.
- Returns:
- The cached result or the original result on caching errors.
Copyright © 2013 dontdrinkandroot. All Rights Reserved.