Class AggregationStrategyClause<T>

java.lang.Object
org.apache.camel.builder.AggregationStrategyClause<T>
All Implemented Interfaces:
org.apache.camel.AggregationStrategy
Direct Known Subclasses:
EnrichClause

public class AggregationStrategyClause<T> extends Object implements org.apache.camel.AggregationStrategy
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.camel.Exchange
    aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange)
     
    org.apache.camel.Exchange
    aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange, org.apache.camel.Exchange inputExchange)
     
    <B> T
    body(Class<B> type, BiFunction<B,B,Object> function)
    Define an aggregation strategy which targets Exchanges In Body.
    <O, N> T
    body(Class<O> oldType, Class<N> newType, BiFunction<O,N,Object> function)
    Define an aggregation strategy which targets Exchanges In Body.
    Define an aggregation strategy which targets Exchanges In Body.
    exchange(BiFunction<org.apache.camel.Exchange,org.apache.camel.Exchange,org.apache.camel.Exchange> function)
    Define an aggregation strategy which targets the exchnage.
    message(BiFunction<org.apache.camel.Message,org.apache.camel.Message,org.apache.camel.Message> function)
    Define an aggregation strategy which targets Exchanges In Message.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.camel.AggregationStrategy

    canPreComplete, onCompletion, onCompletion, onOptimisticLockFailure, preComplete, timeout
  • Constructor Details

    • AggregationStrategyClause

      public AggregationStrategyClause(T parent)
  • Method Details

    • aggregate

      public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange)
      Specified by:
      aggregate in interface org.apache.camel.AggregationStrategy
    • aggregate

      public org.apache.camel.Exchange aggregate(org.apache.camel.Exchange oldExchange, org.apache.camel.Exchange newExchange, org.apache.camel.Exchange inputExchange)
      Specified by:
      aggregate in interface org.apache.camel.AggregationStrategy
    • exchange

      public T exchange(BiFunction<org.apache.camel.Exchange,org.apache.camel.Exchange,org.apache.camel.Exchange> function)
      Define an aggregation strategy which targets the exchnage.
    • message

      public T message(BiFunction<org.apache.camel.Message,org.apache.camel.Message,org.apache.camel.Message> function)
      Define an aggregation strategy which targets Exchanges In Message.
       
       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);
      
                   return old;
               });
       
       
    • body

      public T body(BiFunction<Object,Object,Object> function)
      Define an aggregation strategy which targets Exchanges In Body.
       
       from("direct:aggregate")
           .aggregate()
               .body((old, new) -> {
                   if (old == null) {
                       return new;
                   }
      
                   return old.toString() + new.toString();
               });
       
       
    • body

      public <B> T body(Class<B> type, BiFunction<B,B,Object> function)
      Define an aggregation strategy which targets Exchanges In Body.
       
       from("direct:aggregate")
           .aggregate()
               .body(String.class, (old, new) -> {
                   if (old == null) {
                       return new;
                   }
      
                   return old + new;
               });
       
       
    • body

      public <O, N> T body(Class<O> oldType, Class<N> newType, BiFunction<O,N,Object> function)
      Define an aggregation strategy which targets Exchanges In Body.