Class RateGateBase
java.lang.Object
com.sportradar.livedata.sdk.common.rategate.RateGateBase
- All Implemented Interfaces:
- RateGate
- Direct Known Subclasses:
- CombinedRateGate,- NullRateGate,- SimpleRateGate
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionorg.joda.time.DurationApproximately how long will I have to wait?abstract org.joda.time.DurationhowLongToWait(int amount) Approximately how long will I have to wait?voidsetListener(RateGateListener listener) Set the event listenervoidBlock when configured rate-limits are exceeded.abstract booleanwaitToProceed(int amount, org.joda.time.Duration wait) Block when configured rate-limits are exceeded.booleanwaitToProceed(org.joda.time.Duration wait) Block when configured rate-limits are exceeded.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sportradar.livedata.sdk.common.rategate.RateGatewaitToProceed
- 
Field Details- 
listenerLock
- 
listener
 
- 
- 
Constructor Details- 
RateGateBasepublic RateGateBase()
 
- 
- 
Method Details- 
waitToProceedDescription copied from interface:RateGateBlock when configured rate-limits are exceeded.- Specified by:
- waitToProceedin interface- RateGate
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
waitToProceedBlock when configured rate-limits are exceeded.- Specified by:
- waitToProceedin interface- RateGate
- Parameters:
- wait- - when specified this means the maximum amount of time to wait
- Returns:
- true when we passed the gate; false when a timeout occured
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
waitToProceedpublic abstract boolean waitToProceed(int amount, org.joda.time.Duration wait) throws InterruptedException Block when configured rate-limits are exceeded.- Specified by:
- waitToProceedin interface- RateGate
- Parameters:
- amount- - number of elements
- wait- - the maximum amount of time to wait, negative means infinity
- Returns:
- true when we passed the gate; false when a timeout occured
- Throws:
- InterruptedException- when somebody interrupted the waiting
 
- 
howLongToWaitpublic org.joda.time.Duration howLongToWait()Approximately how long will I have to wait?- Specified by:
- howLongToWaitin interface- RateGate
- Returns:
- - a non-negative amount of time, zero means no need to wait.
 
- 
howLongToWaitpublic abstract org.joda.time.Duration howLongToWait(int amount) Approximately how long will I have to wait?- Specified by:
- howLongToWaitin interface- RateGate
- Parameters:
- amount- - number of elements
- Returns:
- - a non-negative amount of time, zero means no need to wait.
 
- 
setListenerSet the event listener- Specified by:
- setListenerin interface- RateGate
- Parameters:
- listener- - new listener
 
 
-