Package com.sportradar.unifiedodds.sdk
Interface UofListener
public interface UofListener
These are all the messages you can receive relating to odds. You implement this interface to
handle received messages.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonBetCancel(UofSession sender, BetCancel<SportEvent> betCancel) If the markets were cancelled you may receive aBetCanceldescribing which markets were cancelledvoidonBetSettlement(UofSession sender, BetSettlement<SportEvent> clearBets) The onBetSettlement callback is received whenever a BetSettlement message is received.voidonBetStop(UofSession sender, BetStop<SportEvent> betStop) Send to rapidly suspend a set of markets (often all)voidonFixtureChange(UofSession sender, FixtureChange<SportEvent> fixtureChange) If there are important fixture updates you will receive fixturechange message.voidonOddsChange(UofSession sender, OddsChange<SportEvent> oddsChanges) Any kind of odds update, or betstop signal results in an OddsChanges Message.voidonRollbackBetCancel(UofSession sender, RollbackBetCancel<SportEvent> rbBetCancel) If the bet cancellations were send in error you may receive aRollbackBetCanceldescribing the erroneous cancellationsvoidonRollbackBetSettlement(UofSession sender, RollbackBetSettlement<SportEvent> rollbackBetSettlement) If a BetSettlement was generated in error, you may receive a RollbackBetsettlement and have to try to do whatever you can to undo the BetSettlement if possible.voidonUnparsableMessage(UofSession sender, UnparsableMessage unparsableMessage) This handler is called when the SDK detects that it has problems parsing/dispatching a message.voidonUserUnhandledException(UofSession sender, Exception exception) This handler is called when the SDK detects problems whileUofListenerprocess a message.
-
Method Details
-
onOddsChange
Any kind of odds update, or betstop signal results in an OddsChanges Message.- Parameters:
sender- the sessionoddsChanges- the odds changes message
-
onBetStop
Send to rapidly suspend a set of markets (often all)- Parameters:
sender- the sessionbetStop- the betstop message
-
onBetSettlement
The onBetSettlement callback is received whenever a BetSettlement message is received. It contains information about what markets that should be settled how. All markets and outcomes that you have received odds changes messages for at some point in time you will receive betsettlement messages for at some later point in time. That is if you receive odds for outcome X for market Y, you will at a later time receive a BetSettlement message that includes outcome X for market Y.- Parameters:
sender- the sessionclearBets- the BetSettlement message
-
onRollbackBetSettlement
void onRollbackBetSettlement(UofSession sender, RollbackBetSettlement<SportEvent> rollbackBetSettlement) If a BetSettlement was generated in error, you may receive a RollbackBetsettlement and have to try to do whatever you can to undo the BetSettlement if possible.- Parameters:
sender- the sessionrollbackBetSettlement- the rollbackBetSettlement message referring to a previous BetSettlement
-
onBetCancel
If the markets were cancelled you may receive aBetCanceldescribing which markets were cancelled- Parameters:
sender- the sessionbetCancel- ABetCancelinstance specifying which markets were cancelled
-
onRollbackBetCancel
If the bet cancellations were send in error you may receive aRollbackBetCanceldescribing the erroneous cancellations- Parameters:
sender- the sessionrbBetCancel- ARollbackBetCancelspecifying erroneous cancellations
-
onFixtureChange
If there are important fixture updates you will receive fixturechange message. The thinking is that most fixture updates are queried by you yourself using the SportDataProvider. However, if there are important/urgent changes you will also receive a fixture change message (e.g. if a match gets delayed, or if Sportradar for some reason needs to stop live coverage of a match etc.). This message allows you to promptly respond to such changes- Parameters:
sender- the sessionfixtureChange- the SDKFixtureChange message - describing what sport event and what type of fixture change
-
onUnparsableMessage
This handler is called when the SDK detects that it has problems parsing/dispatching a message. The handler can decide to take some custom action (shutting down everything etc. doing some special analysis of the raw message content etc) or just ignore the message. The SDK itself will always log that it has received an unparseable message.- Parameters:
sender- the sessionunparsableMessage- AUnparsableMessageinstance describing the message that had issues- Since:
- v2.0.11
-
onUserUnhandledException
This handler is called when the SDK detects problems whileUofListenerprocess a message. The handler can choose to handle exception or just ignore it. The SDK itself will always log exception.- Parameters:
sender- the sessionexception- AExceptioninstance containing unhandled exception
-