org.apache.camel.model
Class AggregateDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedDefinition
      extended by org.apache.camel.model.ProcessorDefinition<AggregateDefinition>
          extended by org.apache.camel.model.AggregateDefinition
All Implemented Interfaces:
Block

public class AggregateDefinition
extends ProcessorDefinition<AggregateDefinition>

Represents an XML <aggregate/> element

Version:
$Revision: 17074 $

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
errorHandlerBuilder, errorHandlerRef, log
 
Constructor Summary
AggregateDefinition()
           
AggregateDefinition(Expression correlationExpression)
           
AggregateDefinition(Expression correlationExpression, AggregationStrategy aggregationStrategy)
           
AggregateDefinition(ExpressionDefinition correlationExpression)
           
AggregateDefinition(Predicate predicate)
           
 
Method Summary
 AggregateDefinition aggregationCollection(AggregationCollection aggregationCollection)
          Sets the aggregate collection to use
 AggregateDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
          Sets the aggregate strategy to use
 AggregateDefinition batchSize(int batchSize)
          Sets the in batch size for number of exchanges received
 AggregateDefinition batchSizeFromConsumer()
          Enables the batch completion mode where we aggregate from a BatchConsumer and aggregate the total number of exchanges the BatchConsumer has reported as total by setting the exchange property Exchange.BATCH_SIZE.
 AggregateDefinition batchTimeout(long batchTimeout)
          Sets the batch timeout
protected  void checkNoCompletedPredicate()
           
 AggregateDefinition collectionRef(String collectionRef)
          Sets the aggregate collection to use
 ExpressionClause<AggregateDefinition> completionPredicate()
          Sets the predicate used to determine if the aggregation is completed
 AggregateDefinition completionPredicate(Predicate predicate)
          Sets the predicate used to determine if the aggregation is completed
protected  Aggregator createAggregator(RouteContext routeContext)
           
 ExpressionClause<AggregateDefinition> createAndSetExpression()
           
 Processor createProcessor(RouteContext routeContext)
           
 AggregationCollection getAggregationCollection()
           
 AggregationStrategy getAggregationStrategy()
           
 Integer getBatchSize()
           
 Boolean getBatchSizeFromConsumer()
           
 Long getBatchTimeout()
           
 String getCollectionRef()
           
 ExpressionSubElementDefinition getCompletionPredicate()
           
 ExpressionSubElementDefinition getCorrelationExpression()
           
 ExpressionDefinition getExpression()
           
 Boolean getGroupExchanges()
           
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 Integer getOutBatchSize()
           
 List<ProcessorDefinition> getOutputs()
           
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 String getStrategyRef()
           
 AggregateDefinition groupExchanges()
          Enables grouped exchanges, so the aggregator will group all aggregated exchanges into a single combined Exchange holding all the aggregated exchanges in a List as a exchange property with the key Exchange.GROUPED_EXCHANGE.
 AggregateDefinition outBatchSize(int batchSize)
          Sets the out batch size for number of exchanges sent
 void setAggregationCollection(AggregationCollection aggregationCollection)
           
 void setAggregationStrategy(AggregationStrategy aggregationStrategy)
           
 void setBatchSize(Integer batchSize)
           
 void setBatchSizeFromConsumer(Boolean batchSizeFromConsumer)
           
 void setBatchTimeout(Long batchTimeout)
           
 void setCollectionRef(String collectionRef)
           
 void setCompletionPredicate(ExpressionSubElementDefinition completionPredicate)
           
 void setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)
           
 void setExpression(ExpressionDefinition expression)
           
 void setGroupExchanges(Boolean groupExchanges)
           
 void setOutBatchSize(Integer outBatchSize)
           
 void setOutputs(List<ProcessorDefinition> outputs)
           
 void setStrategyRef(String strategyRef)
           
 AggregateDefinition strategyRef(String strategyRef)
          Sets the aggregate strategy to use
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, aop, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, end, enrich, enrich, enrichRef, filter, filter, filter, filter, getErrorHandlerBuilder, getInterceptStrategies, getNodeFactory, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, loadBalance, loadBalance, log, log, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, process, processRef, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeProperty, resequence, resequence, resequence, resequencer, rollback, rollback, routeId, routingSlip, routingSlip, sample, sample, setBody, setBody, setErrorHandlerBuilder, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, threads, threads, throttle, throwException, to, to, to, to, to, to, to, to, to, to, toAsync, toAsync, toAsync, toAsync, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getDescription, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateDefinition

public AggregateDefinition()

AggregateDefinition

public AggregateDefinition(Predicate predicate)

AggregateDefinition

public AggregateDefinition(Expression correlationExpression)

AggregateDefinition

public AggregateDefinition(ExpressionDefinition correlationExpression)

AggregateDefinition

public AggregateDefinition(Expression correlationExpression,
                           AggregationStrategy aggregationStrategy)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getShortName

public String getShortName()
Description copied from class: OptionalIdentifiedDefinition
Returns a short name for this node which can be useful for ID generation or referring to related resources like images

Overrides:
getShortName in class OptionalIdentifiedDefinition
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

getLabel

public String getLabel()
Description copied from class: ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node

Overrides:
getLabel in class ProcessorDefinition<AggregateDefinition>

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Overrides:
createProcessor in class ProcessorDefinition<AggregateDefinition>
Throws:
Exception

createAndSetExpression

public ExpressionClause<AggregateDefinition> createAndSetExpression()

createAggregator

protected Aggregator createAggregator(RouteContext routeContext)
                               throws Exception
Throws:
Exception

getAggregationCollection

public AggregationCollection getAggregationCollection()

setAggregationCollection

public void setAggregationCollection(AggregationCollection aggregationCollection)

getAggregationStrategy

public AggregationStrategy getAggregationStrategy()

setAggregationStrategy

public void setAggregationStrategy(AggregationStrategy aggregationStrategy)

getBatchSize

public Integer getBatchSize()

setBatchSize

public void setBatchSize(Integer batchSize)

getOutBatchSize

public Integer getOutBatchSize()

setOutBatchSize

public void setOutBatchSize(Integer outBatchSize)

getBatchTimeout

public Long getBatchTimeout()

setBatchTimeout

public void setBatchTimeout(Long batchTimeout)

getStrategyRef

public String getStrategyRef()

setStrategyRef

public void setStrategyRef(String strategyRef)

getCollectionRef

public String getCollectionRef()

setCollectionRef

public void setCollectionRef(String collectionRef)

setCompletionPredicate

public void setCompletionPredicate(ExpressionSubElementDefinition completionPredicate)

getCompletionPredicate

public ExpressionSubElementDefinition getCompletionPredicate()

getGroupExchanges

public Boolean getGroupExchanges()

setGroupExchanges

public void setGroupExchanges(Boolean groupExchanges)

getBatchSizeFromConsumer

public Boolean getBatchSizeFromConsumer()

setBatchSizeFromConsumer

public void setBatchSizeFromConsumer(Boolean batchSizeFromConsumer)

batchSizeFromConsumer

public AggregateDefinition batchSizeFromConsumer()
Enables the batch completion mode where we aggregate from a BatchConsumer and aggregate the total number of exchanges the BatchConsumer has reported as total by setting the exchange property Exchange.BATCH_SIZE.

Returns:
builder

batchSize

public AggregateDefinition batchSize(int batchSize)
Sets the in batch size for number of exchanges received

Parameters:
batchSize - the batch size
Returns:
builder

outBatchSize

public AggregateDefinition outBatchSize(int batchSize)
Sets the out batch size for number of exchanges sent

Parameters:
batchSize - the batch size
Returns:
builder

batchTimeout

public AggregateDefinition batchTimeout(long batchTimeout)
Sets the batch timeout

Parameters:
batchTimeout - the timeout in millis
Returns:
the builder

aggregationCollection

public AggregateDefinition aggregationCollection(AggregationCollection aggregationCollection)
Sets the aggregate collection to use

Parameters:
aggregationCollection - the aggregate collection to use
Returns:
the builder

aggregationStrategy

public AggregateDefinition aggregationStrategy(AggregationStrategy aggregationStrategy)
Sets the aggregate strategy to use

Parameters:
aggregationStrategy - the aggregate strategy to use
Returns:
the builder

collectionRef

public AggregateDefinition collectionRef(String collectionRef)
Sets the aggregate collection to use

Parameters:
collectionRef - reference to the aggregate collection to lookup in the registry
Returns:
the builder

strategyRef

public AggregateDefinition strategyRef(String strategyRef)
Sets the aggregate strategy to use

Parameters:
strategyRef - reference to the strategy to lookup in the registry
Returns:
the builder

groupExchanges

public AggregateDefinition groupExchanges()
Enables grouped exchanges, so the aggregator will group all aggregated exchanges into a single combined Exchange holding all the aggregated exchanges in a List as a exchange property with the key Exchange.GROUPED_EXCHANGE.

Returns:
the builder

completionPredicate

public ExpressionClause<AggregateDefinition> completionPredicate()
Sets the predicate used to determine if the aggregation is completed

Returns:
the clause used to create the predicate

completionPredicate

public AggregateDefinition completionPredicate(Predicate predicate)
Sets the predicate used to determine if the aggregation is completed

Parameters:
predicate - the predicate

checkNoCompletedPredicate

protected void checkNoCompletedPredicate()

setCorrelationExpression

public void setCorrelationExpression(ExpressionSubElementDefinition correlationExpression)

getCorrelationExpression

public ExpressionSubElementDefinition getCorrelationExpression()

getExpression

public ExpressionDefinition getExpression()

setExpression

public void setExpression(ExpressionDefinition expression)

getOutputs

public List<ProcessorDefinition> getOutputs()
Specified by:
getOutputs in class ProcessorDefinition<AggregateDefinition>

setOutputs

public void setOutputs(List<ProcessorDefinition> outputs)


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.