Class RealApolloSubscriptionCall<T>
- java.lang.Object
-
- com.apollographql.apollo.internal.RealApolloSubscriptionCall<T>
-
- All Implemented Interfaces:
ApolloSubscriptionCall<T>,Cancelable
public class RealApolloSubscriptionCall<T> extends java.lang.Object implements ApolloSubscriptionCall<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.apollographql.apollo.ApolloSubscriptionCall
ApolloSubscriptionCall.CachePolicy, ApolloSubscriptionCall.Callback<T>, ApolloSubscriptionCall.Factory
-
-
Constructor Summary
Constructors Constructor Description RealApolloSubscriptionCall(com.apollographql.apollo.api.Subscription<?,T,?> subscription, SubscriptionManager subscriptionManager, com.apollographql.apollo.cache.normalized.ApolloStore apolloStore, ApolloSubscriptionCall.CachePolicy cachePolicy, java.util.concurrent.Executor dispatcher, com.apollographql.apollo.api.internal.ApolloLogger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApolloSubscriptionCall<T>cachePolicy(ApolloSubscriptionCall.CachePolicy cachePolicy)Sets the cache policy for response/request cache.voidcancel()Cancels the operation.ApolloSubscriptionCall<T>clone()Creates a new, identical call to this one which can be executed even if this call has already been.voidexecute(ApolloSubscriptionCall.Callback<T> callback)SendsSubscriptionto the subscription server and starts listening for the pushed updates.booleanisCanceled()Checks if this operation has been canceled.
-
-
-
Constructor Detail
-
RealApolloSubscriptionCall
public RealApolloSubscriptionCall(@NotNull com.apollographql.apollo.api.Subscription<?,T,?> subscription, @NotNull SubscriptionManager subscriptionManager, @NotNull com.apollographql.apollo.cache.normalized.ApolloStore apolloStore, @NotNull ApolloSubscriptionCall.CachePolicy cachePolicy, @NotNull java.util.concurrent.Executor dispatcher, @NotNull com.apollographql.apollo.api.internal.ApolloLogger logger)
-
-
Method Detail
-
execute
public void execute(@NotNull ApolloSubscriptionCall.Callback<T> callback) throws ApolloCanceledExceptionDescription copied from interface:ApolloSubscriptionCallSendsSubscriptionto the subscription server and starts listening for the pushed updates. To cancel this subscription call useCancelable.cancel().- Specified by:
executein interfaceApolloSubscriptionCall<T>- Parameters:
callback- which will handle the subscription updates or a failure exception.- Throws:
ApolloCanceledException- when the call has already been canceled
-
cancel
public void cancel()
Description copied from interface:CancelableCancels the operation.- Specified by:
cancelin interfaceCancelable
-
clone
public ApolloSubscriptionCall<T> clone()
Description copied from interface:ApolloSubscriptionCallCreates a new, identical call to this one which can be executed even if this call has already been.- Specified by:
clonein interfaceApolloSubscriptionCall<T>- Overrides:
clonein classjava.lang.Object- Returns:
- The cloned
ApolloSubscriptionCallobject.
-
isCanceled
public boolean isCanceled()
Description copied from interface:CancelableChecks if this operation has been canceled.- Specified by:
isCanceledin interfaceCancelable- Returns:
- true if this operation has been canceled else returns false
-
cachePolicy
@NotNull public ApolloSubscriptionCall<T> cachePolicy(@NotNull ApolloSubscriptionCall.CachePolicy cachePolicy)
Description copied from interface:ApolloSubscriptionCallSets the cache policy for response/request cache.- Specified by:
cachePolicyin interfaceApolloSubscriptionCall<T>- Parameters:
cachePolicy-ApolloSubscriptionCall.CachePolicyto set- Returns:
ApolloSubscriptionCallwith the providedApolloSubscriptionCall.CachePolicy
-
-