StreamRequestT - The request type sent on the stream.StreamResponseT - The response type sent from the stream.ClientResponseT - The response type sent to the client.public abstract class SingleConnection<StreamRequestT,StreamResponseT,ClientResponseT> extends Object implements com.google.api.gax.rpc.ResponseObserver<StreamResponseT>, AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected static Duration |
DEFAULT_STREAM_IDLE_TIMEOUT |
| Modifier | Constructor and Description |
|---|---|
protected |
SingleConnection(StreamFactory<StreamRequestT,StreamResponseT> streamFactory,
com.google.api.gax.rpc.ResponseObserver<ClientResponseT> clientStream) |
protected |
SingleConnection(StreamFactory<StreamRequestT,StreamResponseT> streamFactory,
com.google.api.gax.rpc.ResponseObserver<ClientResponseT> clientStream,
Duration streamIdleTimeout,
boolean expectInitialResponse) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract void |
handleInitialResponse(StreamResponseT response) |
protected abstract void |
handleStreamResponse(StreamResponseT response) |
protected void |
initialize(StreamRequestT initialRequest) |
protected boolean |
isCompleted() |
void |
onComplete() |
void |
onError(Throwable t) |
void |
onResponse(StreamResponseT response) |
void |
onStart(com.google.api.gax.rpc.StreamController streamController) |
protected void |
sendToClient(ClientResponseT response) |
protected void |
sendToStream(StreamRequestT request) |
protected void |
setError(CheckedApiException error) |
protected static final Duration DEFAULT_STREAM_IDLE_TIMEOUT
protected SingleConnection(StreamFactory<StreamRequestT,StreamResponseT> streamFactory, com.google.api.gax.rpc.ResponseObserver<ClientResponseT> clientStream, Duration streamIdleTimeout, boolean expectInitialResponse)
protected SingleConnection(StreamFactory<StreamRequestT,StreamResponseT> streamFactory, com.google.api.gax.rpc.ResponseObserver<ClientResponseT> clientStream)
protected abstract void handleInitialResponse(StreamResponseT response) throws CheckedApiException
CheckedApiExceptionprotected abstract void handleStreamResponse(StreamResponseT response) throws CheckedApiException
CheckedApiExceptionprotected void initialize(StreamRequestT initialRequest)
protected void sendToStream(StreamRequestT request)
protected void sendToClient(ClientResponseT response)
protected void setError(CheckedApiException error)
protected boolean isCompleted()
public void close()
close in interface AutoCloseablepublic void onStart(com.google.api.gax.rpc.StreamController streamController)
onStart in interface com.google.api.gax.rpc.ResponseObserver<StreamResponseT>public void onResponse(StreamResponseT response)
onResponse in interface com.google.api.gax.rpc.ResponseObserver<StreamResponseT>public void onError(Throwable t)
onError in interface com.google.api.gax.rpc.ResponseObserver<StreamResponseT>public void onComplete()
onComplete in interface com.google.api.gax.rpc.ResponseObserver<StreamResponseT>Copyright © 2023 Google LLC. All rights reserved.