|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.roarsoftware.lastfm.cache.DefaultExpirationPolicy
public class DefaultExpirationPolicy
This Policy maintains a list of methods which should be cached one week. Everything else won't be cached if using this policy.
Field Summary | |
---|---|
protected long |
cacheRecentWeeklyCharts
Contains the expiration time for weekly chart data for the current week, which is one week by default; last.fm TOS says: "You agree to cache similar artist and any chart data (top tracks, top artists, top albums) for a minimum of one week." but they might be outdated the next day. |
protected static long |
ONE_DAY
One day in milliseconds |
protected static long |
ONE_WEEK
One week in milliseconds |
protected static java.util.Set<java.lang.String> |
ONE_WEEK_METHODS
Contains method names for all requests that should be cached 1 week |
Constructor Summary | |
---|---|
DefaultExpirationPolicy()
|
Method Summary | |
---|---|
long |
getExpirationTime(java.lang.String method,
java.util.Map<java.lang.String,java.lang.String> params)
Returns the time in milliseconds a request of the given method should be cached. |
void |
setCacheRecentWeeklyCharts(long cacheRecentWeeklyCharts)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final long ONE_DAY
protected static final long ONE_WEEK
protected static final java.util.Set<java.lang.String> ONE_WEEK_METHODS
protected long cacheRecentWeeklyCharts
setCacheRecentWeeklyCharts(long)
method to set this value.
This variable also applies to the getWeeklyChartList method
Constructor Detail |
---|
public DefaultExpirationPolicy()
Method Detail |
---|
public long getExpirationTime(java.lang.String method, java.util.Map<java.lang.String,java.lang.String> params)
ExpirationPolicy
getExpirationTime
in interface ExpirationPolicy
method
- The method calledparams
- The parameters sent
public void setCacheRecentWeeklyCharts(long cacheRecentWeeklyCharts)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |