LiveDataManager

open class LiveDataManager : SubscriptionClientListener, ApplicationLifecycleListener.OnApplicationActiveListener

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
open fun getInstance(): LiveDataManager
Get the instance of the livedataManager
Link copied to clipboard
open fun getLiveDataManagerState(): LiveDataManagerState
Get the current state of the LiveDataManagers state
Link copied to clipboard
open fun getSubscribedTopics(): List<MPLiveTopic>
Get a list of the subscribed topics
Link copied to clipboard
open fun initialize()

open fun initialize(context: Context)
Initialize LiveDataManager
Link copied to clipboard
open fun isInitialized(): Boolean
Check for if LiveDataManager is initialized.
Link copied to clipboard
open fun onApplicationStateChanged(active: Boolean)
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
Link copied to clipboard
open fun onLiveUpdateReceived(@NonNull topic: MPLiveTopic, @NonNull message: LiveUpdate)
Receives a LiveUpdate and calls the appropriate listeners
Link copied to clipboard
open fun onSubscriptionClientStateChanged(@NonNull state: SubscriptionClientState)
Invoke a change in the subscription clients connection state
Link copied to clipboard
open fun onTopicSubscribed(@NonNull topic: MPLiveTopic)
Invoke the onTopicSubscribed listener with a specific topic
Link copied to clipboard
open fun onTopicSubscribeError(@NonNull error: MIError, @NonNull topic: MPLiveTopic)
Send an error of a topic subscription error.
Link copied to clipboard
open fun onTopicUnsubscribed(@NonNull topic: MPLiveTopic)
Invoke the onTopicUnsubscribed listener with a specific topic
Link copied to clipboard
open fun onTopicUnsubscribeError(@NonNull error: MIError, @NonNull topic: MPLiveTopic)
Send an error of a topic unSubscribe error.
Link copied to clipboard
open fun setOnErrorListener(messageListener: OnErrorListener)
Set the OnErrorListener on LiveDataManager
Link copied to clipboard
open fun setOnLiveDataManagerStateChangedListener(messageListener: OnLiveDataManagerStateChangedListener)
Set the OnLiveDataManagerStateChangedListener on LiveDataManager
Link copied to clipboard
open fun setOnReceivedLiveUpdateListener(messageListener: OnReceivedLiveUpdateListener)
Set the OnReceivedLiveUpdateListener on LiveDataManager
Link copied to clipboard
open fun setOnTopicSubscribedListener(messageListener: OnTopicSubscribedListener)
Set the OnTopicSubscribedListener on LiveDataManager
Link copied to clipboard
open fun setOnTopicSubscribeErrorListener(messageListener: OnTopicSubscribeErrorListener)
Set the OnTopicSubscribeErrorListener on LiveDataManager
Link copied to clipboard
open fun setOnTopicUnsubscribedListener(messageListener: OnTopicUnsubscribedListener)
Set the OnTopicUnsubscribedListener on LiveDataManager
Link copied to clipboard
open fun setOnTopicUnsubscribeErrorListener(messageListener: OnTopicUnsubscribeErrorListener)
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