public class AsyncPutListener extends Object implements FlightClient.PutListener
To handle messages, create an instance of this class overriding onNext(PutResult)
. The other methods
should not be overridden.
Constructor and Description |
---|
AsyncPutListener() |
Modifier and Type | Method and Description |
---|---|
void |
getResult()
Wait for the stream to finish on the server side.
|
boolean |
isCancelled()
Check if the call has been cancelled.
|
void |
onCompleted()
Indicate that the transmission is finished.
|
void |
onError(Throwable t)
Indicate an error to the client.
|
void |
onNext(PutResult val)
Called when a message from the server is received.
|
public final void getResult()
getResult
in interface FlightClient.PutListener
public void onNext(PutResult val)
FlightClient.PutListener
onNext
in interface FlightClient.PutListener
onNext
in interface FlightProducer.StreamListener<PutResult>
val
- The application metadata. This buffer will be reclaimed once onNext returns; you must retain a
reference to use it outside this method.public final void onError(Throwable t)
FlightProducer.StreamListener
Terminates the stream; do not call FlightProducer.StreamListener.onCompleted()
.
onError
in interface FlightProducer.StreamListener<PutResult>
public final void onCompleted()
FlightProducer.StreamListener
onCompleted
in interface FlightProducer.StreamListener<PutResult>
public boolean isCancelled()
FlightClient.PutListener
By default, this always returns false. Implementations should provide an appropriate implementation, as otherwise, a DoPut operation may inadvertently block forever.
isCancelled
in interface FlightClient.PutListener
Copyright © 2023 The Apache Software Foundation. All rights reserved.