net.dontdrinkandroot.lastfm.api.ws
Class FetchLimitEnforcer

java.lang.Object
  extended by net.dontdrinkandroot.lastfm.api.ws.FetchLimitEnforcer

public class FetchLimitEnforcer
extends java.lang.Object

Enforce last.fm fetch limit. "You will not make more than 5 requests per originating IP address per second, averaged over a 5 minute period".

Author:
Philip W. Sorst

Constructor Summary
FetchLimitEnforcer()
           
 
Method Summary
 double getWebRequestsPerSecond()
          Get the number of requests per second in the compliance interval.
 void waitForTimeslot()
          Block as long as it is necessary to comply with the request/second limit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchLimitEnforcer

public FetchLimitEnforcer()
Method Detail

getWebRequestsPerSecond

public final double getWebRequestsPerSecond()
Get the number of requests per second in the compliance interval.

Returns:
Number of requests per second.

waitForTimeslot

public final void waitForTimeslot()
Block as long as it is necessary to comply with the request/second limit.



Copyright © 2012. All Rights Reserved.