Repository: camel Updated Branches: refs/heads/master a7d3695ed -> 8e42a7bd3
Add missing javadoc for java8 dsl Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8e42a7bd Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8e42a7bd Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8e42a7bd Branch: refs/heads/master Commit: 8e42a7bd3381d6ea7967dfa416e5aa1884c241a1 Parents: a7d3695 Author: lburgazzoli <lburgazz...@gmail.com> Authored: Thu Apr 13 15:28:07 2017 +0200 Committer: lburgazzoli <lburgazz...@gmail.com> Committed: Thu Apr 13 15:28:15 2017 +0200 ---------------------------------------------------------------------- .../src/main/docs/eips/aggregate-eip.adoc | 2 +- .../src/main/java/org/apache/camel/Message.java | 16 +++-- .../builder/AggregationStrategyClause.java | 55 +++++++++++---- .../org/apache/camel/builder/EnrichClause.java | 2 +- .../apache/camel/builder/ExpressionClause.java | 24 ------- .../apache/camel/builder/PredicateClause.java | 71 +++++++++++++------ .../org/apache/camel/builder/ProcessClause.java | 65 ++++++++++++------ .../org/apache/camel/cloud/LoadBalancer.java | 3 - .../camel/cloud/LoadBalancerFunction.java | 2 - .../apache/camel/model/AggregateDefinition.java | 29 ++------ .../apache/camel/model/MulticastDefinition.java | 10 +-- .../apache/camel/model/ProcessorDefinition.java | 72 +++++++++++--------- .../camel/model/RecipientListDefinition.java | 5 +- .../org/apache/camel/util/StringHelper.java | 3 +- 14 files changed, 202 insertions(+), 157 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/docs/eips/aggregate-eip.adoc ---------------------------------------------------------------------- diff --git a/camel-core/src/main/docs/eips/aggregate-eip.adoc b/camel-core/src/main/docs/eips/aggregate-eip.adoc index f70b6bb..9d87dde 100644 --- a/camel-core/src/main/docs/eips/aggregate-eip.adoc +++ b/camel-core/src/main/docs/eips/aggregate-eip.adoc @@ -26,7 +26,7 @@ The Aggregate EIP supports 25 options which are listed below: |======================================================================= | Name | Java Type | Description | correlationExpression | NamespaceAwareExpression | *Required* The expression used to calculate the correlation key to use for aggregation. The Exchange which has the same correlation key is aggregated together. If the correlation key could not be evaluated an Exception is thrown. You can disable this by using the ignoreBadCorrelationKeys option. -| completionPredicate | NamespaceAwareExpression | TODO: document Note: this is experimental and subject to changes in future releases. +| completionPredicate | NamespaceAwareExpression | Sets the predicate used to determine if the aggregation is completed with a fluent builder | completionTimeout | NamespaceAwareExpression | Time in millis that an aggregated exchange should be inactive before its complete (timeout). This option can be set as either a fixed value or using an Expression which allows you to evaluate a timeout dynamically - will use Long as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. You cannot use this option together with completionInterval only one of the two can be used. | completionSize | NamespaceAwareExpression | Number of messages aggregated before the aggregation is complete. This option can be set as either a fixed value or using an Expression which allows you to evaluate a size dynamically - will use Integer as result. If both are set Camel will fallback to use the fixed value if the Expression result was null or 0. | optimisticLockRetryPolicy | OptimisticLockRetryPolicyDefinition | Allows to configure retry settings when using optimistic locking. http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/Message.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/Message.java b/camel-core/src/main/java/org/apache/camel/Message.java index ac4a7af..3425ae6 100644 --- a/camel-core/src/main/java/org/apache/camel/Message.java +++ b/camel-core/src/main/java/org/apache/camel/Message.java @@ -88,9 +88,12 @@ public interface Message { Object getHeader(String name, Object defaultValue); /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * Accesses a specific header * + * @param name name of header + * @param defaultValueSupplier the default value supplier used to generate the value to return if header was absent + * @return the value of the given header or he value generated by the <tt>defaultValueSupplier</tt> if there is no + * header for the given name */ Object getHeader(String name, Supplier<Object> defaultValueSupplier); @@ -119,9 +122,14 @@ public interface Message { <T> T getHeader(String name, Object defaultValue, Class<T> type); /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * Returns a header associated with this message by name and specifying the + * type required * + * @param name the name of the header + * @param defaultValueSupplier the default value supplier used to generate the value to return if header was absent + * @param type the type of the header + * @return the value of the given header or he value generated by the <tt>defaultValueSupplier</tt> if there is no + * header for the given name or <tt>null</tt> if it cannot be converted to the given type */ <T> T getHeader(String name, Supplier<Object> defaultValueSupplier, Class<T> type); http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/builder/AggregationStrategyClause.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/builder/AggregationStrategyClause.java b/camel-core/src/main/java/org/apache/camel/builder/AggregationStrategyClause.java index 81114c4..2146c2c 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/AggregationStrategyClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/AggregationStrategyClause.java @@ -43,9 +43,7 @@ public class AggregationStrategyClause<T> implements AggregationStrategy { // ******************************* /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define an aggregation strategy which targets the exchnage. */ public T exchange(final BiFunction<Exchange, Exchange, Exchange> function) { strategy = function::apply; @@ -57,9 +55,24 @@ public class AggregationStrategyClause<T> implements AggregationStrategy { // ******************************* /** - * TODO: document + * Define an aggregation strategy which targets Exchanges In Message. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .aggregate() + * .message((old, new) -> { + * if (old == null) { + * return new; + * } + * + * String oldBody = old.getBody(String.class); + * String newBody = new.getBody(String.class); + * + * old.setBody(oldBody + "+" + newBody); * - * Note: this is experimental and subject to changes in future releases. + * return old; + * }); + * }</pre></blockquote> */ public T message(final BiFunction<Message, Message, Message> function) { return exchange((Exchange oldExchange, Exchange newExchange) -> { @@ -82,27 +95,45 @@ public class AggregationStrategyClause<T> implements AggregationStrategy { // ******************************* /** - * TODO: document + * Define an aggregation strategy which targets Exchanges In Body. * - * Note: this is experimental and subject to changes in future releases. + * <blockquote><pre>{@code + * from("direct:aggregate") + * .aggregate() + * .body((old, new) -> { + * if (old == null) { + * return new; + * } + * + * return old.toString() + new.toString(); + * }); + * }</pre></blockquote> */ public T body(final BiFunction<Object, Object, Object> function) { return body(Object.class, function); } /** - * TODO: document + * Define an aggregation strategy which targets Exchanges In Body. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .aggregate() + * .body(String.class, (old, new) -> { + * if (old == null) { + * return new; + * } * - * Note: this is experimental and subject to changes in future releases. + * return old + new; + * }); + * }</pre></blockquote> */ public <B> T body(final Class<B> type, final BiFunction<B, B, Object> function) { return body(type, type, function); } /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define an aggregation strategy which targets Exchanges In Body. */ public <O, N> T body(final Class<O> oldType, final Class<N> newType, final BiFunction<O, N, Object> function) { return exchange((Exchange oldExchange, Exchange newExchange) -> { http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/builder/EnrichClause.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/builder/EnrichClause.java b/camel-core/src/main/java/org/apache/camel/builder/EnrichClause.java index 90221a8..4bee31f 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/EnrichClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/EnrichClause.java @@ -18,7 +18,7 @@ package org.apache.camel.builder; import org.apache.camel.model.ProcessorDefinition; -// TODO: Document me + public class EnrichClause<T extends ProcessorDefinition<?>> extends AggregationStrategyClause<T> { public EnrichClause(T parent) { http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java index 610c422..07e9c85 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionClause.java @@ -73,8 +73,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of the exchange - * - * Note: this is experimental and subject to changes in future releases. */ public T exchange(final Function<Exchange, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -93,8 +91,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message - * - * Note: this is experimental and subject to changes in future releases. */ public T message(final Function<Message, Object> function) { return inMessage(function); @@ -109,8 +105,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message - * - * Note: this is experimental and subject to changes in future releases. */ public T inMessage(final Function<Message, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -129,8 +123,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an outbound message - * - * Note: this is experimental and subject to changes in future releases. */ public T outMessage(final Function<Message, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -149,8 +141,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message body - * - * Note: this is experimental and subject to changes in future releases. */ public T body(final Function<Object, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -162,8 +152,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message body and headers - * - * Note: this is experimental and subject to changes in future releases. */ public T body(final BiFunction<Object, Map<String, Object>, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -184,8 +172,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message body converted to the expected type - * - * Note: this is experimental and subject to changes in future releases. */ public <B> T body(Class<B> expectedType, final Function<B, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -197,8 +183,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an inbound message body converted to the expected type and headers - * - * Note: this is experimental and subject to changes in future releases. */ public <B> T body(Class<B> expectedType, final BiFunction<B, Map<String, Object>, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -219,8 +203,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an outbound message body - * - * Note: this is experimental and subject to changes in future releases. */ public T outBody(final Function<Object, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -232,8 +214,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an outbound message body and headers - * - * Note: this is experimental and subject to changes in future releases. */ public T outBody(final BiFunction<Object, Map<String, Object>, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -254,8 +234,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an outbound message body converted to the expected type - * - * Note: this is experimental and subject to changes in future releases. */ public <B> T outBody(Class<B> expectedType, final Function<B, Object> function) { return delegate.expression(new ExpressionAdapter() { @@ -267,8 +245,6 @@ public class ExpressionClause<T> extends ExpressionDefinition { /** * A functional expression of an outbound message body converted to the expected type and headers - * - * Note: this is experimental and subject to changes in future releases. */ public <B> T outBody(Class<B> expectedType, final BiFunction<B, Map<String, Object>, Object> function) { return delegate.expression(new ExpressionAdapter() { http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/builder/PredicateClause.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/builder/PredicateClause.java b/camel-core/src/main/java/org/apache/camel/builder/PredicateClause.java index 20ae9d5..c151dd8 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/PredicateClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/PredicateClause.java @@ -23,7 +23,6 @@ import java.util.function.Predicate; import org.apache.camel.Exchange; import org.apache.camel.Message; -// TODO: Document me public class PredicateClause<T> implements org.apache.camel.Predicate { private final T parent; private Predicate<Exchange> predicate; @@ -43,9 +42,7 @@ public class PredicateClause<T> implements org.apache.camel.Predicate { // ******************************* /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the Exchange. */ public T exchange(final Predicate<Exchange> predicate) { this.predicate = predicate::test; @@ -58,9 +55,16 @@ public class PredicateClause<T> implements org.apache.camel.Predicate { // ******************************* /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the Exchange In Message. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .choice() + * .when() + * .message(m -> m.getBody() != null) + * .log("Received ${body}") + * .endChoice() + * }</pre></blockquote> */ public T message(final Predicate<Message> predicate) { return exchange(e -> predicate.test(e.getIn())); @@ -70,28 +74,50 @@ public class PredicateClause<T> implements org.apache.camel.Predicate { // Body // ******************************* + /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the Exchange In Body. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .choice() + * .when() + * .body(b -> b != null) + * .log("Received ${body}") + * .endChoice() + * }</pre></blockquote> */ public T body(final Predicate<Object> predicate) { return exchange(e -> predicate.test(e.getIn().getBody())); } /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the typed Exchange In Body. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .choice() + * .when() + * .body(Long.class, b -> (b & 1) == 0) + * .log("Received even number ${body}") + * .endChoice() + * }</pre></blockquote> */ public <B> T body(final Class<B> type, final Predicate<B> predicate) { return exchange(e -> predicate.test(e.getIn().getBody(type))); } /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the Exchange In Body and its Headers. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .choice() + * .when() + * .body((b, h) -> b != null || h.containsKy("ToProcess")) + * .log("Received ${body}") + * .endChoice() + * }</pre></blockquote> */ public T body(final BiPredicate<Object, Map<String, Object>> predicate) { return exchange(e -> predicate.test( @@ -101,9 +127,16 @@ public class PredicateClause<T> implements org.apache.camel.Predicate { } /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link org.apache.camel.Predicate} which targets the typed Exchange In Body and its Headers. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .choice() + * .when() + * .body(String.class, (b, h) -> b != null && !b.isEmpty() || h.containsKy("ToProcess")) + * .log("Received ${body}") + * .endChoice() + * }</pre></blockquote> */ public <B> T body(final Class<B> type, final BiPredicate<B, Map<String, Object>> predicate) { return exchange(e -> predicate.test( http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java b/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java index 7840876..7bb5ca6 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/ProcessClause.java @@ -24,7 +24,6 @@ import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; -// TODO: Document me public class ProcessClause<T> implements Processor { private final T parent; private Processor processor; @@ -45,9 +44,7 @@ public class ProcessClause<T> implements Processor { // ******************************* /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the Exchange. */ public T exchange(final Consumer<Exchange> consumer) { processor = consumer::accept; @@ -58,11 +55,15 @@ public class ProcessClause<T> implements Processor { // ******************************* // Message // ******************************* - + /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the Exchange In Message. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .process() + * .message(m -> m.setHeader("HasBody", m.getBody() != null)); + * }</pre></blockquote> */ public T message(final Consumer<Message> consumer) { processor = e -> consumer.accept(e.getIn()); @@ -74,9 +75,13 @@ public class ProcessClause<T> implements Processor { // ******************************* /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the Exchange In Body. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .process() + * .body(System.out::println); + * }</pre></blockquote> */ public T body(final Consumer<Object> consumer) { processor = e -> consumer.accept(e.getIn().getBody()); @@ -84,19 +89,27 @@ public class ProcessClause<T> implements Processor { } /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the typed Exchange In Body. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .process() + * .body(MyObject.class, MyObject::dumpToStdOut); + * }</pre></blockquote> */ public <B> T body(Class<B> type, final Consumer<B> consumer) { processor = e -> consumer.accept(e.getIn().getBody(type)); return parent; } - + /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the Exchange In Body and its Headers. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .process() + * .body((b, h) -> h.put("ClassName", b.getClass().getName())); + * }</pre></blockquote> */ public T body(final BiConsumer<Object, Map<String, Object>> consumer) { processor = e -> consumer.accept( @@ -105,11 +118,19 @@ public class ProcessClause<T> implements Processor { ); return parent; } - + /** - * TODO: document - * - * Note: this is experimental and subject to changes in future releases. + * Define a {@link Processor} which targets the typed Exchange In Body and its Headers. + * + * <blockquote><pre>{@code + * from("direct:aggregate") + * .process() + * .body(MyObject.class, (b, h) -> { + * if (h.containsKey("dump")) { + * b.dumpToStdOut(); + * } + * }); + * }</pre></blockquote> */ public <B> T body(Class<B> type, final BiConsumer<B, Map<String, Object>> consumer) { processor = e -> consumer.accept( http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancer.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancer.java b/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancer.java index 54c0e35..5974baf 100644 --- a/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancer.java +++ b/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancer.java @@ -25,8 +25,5 @@ package org.apache.camel.cloud; */ @FunctionalInterface public interface LoadBalancer { - - // TODO: Document me <T> T process(String serviceName, LoadBalancerFunction<T> function) throws Exception; - } http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancerFunction.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancerFunction.java b/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancerFunction.java index 6afb2b3..b1a96d6 100644 --- a/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancerFunction.java +++ b/camel-core/src/main/java/org/apache/camel/cloud/LoadBalancerFunction.java @@ -21,7 +21,5 @@ package org.apache.camel.cloud; */ @FunctionalInterface public interface LoadBalancerFunction<T> { - - // TODO: Document me T apply(ServiceDefinition serviceDefinition) throws Exception; } http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java index 12f0a13..96517df 100644 --- a/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/AggregateDefinition.java @@ -792,10 +792,7 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the AggregationStrategy to use with a fluent builder. */ public AggregationStrategyClause<AggregateDefinition> aggregationStrategy() { AggregationStrategyClause<AggregateDefinition> clause = new AggregationStrategyClause<>(this); @@ -804,19 +801,16 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the AggregationStrategy to use with a fluent builder. */ public AggregationStrategyClause<AggregateDefinition> strategy() { return aggregationStrategy(); } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * Sets the aggregate strategy to use * + * @param aggregationStrategy the aggregate strategy to use * @return the builder */ public AggregateDefinition strategy(AggregationStrategy aggregationStrategy) { @@ -916,10 +910,7 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the predicate used to determine if the aggregation is completed with a fluent builder */ @AsPredicate public PredicateClause<AggregateDefinition> completionPredicate() { @@ -929,10 +920,7 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the predicate used to determine if the aggregation is completed with a fluent builder */ @AsPredicate public PredicateClause<AggregateDefinition> completion() { @@ -940,10 +928,7 @@ public class AggregateDefinition extends ProcessorDefinition<AggregateDefinition } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the predicate used to determine if the aggregation is completed */ public AggregateDefinition completion(@AsPredicate Predicate predicate) { return completionPredicate(predicate); http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java b/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java index 37efcc6..1c1b6ec 100644 --- a/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/MulticastDefinition.java @@ -108,10 +108,7 @@ public class MulticastDefinition extends OutputDefinition<MulticastDefinition> i // ------------------------------------------------------------------------- /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the AggregationStrategy to be used to assemble the replies from the multicasts, into a single outgoing message from the Multicast using a fluent builder. */ public AggregationStrategyClause<MulticastDefinition> aggregationStrategy() { AggregationStrategyClause<MulticastDefinition> clause = new AggregationStrategyClause<>(this); @@ -262,10 +259,7 @@ public class MulticastDefinition extends OutputDefinition<MulticastDefinition> i } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Set the {@link Processor} to use when preparing the {@link org.apache.camel.Exchange} to be send using a fluent builder. */ public ProcessClause<MulticastDefinition> onPrepare() { ProcessClause<MulticastDefinition> clause = new ProcessClause<>(this); http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java index 78a80e1..500b043 100644 --- a/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java @@ -1413,10 +1413,8 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * <a href="http://camel.apache.org/idempotent-consumer.html">Idempotent consumer EIP:</a> + * Creates an {@link org.apache.camel.processor.idempotent.IdempotentConsumer IdempotentConsumer} using a fluent builder. */ public ExpressionClause<IdempotentConsumerDefinition> idempotentConsumer() { IdempotentConsumerDefinition answer = new IdempotentConsumerDefinition(); @@ -2194,8 +2192,8 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * <a href="http://camel.apache.org/throttler.html">Throttler EIP:</a> + * Creates a throttler using a fluent builder. * * @return the builder */ @@ -2280,8 +2278,9 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * <a href="http://camel.apache.org/loop.html">Loop EIP:</a> + * Creates a loop allowing to process the a message a number of times and possibly process them + * in a different way using a fluent builder. * * @return the builder */ @@ -2749,8 +2748,9 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * <a href="http://camel.apache.org/message-translator.html">Message Translator EIP:</a> + * Adds the custom processor using a fluent builder to this destination which could be a final + * destination, or could be a transformation in a pipeline * * @return the builder */ @@ -3413,10 +3413,19 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> and + * with an aggregation strategy created using a fluent builder. + * + * <blockquote><pre>{@code + * fom("direct:start") + * .enrichWith("direct:resource") + * .body(String.class, (o, n) -> n + o); + * }</pre></blockquote> * + * @param resourceUri URI of resource endpoint for obtaining additional data. * @return the builder + * @see org.apache.camel.processor.Enricher */ public EnrichClause<ProcessorDefinition<Type>> enrichWith(@AsEndpointUri String resourceUri) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); @@ -3425,10 +3434,9 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> and + * with an aggregation strategy created using a fluent builder. */ public EnrichClause<ProcessorDefinition<Type>> enrichWith(@AsEndpointUri String resourceUri, boolean aggregateOnException) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); @@ -3437,10 +3445,9 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> and + * with an aggregation strategy created using a fluent builder. */ public EnrichClause<ProcessorDefinition<Type>> enrichWith(@AsEndpointUri String resourceUri, boolean aggregateOnException, boolean shareUnitOfWork) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); @@ -3652,12 +3659,11 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> return pollEnrich(resourceUri, timeout, aggregationStrategyRef, false); } - /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> + * and with an aggregation strategy created using a fluent builder using + * a {@link org.apache.camel.PollingConsumer} to poll the endpoint. */ public EnrichClause<ProcessorDefinition<Type>> pollEnrichWith(@AsEndpointUri String resourceUri) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); @@ -3666,10 +3672,10 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> + * and with an aggregation strategy created using a fluent builder using + * a {@link org.apache.camel.PollingConsumer} to poll the endpoint. */ public EnrichClause<ProcessorDefinition<Type>> pollEnrichWith(@AsEndpointUri String resourceUri, long timeout) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); @@ -3678,10 +3684,10 @@ public abstract class ProcessorDefinition<Type extends ProcessorDefinition<Type> } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * The <a href="http://camel.apache.org/content-enricher.html">Content Enricher EIP</a> + * enriches an exchange with additional data obtained from a <code>resourceUri</code> + * and with an aggregation strategy created using a fluent builder using + * a {@link org.apache.camel.PollingConsumer} to poll the endpoint. */ public EnrichClause<ProcessorDefinition<Type>> pollEnrichWith(@AsEndpointUri String resourceUri, long timeout, boolean aggregateOnException) { EnrichClause<ProcessorDefinition<Type>> clause = new EnrichClause<>(this); http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java b/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java index 1ae0d9c..391a093 100644 --- a/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java +++ b/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java @@ -401,10 +401,7 @@ public class RecipientListDefinition<Type extends ProcessorDefinition<Type>> ext } /** - * TODO: document - * Note: this is experimental and subject to changes in future releases. - * - * @return the builder + * Sets the {@link Processor} when preparing the {@link org.apache.camel.Exchange} to be used send using a fluent buidler. */ public ProcessClause<RecipientListDefinition<Type>> onPrepare() { ProcessClause<RecipientListDefinition<Type>> clause = new ProcessClause<>(this); http://git-wip-us.apache.org/repos/asf/camel/blob/8e42a7bd/camel-core/src/main/java/org/apache/camel/util/StringHelper.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/util/StringHelper.java b/camel-core/src/main/java/org/apache/camel/util/StringHelper.java index c3f987f..635c07f 100644 --- a/camel-core/src/main/java/org/apache/camel/util/StringHelper.java +++ b/camel-core/src/main/java/org/apache/camel/util/StringHelper.java @@ -341,8 +341,7 @@ public final class StringHelper { return value; } - - // TODO: add javadoc + public static String[] splitOnCharacter(String value, String needle, int count) { String rc[] = new String[count]; rc[0] = value;