Class ProducerManagerImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.ProducerManagerImpl
- All Implemented Interfaces:
SdkProducerManager,ProducerManager
Created on 03/07/2017.
// TODO @eti: Javadoc
-
Constructor Summary
ConstructorsConstructorDescriptionProducerManagerImpl(SdkInternalConfiguration configuration, ProducerDataProvider producerDataProvider, TimeUtils time) -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableProducer(int producerId) Disables teProducerassociated with the provided id (by default all the active producers are enabled)voidenableProducer(int producerId) Enables teProducerassociated with the provided id (by default all the active producers are enabled)Returns aMapof activated producers for the provided access tokenReturns aMapof all the available Sportradar producersgetProducer(int id) Returns the requestedProducerlonggetProducerLastRecoveryAttemptTimestamp(int producerId) longgetProducerLastRecoveryMessageTimestamp(int producerId) voidinternalSetProducerLastMessageTimestamp(int producerId, long lastMessageTimestamp) voidinternalSetProducerLastRecoveryAttemptTimestamp(int producerId, long lastRecoveryAttemptTimestamp) voidinternalSetProducerLastRecoveryMessageTimestamp(int producerId, long lastRecoveryMessageTimestamp) booleanisProducerDown(int producerId) An indication if the producer is currently marked as down by the SDKbooleanisProducerEnabled(int producerId) An indication if the producer is enabled.voidopen()voidsetLastAliveReceivedGenTimestamp(int producerId, long aliveReceivedGenTimestamp) voidsetLastProcessedMessageGenTimestamp(int producerId, long lastProcessedMessageGenTimestamp) voidsetProducerDown(int producerId, boolean flaggedDown) voidsetProducerRecoveryFromTimestamp(int producerId, long lastMessageTimestamp) Sets the last message received timestamp.voidsetProducerRecoveryInfo(int producerId, RecoveryInfo recoveryInfo)
-
Constructor Details
-
ProducerManagerImpl
@Inject public ProducerManagerImpl(SdkInternalConfiguration configuration, ProducerDataProvider producerDataProvider, TimeUtils time)
-
-
Method Details
-
getAvailableProducers
Description copied from interface:ProducerManagerReturns aMapof all the available Sportradar producers- Specified by:
getAvailableProducersin interfaceProducerManager- Returns:
- -
Mapof all the available Sportradar producers
-
getActiveProducers
Description copied from interface:ProducerManagerReturns aMapof activated producers for the provided access token- Specified by:
getActiveProducersin interfaceProducerManager- Returns:
- - a
Mapof active producers for the provided access token
-
getProducer
Description copied from interface:ProducerManagerReturns the requestedProducer- Specified by:
getProducerin interfaceProducerManager- Parameters:
id- - the unique identifier of aProducer- Returns:
- - if the requested producer exists, a valid
Producerinstance; otherwise unknown-producer is generated
-
enableProducer
public void enableProducer(int producerId) Description copied from interface:ProducerManagerEnables teProducerassociated with the provided id (by default all the active producers are enabled)- Specified by:
enableProducerin interfaceProducerManager- Parameters:
producerId- - the identifier of the producer that you want to enable
-
disableProducer
public void disableProducer(int producerId) Description copied from interface:ProducerManagerDisables teProducerassociated with the provided id (by default all the active producers are enabled)- Specified by:
disableProducerin interfaceProducerManager- Parameters:
producerId- - the identifier of the producer that you want to disable
-
setProducerRecoveryFromTimestamp
public void setProducerRecoveryFromTimestamp(int producerId, long lastMessageTimestamp) Description copied from interface:ProducerManagerSets the last message received timestamp. The value should be set to the timestamp of the last processed message, which was received while the producer was not marked as down. The timestamp is later used to request the feed recovery. The last valid max timestamp is 3 days ago (recovery limitation). See:Producer.getTimestampForRecovery()- Specified by:
setProducerRecoveryFromTimestampin interfaceProducerManager- Parameters:
producerId- - the identifier of the producer to which the last known message timestamp belongs toolastMessageTimestamp- - the timestamp from which the SDK will request the recovery (in milliseconds)
-
isProducerEnabled
public boolean isProducerEnabled(int producerId) Description copied from interface:ProducerManagerAn indication if the producer is enabled.- Specified by:
isProducerEnabledin interfaceProducerManager- Parameters:
producerId- - the identifier of the producer for which to check- Returns:
- -
trueif the producer is enabled, otherwisefalse
-
isProducerDown
public boolean isProducerDown(int producerId) Description copied from interface:ProducerManagerAn indication if the producer is currently marked as down by the SDK- Specified by:
isProducerDownin interfaceProducerManager- Parameters:
producerId- - the identifier of the producer for which to check- Returns:
- -
trueif the producer is down, otherwisefalse - See Also:
-
open
public void open()- Specified by:
openin interfaceSdkProducerManager
-
setProducerDown
public void setProducerDown(int producerId, boolean flaggedDown) - Specified by:
setProducerDownin interfaceSdkProducerManager
-
internalSetProducerLastMessageTimestamp
public void internalSetProducerLastMessageTimestamp(int producerId, long lastMessageTimestamp) - Specified by:
internalSetProducerLastMessageTimestampin interfaceSdkProducerManager
-
internalSetProducerLastRecoveryMessageTimestamp
public void internalSetProducerLastRecoveryMessageTimestamp(int producerId, long lastRecoveryMessageTimestamp) - Specified by:
internalSetProducerLastRecoveryMessageTimestampin interfaceSdkProducerManager
-
setLastProcessedMessageGenTimestamp
public void setLastProcessedMessageGenTimestamp(int producerId, long lastProcessedMessageGenTimestamp) - Specified by:
setLastProcessedMessageGenTimestampin interfaceSdkProducerManager
-
setLastAliveReceivedGenTimestamp
public void setLastAliveReceivedGenTimestamp(int producerId, long aliveReceivedGenTimestamp) - Specified by:
setLastAliveReceivedGenTimestampin interfaceSdkProducerManager
-
setProducerRecoveryInfo
- Specified by:
setProducerRecoveryInfoin interfaceSdkProducerManager
-
getProducerLastRecoveryMessageTimestamp
public long getProducerLastRecoveryMessageTimestamp(int producerId) - Specified by:
getProducerLastRecoveryMessageTimestampin interfaceSdkProducerManager
-
internalSetProducerLastRecoveryAttemptTimestamp
public void internalSetProducerLastRecoveryAttemptTimestamp(int producerId, long lastRecoveryAttemptTimestamp) - Specified by:
internalSetProducerLastRecoveryAttemptTimestampin interfaceSdkProducerManager
-
getProducerLastRecoveryAttemptTimestamp
public long getProducerLastRecoveryAttemptTimestamp(int producerId) - Specified by:
getProducerLastRecoveryAttemptTimestampin interfaceSdkProducerManager
-