Class SubscriberImpl
- java.lang.Object
-
- com.google.api.core.AbstractApiService
-
- com.google.cloud.pubsublite.internal.ProxyService
-
- com.google.cloud.pubsublite.internal.wire.SubscriberImpl
-
- All Implemented Interfaces:
com.google.api.core.ApiService,RetryingConnectionObserver<List<SequencedMessage>>,Subscriber
public class SubscriberImpl extends ProxyService implements Subscriber, RetryingConnectionObserver<List<SequencedMessage>>
-
-
Constructor Summary
Constructors Constructor Description SubscriberImpl(StreamFactories.SubscribeStreamFactory streamFactory, InitialSubscribeRequest baseInitialRequest, SeekRequest initialLocation, Consumer<List<SequencedMessage>> messageConsumer, SubscriberResetHandler resetHandler, boolean retryStreamRaces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidallowFlow(FlowControlRequest clientRequest)protected voidhandlePermanentError(CheckedApiException error)voidonClientResponse(List<SequencedMessage> messages)voidreset()protected voidstart()protected voidstop()voidtriggerReinitialize(CheckedApiException streamError)-
Methods inherited from class com.google.cloud.pubsublite.internal.ProxyService
addServices, addServices, doStart, doStop, onPermanentError
-
Methods inherited from class com.google.api.core.AbstractApiService
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync
-
-
-
-
Constructor Detail
-
SubscriberImpl
public SubscriberImpl(StreamFactories.SubscribeStreamFactory streamFactory, InitialSubscribeRequest baseInitialRequest, SeekRequest initialLocation, Consumer<List<SequencedMessage>> messageConsumer, SubscriberResetHandler resetHandler, boolean retryStreamRaces) throws com.google.api.gax.rpc.ApiException
- Throws:
com.google.api.gax.rpc.ApiException
-
-
Method Detail
-
start
protected void start()
- Overrides:
startin classProxyService
-
stop
protected void stop()
- Overrides:
stopin classProxyService
-
handlePermanentError
protected void handlePermanentError(CheckedApiException error)
- Overrides:
handlePermanentErrorin classProxyService
-
allowFlow
public void allowFlow(FlowControlRequest clientRequest) throws CheckedApiException
- Specified by:
allowFlowin interfaceSubscriber- Throws:
CheckedApiException
-
reset
public void reset()
-
triggerReinitialize
public void triggerReinitialize(CheckedApiException streamError)
- Specified by:
triggerReinitializein interfaceRetryingConnectionObserver<List<SequencedMessage>>
-
onClientResponse
public void onClientResponse(List<SequencedMessage> messages) throws CheckedApiException
- Specified by:
onClientResponsein interfaceRetryingConnectionObserver<List<SequencedMessage>>- Throws:
CheckedApiException
-
-