public class UofSessionImpl extends Object implements UofSession, MessageConsumer, FeedMessageProcessor
Constructor and Description |
---|
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) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object obj) |
String |
getConsumerDescription()
Returns a
String which describes the consumer |
MessageInterest |
getMessageInterest()
Returns the consumer
MessageInterest |
String |
getProcessorId()
Returns the processor identifier
|
int |
hashCode() |
void |
onMessageDeserializationFailed(byte[] rawMessage,
Urn eventId)
Dispatches the "unparsable message received event"
|
void |
onMessageReceived(UnmarshalledMessage unmarshalledMessage,
byte[] body,
RoutingKeyInfo routingKeyInfo,
MessageTimestamp timestamp)
Consumes the provided message
|
void |
onRawFeedMessageReceived(RoutingKeyInfo routingKey,
UnmarshalledMessage feedMessage,
MessageTimestamp timestamp,
MessageInterest messageInterest)
Occurs when any feed message arrives
|
void |
open(List<String> routingKeys,
MessageInterest messageInterest,
UofListener uofListener,
UofExtListener uofExtListener) |
void |
processMessage(UnmarshalledMessage o,
byte[] body,
RoutingKeyInfo routingKeyInfo,
MessageTimestamp timestamp)
Dispatches the processed message to the client
|
void |
setNextMessageProcessor(FeedMessageProcessor nextMessageProcessor)
This method should be ignored since the
UofSessionImpl is the final dispatching message processor. |
@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)
public void open(List<String> routingKeys, MessageInterest messageInterest, UofListener uofListener, UofExtListener uofExtListener) throws IOException
IOException
public void close()
public void onMessageReceived(UnmarshalledMessage unmarshalledMessage, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp)
onMessageReceived
in interface MessageConsumer
unmarshalledMessage
- - an unmarshalled message payloadbody
- - the raw payload (mainly used for logging and user exposure)routingKeyInfo
- - a RoutingKeyInfo
instance describing the message routing keytimestamp
- - all message timestampspublic void onMessageDeserializationFailed(byte[] rawMessage, Urn eventId)
onMessageDeserializationFailed
in interface MessageConsumer
rawMessage
- - the raw message payloadeventId
- - if available the related sport event id; otherwise nullpublic String getProcessorId()
getProcessorId
in interface FeedMessageProcessor
public void processMessage(UnmarshalledMessage o, byte[] body, RoutingKeyInfo routingKeyInfo, MessageTimestamp timestamp)
processMessage
in interface FeedMessageProcessor
o
- - the message that should be processedbody
- - the raw body of the received messageroutingKeyInfo
- - a RoutingKeyInfo
instance describing the message routing keytimestamp
- - all message timestampspublic void setNextMessageProcessor(FeedMessageProcessor nextMessageProcessor)
UofSessionImpl
is the final dispatching message processor.setNextMessageProcessor
in interface FeedMessageProcessor
nextMessageProcessor
- - should be ignored/not usedpublic String getConsumerDescription()
String
which describes the consumergetConsumerDescription
in interface MessageConsumer
String
which describes the consumerpublic MessageInterest getMessageInterest()
MessageInterest
getMessageInterest
in interface MessageConsumer
MessageInterest
public void onRawFeedMessageReceived(RoutingKeyInfo routingKey, UnmarshalledMessage feedMessage, MessageTimestamp timestamp, MessageInterest messageInterest)
onRawFeedMessageReceived
in interface MessageConsumer
routingKey
- the routing key associated with this messagefeedMessage
- the message receivedtimestamp
- the message timestampsmessageInterest
- the associated MessageInterest
Copyright © 2016–2025. All rights reserved.