org.apache.camel.model
Class ResequenceDefinition

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

public class ResequenceDefinition
extends ProcessorDefinition<ResequenceDefinition>

Represents an XML <resequence/> element

Version:
$Revision: 20139 $

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
errorHandlerBuilder, errorHandlerRef, inheritErrorHandler, log
 
Constructor Summary
ResequenceDefinition()
           
ResequenceDefinition(List<Expression> expressions)
           
 
Method Summary
 ResequenceDefinition allowDuplicates()
          Enables duplicates for the batch resequencer mode
 ResequenceDefinition batch()
          Configures the batch-based resequencing algorithm using the default configuration.
 ResequenceDefinition batch(BatchResequencerConfig config)
          Configures the batch-based resequencing algorithm using the given BatchResequencerConfig.
 ResequenceDefinition capacity(int capacity)
          Sets the capacity for the stream resequencer
 ResequenceDefinition comparator(ExpressionResultComparator comparator)
          Sets the comparator to use for stream resequencer
protected  Resequencer createBatchResequencer(RouteContext routeContext, BatchResequencerConfig config)
          Creates a batch Resequencer instance applying the given config.
 Processor createProcessor(RouteContext routeContext)
          Override this in definition class and implement logic to create the processor based on the definition model.
protected  StreamResequencer createStreamResequencer(RouteContext routeContext, StreamResequencerConfig config)
          Creates a StreamResequencer instance applying the given config.
 ResequenceDefinition expression(ExpressionDefinition expression)
          Sets the expression to use for reordering
 BatchResequencerConfig getBatchConfig()
           
 BatchResequencerConfig getBatchConfig(BatchResequencerConfig defaultConfig)
           
 List<Expression> getExpressionList()
           
 List<ExpressionDefinition> getExpressions()
           
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 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
 StreamResequencerConfig getStreamConfig()
           
 ResequenceDefinition reverse()
          Enables reverse mode for the batch resequencer mode.
 void setBatchConfig(BatchResequencerConfig batchConfig)
           
 void setOutputs(List<ProcessorDefinition> outputs)
           
 void setStreamConfig(StreamResequencerConfig streamConfig)
           
 ResequenceDefinition size(int batchSize)
          Sets the in batch size for number of exchanges received
 ResequenceDefinition stream()
          Configures the stream-based resequencing algorithm using the default configuration.
 ResequenceDefinition stream(StreamResequencerConfig config)
          Configures the stream-based resequencing algorithm using the given StreamResequencerConfig.
 ResequenceDefinition timeout(long timeout)
          Sets the timeout
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, enrich, enrich, enrichRef, filter, filter, filter, filter, getErrorHandlerBuilder, getInterceptStrategies, getNodeFactory, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, loadBalance, loadBalance, log, log, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, process, processRef, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeProperty, resequence, resequence, resequence, resequence, resolvePropertyPlaceholders, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, setBody, setBody, setErrorHandlerBuilder, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, threads, threads, threads, throttle, throwException, to, to, to, to, to, to, to, to, to, to, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResequenceDefinition

public ResequenceDefinition()

ResequenceDefinition

public ResequenceDefinition(List<Expression> expressions)
Method Detail

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

stream

public ResequenceDefinition stream()
Configures the stream-based resequencing algorithm using the default configuration.

Returns:
the builder

batch

public ResequenceDefinition batch()
Configures the batch-based resequencing algorithm using the default configuration.

Returns:
the builder

stream

public ResequenceDefinition stream(StreamResequencerConfig config)
Configures the stream-based resequencing algorithm using the given StreamResequencerConfig.

Parameters:
config - the config
Returns:
the builder

batch

public ResequenceDefinition batch(BatchResequencerConfig config)
Configures the batch-based resequencing algorithm using the given BatchResequencerConfig.

Parameters:
config - the config
Returns:
the builder

expression

public ResequenceDefinition expression(ExpressionDefinition expression)
Sets the expression to use for reordering

Parameters:
expression - the expression
Returns:
the builder

timeout

public ResequenceDefinition timeout(long timeout)
Sets the timeout

Parameters:
timeout - timeout in millis
Returns:
the builder

size

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

Parameters:
batchSize - the batch size
Returns:
the builder

capacity

public ResequenceDefinition capacity(int capacity)
Sets the capacity for the stream resequencer

Parameters:
capacity - the capacity
Returns:
the builder

allowDuplicates

public ResequenceDefinition allowDuplicates()
Enables duplicates for the batch resequencer mode

Returns:
the builder

reverse

public ResequenceDefinition reverse()
Enables reverse mode for the batch resequencer mode.

This means the expression for determine the sequence order will be reversed. Can be used for Z..A or 9..0 ordering.

Returns:
the builder

comparator

public ResequenceDefinition comparator(ExpressionResultComparator comparator)
Sets the comparator to use for stream resequencer

Parameters:
comparator - the comparator
Returns:
the builder

toString

public String toString()
Overrides:
toString in class Object

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<ResequenceDefinition>

getExpressions

public List<ExpressionDefinition> getExpressions()

getExpressionList

public List<Expression> getExpressionList()

getOutputs

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

setOutputs

public void setOutputs(List<ProcessorDefinition> outputs)

getBatchConfig

public BatchResequencerConfig getBatchConfig()

getBatchConfig

public BatchResequencerConfig getBatchConfig(BatchResequencerConfig defaultConfig)

getStreamConfig

public StreamResequencerConfig getStreamConfig()

setBatchConfig

public void setBatchConfig(BatchResequencerConfig batchConfig)

setStreamConfig

public void setStreamConfig(StreamResequencerConfig streamConfig)

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Description copied from class: ProcessorDefinition
Override this in definition class and implement logic to create the processor based on the definition model.

Overrides:
createProcessor in class ProcessorDefinition<ResequenceDefinition>
Throws:
Exception

createBatchResequencer

protected Resequencer createBatchResequencer(RouteContext routeContext,
                                             BatchResequencerConfig config)
                                      throws Exception
Creates a batch Resequencer instance applying the given config.

Parameters:
routeContext - route context.
config - batch resequencer configuration.
Returns:
the configured batch resequencer.
Throws:
Exception - can be thrown

createStreamResequencer

protected StreamResequencer createStreamResequencer(RouteContext routeContext,
                                                    StreamResequencerConfig config)
                                             throws Exception
Creates a StreamResequencer instance applying the given config.

Parameters:
routeContext - route context.
config - stream resequencer configuration.
Returns:
the configured stream resequencer.
Throws:
Exception - can be thrwon


Apache CAMEL