Class StreamingChangesCollector
- java.lang.Object
-
- de.hybris.platform.outboundsync.job.impl.StreamingChangesCollector
-
- All Implemented Interfaces:
ChangesCollector,CountingChangesCollector
public class StreamingChangesCollector extends java.lang.Object implements CountingChangesCollector
-
-
Constructor Summary
Constructors Constructor Description StreamingChangesCollector(@NotNull FilteringService filteringService, @NotNull ItemChangeSender changeSender, @NotNull CronJobModel jobModel, @NotNull OutboundSyncStreamConfigurationModel streamCfg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancollect(ItemChangeDTO itemChangeDTO)Collects the given change in a specified way.voidfinish()Finishes the collecting changes, depending on implementation, may be used as kind of post processing after finalizing collecting the changes.intgetNumberOfChangesCollected()Reports how many changes were collected so far.voidsetInfoParser(ChangeInfoParser parser)Injects implementation of an info parser to be used instead of the default implementation.
-
-
-
Constructor Detail
-
StreamingChangesCollector
public StreamingChangesCollector(@NotNull @NotNull FilteringService filteringService, @NotNull @NotNull ItemChangeSender changeSender, @NotNull @NotNull CronJobModel jobModel, @NotNull @NotNull OutboundSyncStreamConfigurationModel streamCfg)
-
-
Method Detail
-
collect
public boolean collect(ItemChangeDTO itemChangeDTO)
Collects the given change in a specified way. Sends each individual change to the spring integration channel gateway.- Specified by:
collectin interfaceChangesCollector- Parameters:
itemChangeDTO- change to be collected- Returns:
true, if the collecting process should continue,falseotherwise
-
finish
public void finish()
Description copied from interface:ChangesCollectorFinishes the collecting changes, depending on implementation, may be used as kind of post processing after finalizing collecting the changes. E.g. a csv report can be generated here.- Specified by:
finishin interfaceChangesCollector
-
getNumberOfChangesCollected
public int getNumberOfChangesCollected()
Reports how many changes were collected so far. This collector counts all changes processed during the lifetime of this specific instance. If "reset" is required, then a new instance of the collector must be created.- Specified by:
getNumberOfChangesCollectedin interfaceCountingChangesCollector- Returns:
- number of changes collected or 0, if no changes collected.
-
setInfoParser
public void setInfoParser(ChangeInfoParser parser)
Injects implementation of an info parser to be used instead of the default implementation.- Parameters:
parser- a custom parser to be used for parsing theItemChangeDTO.getInfo()data.nullvalue is ignored.
-
-