Interface MCLSNetwork
-
- All Implemented Interfaces:
public interface MCLSNetwork
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceMCLSNetwork.OnEventUpdateListenerpublic interfaceMCLSNetwork.OnTimelineUpdateListenerpublic final classMCLSNetwork.Builder
-
Method Summary
Modifier and Type Method Description abstract UnitaddOnAnnotationActionsUpdateListener(MCLSNetwork.OnTimelineUpdateListener onTimelineUpdate)Adds an annotation actions change listener. abstract UnitaddOnEventUpdateListener(MCLSNetwork.OnEventUpdateListener onEventUpdate)Adds an event change update listener i.e. abstract UnitremoveEventUpdateListener(MCLSNetwork.OnEventUpdateListener listener)Remove OnEventUpdateListener from event change subscribers abstract UnitremoveOnAnnotationActionsUpdateListener(MCLSNetwork.OnTimelineUpdateListener listener)Remove OnTimelineUpdateListener from timeline changes listeners abstract UnitleaveEventAndTimelineUpdates(Boolean release)Leave Reactor Socket, and remove all listeners abstract UnitjoinEventAndTimelineUpdates(String eventId, CoroutineScope scope)Subscribes to changes in MCLSEvent and timeline AnnotationActions listenersWhen changes happen listeners added from addOnEventUpdateListener and addOnAnnotationActionsUpdateListener are informed about the updates. abstract UnitsetIdentityToken(String identityToken)Sets the identity token used for protected streams{@link </a>} abstract StringgetIdentityToken()Gets the current identity token used for network calls abstract UnitsetPublicKey(String publicKey)Sets the public key used for network calls. abstract UnitgetEventDetails(String eventId, Function1<MCLSEvent, Unit> onEventComplete)Gets event details abstract UnitgetEventDetails(String eventId, Function1<MCLSEvent, Unit> onEventComplete, Function1<String, Unit> onError)Gets event details abstract MCLSResult<Exception, MCLSEvent>getEventDetails(String eventId, String updateId)Gets the event details raw response abstract MCLSResult<Exception, Events>getEventList(Integer pageSize, String pageToken, String filter, OrderByEventsParam orderBy)Fetches Events List and Returns them in a MCLSResult wrapper abstract UnitgetEventsList(Integer pageSize, String pageToken, String filter, OrderByEventsParam orderBy, Function3<List<MCLSEventListItem>, String, String, Unit> fetchEventCallback)Fetches Events List and Returns them in a callback param abstract MCLSResult<Exception, List<AnnotationAction>>getTimelineActions(String timelineId, String updateId)Fetches a list of Annotation Actions from the api, and returns them in a response wrapper for safe execution abstract UnitgetTimelineActions(String timelineId, String updateId, Function1<List<AnnotationAction>, Unit> onSuccess)An automatic unwrap for getTimelineActions result abstract UnitgetTimelineActions(String timelineId, String updateId, Function1<List<AnnotationAction>, Unit> onSuccess, Function1<String, Unit> onError)An automatic unwrap for getTimelineActions result abstract IReactorSocketgetReactorSocket()Row accessor to IReactorSocket abstract IBFFRTSocketgetBffRtSocket()Row accessor to IBFFRTSocket used for concurrency limit -
-
Method Detail
-
addOnAnnotationActionsUpdateListener
abstract Unit addOnAnnotationActionsUpdateListener(MCLSNetwork.OnTimelineUpdateListener onTimelineUpdate)
Adds an annotation actions change listener. And sends the current state of MCLSEvent (if joined before)
Listeners of this type are only triggered after joinEventAndTimelineUpdates is executed.
- Parameters:
onTimelineUpdate- can be expressed as an interface implementation or as a function callback
-
addOnEventUpdateListener
abstract Unit addOnEventUpdateListener(MCLSNetwork.OnEventUpdateListener onEventUpdate)
Adds an event change update listener i.e. the event went live
Listeners of this type are only triggered after joinEventAndTimelineUpdates is executed.
- Parameters:
onEventUpdate- a SAM interface which can be expressed as an interface implementation or as a function callback
-
removeEventUpdateListener
abstract Unit removeEventUpdateListener(MCLSNetwork.OnEventUpdateListener listener)
Remove OnEventUpdateListener from event change subscribers
- Parameters:
listener- the listener to be removed
-
removeOnAnnotationActionsUpdateListener
abstract Unit removeOnAnnotationActionsUpdateListener(MCLSNetwork.OnTimelineUpdateListener listener)
Remove OnTimelineUpdateListener from timeline changes listeners
- Parameters:
listener- the listener to be removed
-
leaveEventAndTimelineUpdates
abstract Unit leaveEventAndTimelineUpdates(Boolean release)
Leave Reactor Socket, and remove all listeners
-
joinEventAndTimelineUpdates
abstract Unit joinEventAndTimelineUpdates(String eventId, CoroutineScope scope)
Subscribes to changes in MCLSEvent and timeline AnnotationActions listeners
When changes happen listeners added from addOnEventUpdateListener and addOnAnnotationActionsUpdateListener are informed about the updates.
Currently only 1 event is listened to at any given moment, so when joinEventAndTimelineUpdates is triggered multiple times, only the last eventId is being monitored
-
setIdentityToken
abstract Unit setIdentityToken(String identityToken)
Sets the identity token used for protected streams
{@link </a>}
- Parameters:
identityToken- the token generated from the platform backend
-
getIdentityToken
abstract String getIdentityToken()
Gets the current identity token used for network calls
-
setPublicKey
abstract Unit setPublicKey(String publicKey)
Sets the public key used for network calls. this one is linked to your organization
-
getEventDetails
abstract Unit getEventDetails(String eventId, Function1<MCLSEvent, Unit> onEventComplete)
Gets event details
- Parameters:
onEventComplete- a callback that triggers when the call finishes successfully
-
getEventDetails
abstract Unit getEventDetails(String eventId, Function1<MCLSEvent, Unit> onEventComplete, Function1<String, Unit> onError)
Gets event details
- Parameters:
onEventComplete- a callback that triggers when the call finishes successfullyonError- a callback that triggers when an error happens
-
getEventDetails
abstract MCLSResult<Exception, MCLSEvent> getEventDetails(String eventId, String updateId)
Gets the event details raw response
-
getEventList
abstract MCLSResult<Exception, Events> getEventList(Integer pageSize, String pageToken, String filter, OrderByEventsParam orderBy)
Fetches Events List and Returns them in a MCLSResult wrapper
- Parameters:
pageSize- the number of items wanted in a given responsepageToken- used for pagination purposesfilter- used for filtering events based on a given query.orderBy- the order of the event list
-
getEventsList
abstract Unit getEventsList(Integer pageSize, String pageToken, String filter, OrderByEventsParam orderBy, Function3<List<MCLSEventListItem>, String, String, Unit> fetchEventCallback)
Fetches Events List and Returns them in a callback param
- Parameters:
pageSize- the number of items wanted in a given responsepageToken- used for pagination purposesfilter- used for filtering events based on a given query.orderBy- the order of the event listFor more information about the filter and the order by params queries please refer to the following {@link <a href="https://mcls.mycujoo.tv/api-docs/#list-events">https://mcls.mycujoo.
-
getTimelineActions
abstract MCLSResult<Exception, List<AnnotationAction>> getTimelineActions(String timelineId, String updateId)
Fetches a list of Annotation Actions from the api, and returns them in a response wrapper for safe execution
- Parameters:
timelineId- the id of the timeline neededupdateId- a key used to get the latest update of a given timeline.
-
getTimelineActions
abstract Unit getTimelineActions(String timelineId, String updateId, Function1<List<AnnotationAction>, Unit> onSuccess)
An automatic unwrap for getTimelineActions result
- Parameters:
onSuccess- a callback executed when Timeline request success
-
getTimelineActions
abstract Unit getTimelineActions(String timelineId, String updateId, Function1<List<AnnotationAction>, Unit> onSuccess, Function1<String, Unit> onError)
An automatic unwrap for getTimelineActions result
- Parameters:
onSuccess- a callback executed when Timeline request success.onError- a callback executed when timeline fetch fails.
-
getReactorSocket
abstract IReactorSocket getReactorSocket()
Row accessor to IReactorSocket
-
getBffRtSocket
abstract IBFFRTSocket getBffRtSocket()
Row accessor to IBFFRTSocket used for concurrency limit
-
-
-
-