Interface XdsClient.ResourceWatcher<T extends XdsClient.ResourceUpdate>

All Known Implementing Classes:
CdsLoadBalancer2.CdsLbState.ClusterState, ClusterResolverLoadBalancer.ClusterResolverLbState.EdsClusterState, XdsNameResolver.ResolveState, XdsNameResolver.ResolveState.RouteDiscoveryState, XdsServerWrapper.DiscoveryState, XdsServerWrapper.DiscoveryState.RouteDiscoveryState
Enclosing class:
XdsClient

@ExperimentalApi("https://github.com/grpc/grpc-java/issues/10862") public static interface XdsClient.ResourceWatcher<T extends XdsClient.ResourceUpdate>
Watcher interface for a single requested xDS resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onChanged(T update)
     
    void
    onError(io.grpc.Status error)
    Called when the resource discovery RPC encounters some transient error.
    void
    Called when the requested resource is not available.
  • Method Details

    • onError

      void onError(io.grpc.Status error)
      Called when the resource discovery RPC encounters some transient error.

      Note that we expect that the implementer to: - Comply with the guarantee to not generate certain statuses by the library: https://grpc.github.io/grpc/core/md_doc_statuscodes.html. If the code needs to be propagated to the channel, override it with Status.Code.UNAVAILABLE. - Keep Status description in one form or another, as it contains valuable debugging information.

    • onResourceDoesNotExist

      void onResourceDoesNotExist(String resourceName)
      Called when the requested resource is not available.
      Parameters:
      resourceName - name of the resource requested in discovery request.
    • onChanged

      void onChanged(T update)