A - generic attribute type@API(status=STABLE) public interface RoutingTree<A> extends Route
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.Route| Modifier and Type | Method and Description |
|---|---|
static <A> RoutingTree<A> |
dispatch(Navigator<A> navigator,
Binding<A>... bindings) |
static <A> RoutingTree<A> |
dispatch(Navigator<A> navigator,
List<Binding<A>> bindings) |
void |
execute(org.springframework.http.client.ClientHttpResponse response,
MessageReader reader)
Executes this route against the specific response.
|
Optional<Route> |
get(A attribute) |
Navigator<A> |
getNavigator() |
Optional<Route> |
getWildcard() |
Set<A> |
keySet() |
default RoutingTree<A> |
merge(Binding<A> binding) |
default RoutingTree<A> |
merge(List<Binding<A>> bindings) |
default Route |
merge(Route route) |
default RoutingTree<A> |
merge(RoutingTree<A> other) |
void execute(org.springframework.http.client.ClientHttpResponse response,
MessageReader reader)
throws Exception
Routeroute
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.execute in interface Routeresponse - the client responsereader - a utility to unmarshall the response into Java beansNoWildcardException - if no route, not even a wildcard, exists for the given responseException - if anything goes wrong during route execution, primarily used for IOException@API(status=EXPERIMENTAL) default RoutingTree<A> merge(Binding<A> binding)
@API(status=EXPERIMENTAL) default RoutingTree<A> merge(List<Binding<A>> bindings)
@API(status=EXPERIMENTAL) default RoutingTree<A> merge(RoutingTree<A> other)
@SafeVarargs static <A> RoutingTree<A> dispatch(Navigator<A> navigator, Binding<A>... bindings)
static <A> RoutingTree<A> dispatch(Navigator<A> navigator, List<Binding<A>> bindings)
Copyright © 2015–2020 Zalando SE. All rights reserved.