- 2.59.0 (latest)
- 2.58.0
- 2.57.0
- 2.55.0
- 2.54.1
- 2.53.0
- 2.52.0
- 2.51.0
- 2.50.0
- 2.49.0
- 2.48.1
- 2.47.0
- 2.46.1
- 2.45.0
- 2.43.0
- 2.42.0
- 2.41.0
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.0
- 2.35.0
- 2.34.1
- 2.33.0
- 2.32.1
- 2.31.1
- 2.30.1
- 2.24.0
- 2.23.3
- 2.22.0
- 2.21.0
- 2.20.1
- 2.19.6
- 2.18.7
- 2.17.0
- 2.16.0
- 2.15.0
- 2.14.0
- 2.13.0
- 2.12.2
- 2.11.0
- 2.10.0
- 2.9.0
- 2.8.1
- 2.7.1
public abstract class StateCheckingResponseObserver<V> implements ResponseObserver<V>
Base implementation of ResponseObserver that performs state sanity checks.
Implements
com.google.api.gax.rpc.ResponseObserver<V>Type Parameter | |
---|---|
Name | Description |
V |
Constructors
StateCheckingResponseObserver()
public StateCheckingResponseObserver()
Methods
onComplete()
public final void onComplete()
Receives a notification of successful stream completion.
May only be called once, and if called, it must be the last method called. In particular, if
an exception is thrown by an implementation of onComplete
, no further calls to any
method are allowed.
This implementation simply delegates to #onCompleteImpl() after ensuring consistent state.
onCompleteImpl()
protected abstract void onCompleteImpl()
See Also: #onComplete()
onError(Throwable t)
public final void onError(Throwable t)
Receives a terminating error from the stream.
May only be called once, and if called, it must be the last method called. In particular, if
an exception is thrown by an implementation of onError
, no further calls to any method
are allowed.
This implementation simply delegates to #onErrorImpl(Throwable) after ensuring consistent state.
Parameter | |
---|---|
Name | Description |
t | Throwable |
onErrorImpl(Throwable t)
protected abstract void onErrorImpl(Throwable t)
See Also: #onErrorImpl(Throwable)
Parameter | |
---|---|
Name | Description |
t | Throwable |
onResponse(V response)
public final void onResponse(V response)
Receives a value from the stream.
Can be called many times but is never called after #onError(Throwable) or #onComplete() are called.
Clients may may receive 0 or more onResponse callbacks.
If an exception is thrown by an implementation the caller will terminate the stream by calling #onError(Throwable) with the caught exception as the cause.
This implementation simply delegates to #onResponseImpl(Object) after ensuring consistent state.
Parameter | |
---|---|
Name | Description |
response | V |
onResponseImpl(V response)
protected abstract void onResponseImpl(V response)
See Also: #onResponse(Object)
Parameter | |
---|---|
Name | Description |
response | V |
onStart(StreamController controller)
public final void onStart(StreamController controller)
Called before the stream is started. This must be invoked synchronously on the same thread that called ServerStreamingCallable#call(Object, ResponseObserver, ApiCallContext)
Allows for disabling flow control and early stream termination via StreamController
.
This implementation simply delegates to #onStartImpl(StreamController) after ensuring consistent state.
Parameter | |
---|---|
Name | Description |
controller | StreamController |
onStartImpl(StreamController controller)
protected abstract void onStartImpl(StreamController controller)
See Also: #onStart(StreamController)
Parameter | |
---|---|
Name | Description |
controller | StreamController |