use of org.apache.camel.Navigate in project camel by apache.
the class NavigateRouteTest method navigateRoute.
@SuppressWarnings("unchecked")
private void navigateRoute(Navigate<Processor> nav) {
if (!nav.hasNext()) {
return;
}
for (Processor child : nav.next()) {
count++;
if (child instanceof SendProcessor) {
SendProcessor send = (SendProcessor) child;
assertEquals("mock://result", send.getDestination().getEndpointUri());
}
if (child instanceof ConvertBodyProcessor) {
ConvertBodyProcessor convert = (ConvertBodyProcessor) child;
assertEquals(String.class, convert.getType());
}
// navigate children
if (child instanceof Navigate) {
navigateRoute((Navigate<Processor>) child);
}
}
}
use of org.apache.camel.Navigate in project camel by apache.
the class EventDrivenConsumerRoute method doFilter.
@SuppressWarnings("unchecked")
private void doFilter(String pattern, Navigate<Processor> nav, List<Processor> match) {
List<Processor> list = nav.next();
if (list != null) {
for (Processor proc : list) {
String id = null;
if (proc instanceof IdAware) {
id = ((IdAware) proc).getId();
}
if (EndpointHelper.matchPattern(id, pattern)) {
match.add(proc);
}
if (proc instanceof Navigate) {
Navigate<Processor> child = (Navigate<Processor>) proc;
doFilter(pattern, child, match);
}
}
}
}