private ExpressionNode fromRetweets() { return from("timer:pollRetweets?fixedRate=true&period={{twitter.pollPeriod}}") .setHeader("statusId", simple("{{twitter.statusId}}")) .to("bean:retweetService").split(body()) .idempotentConsumer(simple("${body}"), idempotentRepository) .skipDuplicate(properties.getSkipDuplicate()) .log("Received retweet from: @${body}").to("direct:retweets"); }
public ManagedFilter(CamelContext context, FilterProcessor processor, ExpressionNode definition) { super(context, processor, definition); this.processor = processor; }
@Override public ExpressionNode getDefinition() { return (ExpressionNode) super.getDefinition(); }
public static <T extends ExpressionNode> ExpressionClause<T> createAndSetExpression(T result) { ExpressionClause<T> clause = new ExpressionClause<T>(result); result.setExpression(clause); return clause; }
@SuppressWarnings({"rawtypes"}) private void findOutputComponents(List<ProcessorDefinition<?>> defs, Set<String> components, Set<String> languages, Set<String> dataformats) { if (defs != null) { for (ProcessorDefinition<?> def : defs) { if (def instanceof SendDefinition) { findUriComponent(((SendDefinition) def).getUri(), components); } if (def instanceof MarshalDefinition) { findDataFormat(((MarshalDefinition) def).getDataFormatType(), dataformats); } if (def instanceof UnmarshalDefinition) { findDataFormat(((UnmarshalDefinition) def).getDataFormatType(), dataformats); } if (def instanceof ExpressionNode) { findLanguage(((ExpressionNode) def).getExpression(), languages); } if (def instanceof ResequenceDefinition) { findLanguage(((ResequenceDefinition) def).getExpression(), languages); } if (def instanceof AggregateDefinition) { findLanguage(((AggregateDefinition) def).getExpression(), languages); findLanguage(((AggregateDefinition) def).getCorrelationExpression(), languages); findLanguage(((AggregateDefinition) def).getCompletionPredicate(), languages); findLanguage(((AggregateDefinition) def).getCompletionTimeoutExpression(), languages); findLanguage(((AggregateDefinition) def).getCompletionSizeExpression(), languages); } if (def instanceof CatchDefinition) { findLanguage(((CatchDefinition) def).getHandled(), languages); } if (def instanceof OnExceptionDefinition) { findLanguage(((OnExceptionDefinition) def).getRetryWhile(), languages); findLanguage(((OnExceptionDefinition) def).getHandled(), languages); findLanguage(((OnExceptionDefinition) def).getContinued(), languages); } if (def instanceof SortDefinition) { findLanguage(((SortDefinition) def).getExpression(), languages); } if (def instanceof WireTapDefinition) { findLanguage(((WireTapDefinition<?>) def).getNewExchangeExpression(), languages); } findOutputComponents(def.getOutputs(), components, languages, dataformats); } } }
private ExpressionNode createFilterDefinition() { return new FilterDefinition(IN_OUT_CHECK) .processRef(VALIDATION.name()) .processRef(TRANSFORMATION.name()) .processRef(VALIDATION.name()); }