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 void
allowFlow(FlowControlRequest clientRequest)
protected void
handlePermanentError(CheckedApiException error)
void
onClientResponse(List<SequencedMessage> messages)
void
reset()
protected void
start()
protected void
stop()
void
triggerReinitialize(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:
start
in classProxyService
-
stop
protected void stop()
- Overrides:
stop
in classProxyService
-
handlePermanentError
protected void handlePermanentError(CheckedApiException error)
- Overrides:
handlePermanentError
in classProxyService
-
allowFlow
public void allowFlow(FlowControlRequest clientRequest) throws CheckedApiException
- Specified by:
allowFlow
in interfaceSubscriber
- Throws:
CheckedApiException
-
reset
public void reset()
-
triggerReinitialize
public void triggerReinitialize(CheckedApiException streamError)
- Specified by:
triggerReinitialize
in interfaceRetryingConnectionObserver<List<SequencedMessage>>
-
onClientResponse
public void onClientResponse(List<SequencedMessage> messages) throws CheckedApiException
- Specified by:
onClientResponse
in interfaceRetryingConnectionObserver<List<SequencedMessage>>
- Throws:
CheckedApiException
-
-