public final class NoOpSubscriptionManager extends java.lang.Object implements SubscriptionManager
SubscriptionManager.Callback<T>
Constructor and Description |
---|
NoOpSubscriptionManager() |
Modifier and Type | Method and Description |
---|---|
void |
addOnStateChangeListener(OnSubscriptionManagerStateChangeListener onStateChangeListener)
Adds new listener for subscription manager state changes.
|
SubscriptionManagerState |
getState()
Returns the current state of subscription manager.
|
void |
removeOnStateChangeListener(OnSubscriptionManagerStateChangeListener onStateChangeListener)
Removes listener for subscription manager state changes.
|
void |
start()
Put the
SubscriptionManager in a connectible state. |
void |
stop()
Unsubscribe from all active subscriptions, and disconnect the web socket.
|
<T> void |
subscribe(com.apollographql.apollo.api.Subscription<?,T,?> subscription,
SubscriptionManager.Callback<T> callback)
Starts provided subscription.
|
void |
unsubscribe(com.apollographql.apollo.api.Subscription<?,?,?> subscription)
Stops provided subscription.
|
public <T> void subscribe(@NotNull com.apollographql.apollo.api.Subscription<?,T,?> subscription, @NotNull SubscriptionManager.Callback<T> callback)
SubscriptionManager
subscribe
in interface SubscriptionManager
subscription
- to startcallback
- to be called on resultpublic void unsubscribe(@NotNull com.apollographql.apollo.api.Subscription<?,?,?> subscription)
SubscriptionManager
unsubscribe
in interface SubscriptionManager
subscription
- to stoppublic void start()
SubscriptionManager
SubscriptionManager
in a connectible state. Does not necessarily open a web
socket.start
in interface SubscriptionManager
public void stop()
SubscriptionManager
stop
in interface SubscriptionManager
public SubscriptionManagerState getState()
SubscriptionManager
getState
in interface SubscriptionManager
public void addOnStateChangeListener(@NotNull OnSubscriptionManagerStateChangeListener onStateChangeListener)
SubscriptionManager
addOnStateChangeListener
in interface SubscriptionManager
onStateChangeListener
- to be called when state changedpublic void removeOnStateChangeListener(@NotNull OnSubscriptionManagerStateChangeListener onStateChangeListener)
SubscriptionManager
removeOnStateChangeListener
in interface SubscriptionManager
onStateChangeListener
- to remove