LiveDataManager

LiveDataManager to control and implement states and events of live data

Functions

Link copied to clipboard
open fun getActiveLiveData(onActiveLiveDataResultListener: OnActiveLiveDataResultListener)
Gets the active live data for this solution
Link copied to clipboard
Get the instance of the livedataManager
Link copied to clipboard
Get the current state of the LiveDataManagers state
Link copied to clipboard
Get a list of the subscribed topics
Link copied to clipboard
open fun initialize()

open fun initialize(context: Context, apiKey: String)
Initialize LiveDataManager
Link copied to clipboard
Check for if LiveDataManager is initialized.
Link copied to clipboard
Link copied to clipboard
open fun onError(@NonNull error: MIError)
Invoke an error on LiveDataManager If MIError is declared as LIVEDATA_CONNECTION_LOST or LIVEDATA_CONNECTION_FAILED the livedatamanager will try to reconnect after 2 seconds Will invoke the onErrorListener of LiveDataManager
abstract fun onError(error: MIError)
a method to invoke the onErrorListener with an MIerror
Link copied to clipboard
Receives a LiveUpdate and calls the appropriate listeners
abstract fun onLiveUpdateReceived(topic: MPLiveTopic, message: LiveUpdate)
an invokation from the onReceivedLiveUpdateListener
Link copied to clipboard
Invoke a change in the subscription clients connection state
Link copied to clipboard
Invoke the onTopicSubscribed listener with a specific topic
abstract fun onTopicSubscribed(topic: MPLiveTopic)
an invokation of the OnTopicSubscripedListener
Link copied to clipboard
Send an error of a topic subscription error.
abstract fun onTopicSubscribeError(error: MIError, topic: MPLiveTopic)
An invocation of the OnTopicSubribeErrorListener
Link copied to clipboard
Invoke the onTopicUnsubscribed listener with a specific topic
abstract fun onTopicUnsubscribed(topic: MPLiveTopic)
an invocation of the OnTopicUnsubscribedListener
Link copied to clipboard
Send an error of a topic unSubscribe error.
abstract fun onTopicUnsubscribeError(error: MIError, topic: MPLiveTopic)
an invocation of the OnTopicUnsubscribedErrorListener
Link copied to clipboard
open fun setOnErrorListener(messageListener: OnErrorListener)
Set the OnErrorListener on LiveDataManager
Link copied to clipboard
Set the OnLiveDataManagerStateChangedListener on LiveDataManager
Link copied to clipboard
Set the OnReceivedLiveUpdateListener on LiveDataManager
Link copied to clipboard
Set the OnTopicSubscribedListener on LiveDataManager
Link copied to clipboard
Set the OnTopicSubscribeErrorListener on LiveDataManager
Link copied to clipboard
Set the OnTopicUnsubscribedListener on LiveDataManager
Link copied to clipboard
Set the OnTopicUnsubscribeErrorListener on LiveDataManager
Link copied to clipboard
open fun subscribeTopic(topic: MPLiveTopic)
Subscribe to a topic with LiveDataManager
Link copied to clipboard
open fun subscribeTopics(topics: List<MPLiveTopic>)
Subscribe to a list of topics with LiveDataManager
Link copied to clipboard
open fun unsubscribeTopic(topic: MPLiveTopic)
Unsubscribe to a topic with LiveDataManager