Class FileAggregator
java.lang.Object
org.springframework.integration.file.aggregator.FileAggregator
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- CorrelationStrategy,- GroupConditionProvider,- MessageGroupProcessor,- ReleaseStrategy
public class FileAggregator
extends Object
implements CorrelationStrategy, ReleaseStrategy, GroupConditionProvider, MessageGroupProcessor, BeanFactoryAware
A convenient component to utilize
 a 
FileSplitter.FileMarker-based aggregation logic.
 Implements all three CorrelationStrategy, ReleaseStrategy and MessageGroupProcessor
 for runtime optimization.
 Delegates to HeaderAttributeCorrelationStrategy with FileHeaders.FILENAME attribute,
 FileMarkerReleaseStrategy and FileAggregatingMessageGroupProcessor, respectively.
 
 The default FileSplitter behavior
 with markers enabled is about do not provide a sequence details
 headers, therefore correlation in this aggregator implementation is done by the FileHeaders.FILENAME
 header which is still populated by the FileSplitter
 for each line emitted, including FileSplitter.FileMarker messages.
 
If default behavior of this component does not satisfy the target logic, it is recommended to configure an aggregator with individual strategies.
- Since:
- 5.5
- Author:
- Artem Bilan
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanRelease(MessageGroup group) getCorrelationKey(Message<?> message) Find the correlation key for the given message.processMessageGroup(MessageGroup group) Process the given MessageGroup.voidsetBeanFactory(BeanFactory beanFactory) 
- 
Constructor Details- 
FileAggregatorpublic FileAggregator()
 
- 
- 
Method Details- 
setBeanFactory- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Throws:
- BeansException
 
- 
getCorrelationKeyDescription copied from interface:CorrelationStrategyFind the correlation key for the given message. If no key can be determined the strategy should not returnnull, but throw an exception.- Specified by:
- getCorrelationKeyin interface- CorrelationStrategy
- Parameters:
- message- The message.
- Returns:
- The correlation key.
 
- 
canRelease- Specified by:
- canReleasein interface- ReleaseStrategy
 
- 
getGroupConditionSupplier- Specified by:
- getGroupConditionSupplierin interface- GroupConditionProvider
 
- 
processMessageGroupDescription copied from interface:MessageGroupProcessorProcess the given MessageGroup. Implementations are free to return as few or as many messages based on the invocation as needed. For example an aggregating processor will return only a single message representing the group, while a resequencing processor will return all messages whose preceding sequence has been satisfied.If a multiple messages are returned the return value must be a Collection<Message>. - Specified by:
- processMessageGroupin interface- MessageGroupProcessor
- Parameters:
- group- The message group.
- Returns:
- The result of processing the group.
 
 
-