Interface XdsBootstrap

All Superinterfaces:
AutoCloseable, SafeCloseable

@UnstableApi public interface XdsBootstrap extends SafeCloseable
An XdsBootstrap encapsulates all logic to communicate with control plane servers to fetch xDS resources locally. Users may choose to watch resources and listen to event updates using this class. The appropriate resources are found from a Bootstrap that can be provided like the following:

 Bootstrap bootstrap = ...;
 XdsBootstrap xdsBootstrap = XdsBootstrap.of(bootstrap);
 ListenerRoot root = xdsBootstrap.listenerRoot("listener1");
 root.addSnapshotWatcher(...);
 root.close();
 
Initializing a XdsBootstrap does not consume any resources until a resource is subscribed via listenerRoot(String) or its variants. Note that it is important to close the ListenerRoot or ClusterRoot after usage to avoid leaking resources. Closing the XdsBootstrap will also close all connections and relevant resources.
  • Method Summary

    Modifier and Type
    Method
    Description
    clusterRoot(String resourceName)
    Represents a Cluster root node of a bootstrap.
    Returns the event loop used to notify events.
    listenerRoot(String resourceName)
    Represents a Listener root node of a bootstrap.
    of(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap)
    Constructs a XdsBootstrap which watches resources using the provided Bootstrap.
    of(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap, EventExecutor eventLoop)
    Constructs a XdsBootstrap which watches resources using the provided Bootstrap.

    Methods inherited from interface com.linecorp.armeria.common.util.SafeCloseable

    close
  • Method Details

    • of

      @UnstableApi static XdsBootstrap of(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap)
      Constructs a XdsBootstrap which watches resources using the provided Bootstrap.
    • of

      @UnstableApi static XdsBootstrap of(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap, EventExecutor eventLoop)
      Constructs a XdsBootstrap which watches resources using the provided Bootstrap.
    • listenerRoot

      ListenerRoot listenerRoot(String resourceName)
      Represents a Listener root node of a bootstrap. Users may hook watchers to the root node to listen to events.
    • clusterRoot

      ClusterRoot clusterRoot(String resourceName)
      Represents a Cluster root node of a bootstrap. Users may hook watchers to the root node to listen to events.
    • eventLoop

      EventExecutor eventLoop()
      Returns the event loop used to notify events.