org.apache.camel.model
Class ResequenceDefinition

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

public class ResequenceDefinition
extends ProcessorDefinition<ResequenceDefinition>

Represents an XML <resequence/> element

Version:

Field Summary
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler, log
 
Constructor Summary
ResequenceDefinition()
           
 
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.
 BatchResequencerConfig getBatchConfig()
           
 ExpressionDefinition getExpression()
           
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 List<ProcessorDefinition<?>> getOutputs()
           
 ResequencerConfig getResequencerConfig()
           
 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 ignoreInvalidExchanges()
          If an incoming Exchange is invalid, then it will be ignored.
 boolean isOutputSupported()
           
 ResequenceDefinition reverse()
          Enables reverse mode for the batch resequencer mode.
 void setBatchConfig(BatchResequencerConfig batchConfig)
           
 void setExpression(ExpressionDefinition expression)
           
 void setOutputs(List<ProcessorDefinition<?>> outputs)
           
 void setResequencerConfig(ResequencerConfig resequencerConfig)
           
 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, attribute, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endDoTry, endParent, enrich, enrich, enrichRef, filter, filter, filter, filter, getInterceptStrategies, getNodeFactory, getOtherAttributes, 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, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, preCreateProcessor, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperty, resequence, resequence, resolveKnownConstantFields, resolvePropertyPlaceholders, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setNodeFactory, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, stop, threads, threads, threads, threads, throttle, 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()
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

Specified by:
getShortName in interface NamedNode
Overrides:
getShortName in class OptionalIdentifiedDefinition<ResequenceDefinition>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

getOutputs

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

setOutputs

public void setOutputs(List<ProcessorDefinition<?>> outputs)

isOutputSupported

public boolean isOutputSupported()
Specified by:
isOutputSupported in class ProcessorDefinition<ResequenceDefinition>

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

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

ignoreInvalidExchanges

public ResequenceDefinition ignoreInvalidExchanges()
If an incoming Exchange is invalid, then it will be ignored.

Returns:
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>

getResequencerConfig

public ResequencerConfig getResequencerConfig()

setResequencerConfig

public void setResequencerConfig(ResequencerConfig resequencerConfig)

getBatchConfig

public BatchResequencerConfig getBatchConfig()

getStreamConfig

public StreamResequencerConfig getStreamConfig()

setBatchConfig

public void setBatchConfig(BatchResequencerConfig batchConfig)

setStreamConfig

public void setStreamConfig(StreamResequencerConfig streamConfig)

getExpression

public ExpressionDefinition getExpression()

setExpression

public void setExpression(ExpressionDefinition expression)

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