Class LiveScoutUserRequestManagerImpl
java.lang.Object
com.sportradar.livedata.sdk.proto.common.RequestProducerBase<OutgoingMessage>
com.sportradar.livedata.sdk.feed.livescout.classes.LiveScoutUserRequestManagerImpl
- All Implemented Interfaces:
 UserRequestManager,MessageProcessor<LiveScoutEntityBase>,LiveScoutUserRequestManager,RequestProducer<OutgoingMessage>
public class LiveScoutUserRequestManagerImpl
extends RequestProducerBase<OutgoingMessage>
implements LiveScoutUserRequestManager, MessageProcessor<LiveScoutEntityBase>
A 
UserRequestManager implementation associated with the live-scout feed.
 Also handles error recovery for the feed- 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected final SdkLoggerSDK loggerstatic final org.joda.time.DurationHow long to leave match after it comes into terminal state? - 
Constructor Summary
ConstructorsConstructorDescriptionLiveScoutUserRequestManagerImpl(int index, LiveScoutOutgoingMessageFactory requestFactory, org.joda.time.Duration maxAge, TestManager testManager) Initializes a new instance of theLiveScoutUserRequestManagerImplclass. - 
Method Summary
Modifier and TypeMethodDescriptionvoidbookMatches(EventIdentifier[] eventIds) Book the specified matches.intgetIndex()Gets the index of the currentMessageProcessorimplementation used to determine the correct order of message processors when there are multiple message processors processing the same message.voidgetMatchList(int hoursBack, int hoursForward, boolean includeAvailable, Collection<Integer> sportIds, Collection<Long> matchIds, UUID requestId) Get a list of matchesGets the ids of all subscribed events.When connected to the test server you can obtain a manager to manipulate it.voidInstructs theRequestProducerto start generating requests.voidInstructs theRequestProducerto stop generating requests;voidprocessMessage(LiveScoutEntityBase message) Processes the passed message derived fromLiveScoutEntityBaseclass.voidMakes a server time request.voidSets theMessageProcessorListenerinstance used to observe the currentMessageProcessorvoidsubscribe(EventIdentifier... eventIds) Subscribe to specified matches.voidunsubscribe(EventIdentifier... eventIds) Un-subscribe from the specified matches.Methods inherited from class com.sportradar.livedata.sdk.proto.common.RequestProducerBase
getIsStarted, notifyOnRequestReady, notifyOnRequestReady, setListener, start, stop 
- 
Field Details
- 
TERMINAL_STATE_ADDENDUM
public static final org.joda.time.Duration TERMINAL_STATE_ADDENDUMHow long to leave match after it comes into terminal state? - 
MAX_SUBSCRIPTION_AMOUNT
public static final int MAX_SUBSCRIPTION_AMOUNT- See Also:
 
 - 
sdkLogger
SDK logger 
 - 
 - 
Constructor Details
- 
LiveScoutUserRequestManagerImpl
public LiveScoutUserRequestManagerImpl(int index, LiveScoutOutgoingMessageFactory requestFactory, org.joda.time.Duration maxAge, TestManager testManager) Initializes a new instance of theLiveScoutUserRequestManagerImplclass.- Parameters:
 index- index in pipelinerequestFactory- ALiveScoutOutgoingMessageFactoryinstance used to generate server requests.maxAge- max age of eventstestManager- test manager- Throws:
 IllegalArgumentException- TherequestFactoryis a null reference.
 
 - 
 - 
Method Details
- 
bookMatches
Book the specified matches. Booked matches cannot be cancelled through this interface.You should prefer using the Live Calendar on the Betradar website (http://www.betradar.com) which offers automatic booking for certain types of matches.
Note that booking matches will have a cost depending on the type of agreement you have with Sportradar.
LiveScout: Expect
LiveScoutFeedListener.onMatchBooked(LiveScoutFeed, MatchBookingEntity)message in reply.- Specified by:
 bookMatchesin interfaceUserRequestManager- Parameters:
 eventIds- The id of events to book
 - 
getSubscribedEvents
Gets the ids of all subscribed events.- Specified by:
 getSubscribedEventsin interfaceUserRequestManager- Returns:
 - the ids of all subscribed events.
 
 - 
getTestManager
When connected to the test server you can obtain a manager to manipulate it.- Specified by:
 getTestManagerin interfaceUserRequestManager- Returns:
 - a 
TestManagerimplementation 
 - 
subscribe
Subscribe to specified matches. LiveScout: ExpectLiveScoutFeedListener.onMatchUpdateReceived(LiveScoutFeed, MatchUpdateEntity)message is response. If match subscription is successful, a full match update is sent out. Otherwise explanation will be given in the response message (e.g. you do not have access to the match or there are already two open subscriptions for the match). With LiveScout you must explicitly callUserRequestManager.subscribe(EventIdentifier[])at start-up or no data will be received.- Specified by:
 subscribein interfaceUserRequestManager- Parameters:
 eventIds- Array of event ids
 - 
unsubscribe
Un-subscribe from the specified matches. After this no more events associated with these matches will be sent. LiveScout: ExpectLiveScoutFeedListener.onMatchStopped(LiveScoutFeed, MatchStopEntity)message in response.- Specified by:
 unsubscribein interfaceUserRequestManager- Parameters:
 eventIds- Array of match ids from which to un-subscribe
 - 
getIndex
public int getIndex()Gets the index of the currentMessageProcessorimplementation used to determine the correct order of message processors when there are multiple message processors processing the same message.- Specified by:
 getIndexin interfaceMessageProcessor<LiveScoutEntityBase>- Returns:
 - the index of the current 
MessageProcessorimplementation 
 - 
processMessage
Description copied from interface:MessageProcessorProcesses the passed message derived fromLiveScoutEntityBaseclass.- Specified by:
 processMessagein interfaceMessageProcessor<LiveScoutEntityBase>- Parameters:
 message- TheLiveScoutEntityBasederived class representing the message.
 - 
setListener
Description copied from interface:MessageProcessorSets theMessageProcessorListenerinstance used to observe the currentMessageProcessor- Specified by:
 setListenerin interfaceMessageProcessor<LiveScoutEntityBase>- Parameters:
 listener- TheMessageProcessorListenerused to observe the processor.
 - 
getMatchList
public void getMatchList(int hoursBack, int hoursForward, boolean includeAvailable, Collection<Integer> sportIds, Collection<Long> matchIds, UUID requestId) Get a list of matches- Specified by:
 getMatchListin interfaceLiveScoutUserRequestManager- Parameters:
 hoursBack- - number of hours back (from current time)hoursForward- - number of hours forward (from current time)includeAvailable- - include also available matches (which you have not booked yet)sportIds- - filter by sports ids, nullablematchIds- - filter by matches ids, nullablerequestId- - UUID to track matchlist request
 - 
requestServerTime
public void requestServerTime()Makes a server time request.- Specified by:
 requestServerTimein interfaceLiveScoutUserRequestManager
 - 
onStarting
public void onStarting()Instructs theRequestProducerto start generating requests.- Overrides:
 onStartingin classRequestProducerBase<OutgoingMessage>
 - 
onStopping
public void onStopping()Instructs theRequestProducerto stop generating requests;- Overrides:
 onStoppingin classRequestProducerBase<OutgoingMessage>
 
 -