Class NullRateGate
- java.lang.Object
-
- com.sportradar.livedata.sdk.common.rategate.RateGateBase
-
- com.sportradar.livedata.sdk.common.rategate.NullRateGate
-
- All Implemented Interfaces:
RateGate
public class NullRateGate extends RateGateBase implements RateGate
-
-
Field Summary
-
Fields inherited from class com.sportradar.livedata.sdk.common.rategate.RateGateBase
listener, listenerLock
-
-
Constructor Summary
Constructors Constructor Description NullRateGate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.joda.time.Duration
howLongToWait(int amount)
Approximately how long will I have to wait?void
waitToProceed(int amount)
Block when configured rate-limits are exceeded.boolean
waitToProceed(int amount, org.joda.time.Duration wait)
Block when configured rate-limits are exceeded.-
Methods inherited from class com.sportradar.livedata.sdk.common.rategate.RateGateBase
howLongToWait, setListener, waitToProceed, waitToProceed
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sportradar.livedata.sdk.common.rategate.RateGate
howLongToWait, setListener, waitToProceed, waitToProceed
-
-
-
-
Method Detail
-
waitToProceed
public void waitToProceed(int amount) throws InterruptedException
Description copied from interface:RateGate
Block when configured rate-limits are exceeded.- Specified by:
waitToProceed
in interfaceRateGate
- Parameters:
amount
- - number of elements- Throws:
InterruptedException
- when somebody interrupted the waiting
-
waitToProceed
public boolean waitToProceed(int amount, org.joda.time.Duration wait) throws InterruptedException
Block when configured rate-limits are exceeded.- Specified by:
waitToProceed
in interfaceRateGate
- Specified by:
waitToProceed
in classRateGateBase
- Parameters:
amount
- - number of elementswait
- - the maximum amount of time to wait, negative means infinity- Returns:
- true when we passed the gate; false when a timeout occurred
- Throws:
InterruptedException
- when somebody interrupted the waiting
-
howLongToWait
public org.joda.time.Duration howLongToWait(int amount)
Approximately how long will I have to wait?- Specified by:
howLongToWait
in interfaceRateGate
- Specified by:
howLongToWait
in classRateGateBase
- Parameters:
amount
- - number of elements- Returns:
- - a non-negative amount of time, zero means no need to wait.
-
-