public class Watch extends Object
Watch is a dedicated stream of configuration resources produced by the configuration cache and consumed by
the xDS server.| Constructor and Description |
|---|
Watch(boolean ads,
Discovery.DiscoveryRequest request,
Consumer<Response> responseConsumer)
Construct a watch.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
ads()
Returns boolean indicating whether or not the watch is for an ADS request.
|
void |
cancel()
Cancel the watch.
|
boolean |
isCancelled()
Returns boolean indicating whether or not the watch has been cancelled.
|
Discovery.DiscoveryRequest |
request()
Returns the original request for the watch.
|
void |
respond(Response response)
Sends the given response to the watch's response handler.
|
void |
setStop(Runnable stop)
Sets the callback method to be executed when the watch is cancelled.
|
public Watch(boolean ads,
Discovery.DiscoveryRequest request,
Consumer<Response> responseConsumer)
ads - is this watch for an ADS request?request - the original request for the watchresponseConsumer - handler for outgoing response messagespublic boolean ads()
public void cancel()
public boolean isCancelled()
public Discovery.DiscoveryRequest request()
public void respond(Response response) throws WatchCancelledException
response - the response to be handledWatchCancelledException - if the watch has already been cancelledpublic void setStop(Runnable stop)
Copyright © 2018 The Envoy Project. All rights reserved.