Class UofSessionImpl
java.lang.Object
com.sportradar.unifiedodds.sdk.internal.impl.UofSessionImpl
- All Implemented Interfaces:
FeedMessageProcessor,MessageConsumer,UofSession
public class UofSessionImpl
extends Object
implements UofSession, MessageConsumer, FeedMessageProcessor
-
Constructor Summary
ConstructorsConstructorDescriptionUofSessionImpl(SdkInternalConfiguration config, MessageReceiver messageReceiver, RecoveryManager recoveryManager, CompositeMessageProcessor messageProcessor, SdkProducerManager producerManager, SportDataProvider sportDataProvider, SportEntityFactory sportEntityFactory, FeedMessageFactory messageFactory, FeedMessageValidator feedMessageValidator, UnifiedOddsStatistics ufStats, com.google.common.cache.Cache<String, String> dispatchedFixtureChangesCache) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanReturns aStringwhich describes the consumerReturns the consumerMessageInterestReturns the processor identifierinthashCode()voidonMessageDeserializationFailed(byte[] rawMessage, Urn eventId) Dispatches the "unparsable message received event"voidonMessageReceived(UnmarshalledMessage unmarshalledMessage, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Consumes the provided messagevoidonRawFeedMessageReceived(RoutingKeyInfo routingKey, UnmarshalledMessage feedMessage, MessageTimestamp timestamp, MessageInterest messageInterest) Occurs when any feed message arrivesvoidopen(List<String> routingKeys, MessageInterest messageInterest, UofListener uofListener, UofExtListener uofExtListener) voidprocessMessage(UnmarshalledMessage o, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Dispatches the processed message to the clientvoidsetNextMessageProcessor(FeedMessageProcessor nextMessageProcessor) This method should be ignored since theUofSessionImplis the final dispatching message processor.
-
Constructor Details
-
UofSessionImpl
@Inject public UofSessionImpl(SdkInternalConfiguration config, MessageReceiver messageReceiver, RecoveryManager recoveryManager, CompositeMessageProcessor messageProcessor, SdkProducerManager producerManager, SportDataProvider sportDataProvider, SportEntityFactory sportEntityFactory, FeedMessageFactory messageFactory, FeedMessageValidator feedMessageValidator, UnifiedOddsStatistics ufStats, com.google.common.cache.Cache<String, String> dispatchedFixtureChangesCache)
-
-
Method Details
-
open
public void open(List<String> routingKeys, MessageInterest messageInterest, UofListener uofListener, UofExtListener uofExtListener) throws IOException - Throws:
IOException
-
close
public void close() -
onMessageReceived
public void onMessageReceived(UnmarshalledMessage unmarshalledMessage, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Consumes the provided message- Specified by:
onMessageReceivedin interfaceMessageConsumer- Parameters:
unmarshalledMessage- - an unmarshalled message payloadbody- - the raw payload (mainly used for logging and user exposure)routingKeyInfo- - aRoutingKeyInfoinstance describing the message routing keytimestamp- - all message timestamps
-
onMessageDeserializationFailed
Dispatches the "unparsable message received event"- Specified by:
onMessageDeserializationFailedin interfaceMessageConsumer- Parameters:
rawMessage- - the raw message payloadeventId- - if available the related sport event id; otherwise null
-
getProcessorId
Returns the processor identifier- Specified by:
getProcessorIdin interfaceFeedMessageProcessor- Returns:
- - the processor identifier
-
processMessage
public void processMessage(UnmarshalledMessage o, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp) Dispatches the processed message to the client- Specified by:
processMessagein interfaceFeedMessageProcessor- Parameters:
o- - the message that should be processedbody- - the raw body of the received messageroutingKeyInfo- - aRoutingKeyInfoinstance describing the message routing keytimestamp- - all message timestamps
-
setNextMessageProcessor
This method should be ignored since theUofSessionImplis the final dispatching message processor.- Specified by:
setNextMessageProcessorin interfaceFeedMessageProcessor- Parameters:
nextMessageProcessor- - should be ignored/not used
-
getConsumerDescription
Returns aStringwhich describes the consumer- Specified by:
getConsumerDescriptionin interfaceMessageConsumer- Returns:
- - a
Stringwhich describes the consumer
-
getMessageInterest
Returns the consumerMessageInterest- Specified by:
getMessageInterestin interfaceMessageConsumer- Returns:
- the consumer
MessageInterest
-
onRawFeedMessageReceived
public void onRawFeedMessageReceived(RoutingKeyInfo routingKey, UnmarshalledMessage feedMessage, MessageTimestamp timestamp, MessageInterest messageInterest) Occurs when any feed message arrives- Specified by:
onRawFeedMessageReceivedin interfaceMessageConsumer- Parameters:
routingKey- the routing key associated with this messagefeedMessage- the message receivedtimestamp- the message timestampsmessageInterest- the associatedMessageInterest
-
hashCode
public int hashCode() -
equals
-