Interface RoutingTree<A>

Type Parameters:
A - generic attribute type
All Superinterfaces:
Route

@API(status=STABLE) public interface RoutingTree<A> extends Route
A routing tree is a nested route that consists of a navigator and a set of bindings. When being executed the navigator will select the attribute value of the returned response, find the correct binding and execute it's route. Since a routing tree is a route itself they can be nested recursively inside each other to produce complex graphs.
See Also:
  • Method Details

    • getNavigator

      Navigator<A> getNavigator()
    • keySet

      Set<A> keySet()
    • get

      Optional<Route> get(A attribute)
    • getWildcard

      Optional<Route> getWildcard()
    • execute

      void execute(org.springframework.http.client.ClientHttpResponse response, MessageReader reader) throws Exception
      Description copied from interface: Route
      Executes this route against the specific response. It's within the responsibility of a route implementation to ensure the stream is consumed (optional) and properly closed. A fully consumed response stream allows for connection reuse and is therefore highly encouraged. Making sure that every response is properly closed ensures that stale connections are not exhausting the connection pool. Most routes will do both operations internally, but the responsibility can be handed over to the caller of the route by unmarshalling the stream into a Closeable or AutoCloseable bean.
      Specified by:
      execute in interface Route
      Parameters:
      response - the client response
      reader - a utility to unmarshall the response into Java beans
      Throws:
      NoWildcardException - if no route, not even a wildcard, exists for the given response
      Exception - if anything goes wrong during route execution, primarily used for IOException
    • merge

      @API(status=EXPERIMENTAL) default RoutingTree<A> merge(Binding<A> binding)
    • merge

      @API(status=EXPERIMENTAL) default RoutingTree<A> merge(List<Binding<A>> bindings)
    • merge

      default Route merge(Route route)
      Specified by:
      merge in interface Route
    • merge

      @API(status=EXPERIMENTAL) default RoutingTree<A> merge(RoutingTree<A> other)
    • dispatch

      @SafeVarargs static <A> RoutingTree<A> dispatch(Navigator<A> navigator, Binding<A>... bindings)
    • dispatch

      static <A> RoutingTree<A> dispatch(Navigator<A> navigator, List<Binding<A>> bindings)