Class C4CSyncJobPerformable

    • Field Detail

      • COLUMNS_DELIMITER

        protected static final java.lang.String COLUMNS_DELIMITER
        See Also:
        Constant Field Values
    • Constructor Detail

      • C4CSyncJobPerformable

        public C4CSyncJobPerformable()
    • Method Detail

      • getAggregatingCollector

        protected abstract C4CAggregatingCollector getAggregatingCollector()
        Get collector that joins customers and addresses.
        Returns:
        collector
      • getSplittingCollector

        protected C4CBatchingCollector getSplittingCollector​(java.lang.String syncExecutionId,
                                                             java.lang.String collectorId)
        Get collector that splits change list into chunks.
        Returns:
        constructed collector
      • getChangesDataMap

        protected java.util.Map<java.lang.String,​TypeChangesData> getChangesDataMap​(java.lang.String syncExecutionId,
                                                                                          java.util.Map<java.lang.String,​java.lang.Object> globalQueryParameters,
                                                                                          java.util.Set<StreamConfigurationModel> configurations)
        Collect changes, store them on media.
        Parameters:
        syncExecutionId - unique synchronization session id
        globalQueryParameters - synchronization settings
        configurations - what to synchronize
        Returns:
        changes grouped by item type
      • assignStreamIds

        protected void assignStreamIds​(C4CAggregatingCollector collector,
                                       java.util.Set<StreamConfigurationModel> configurations)
        Assign stream ids to corresponding collectors.

        Needed for further call of consumeChanges.

        Parameters:
        collector - aggregating collector, having separate sub-collectors for customers and for addresses.
        configurations - synchronization configurations
      • join

        protected java.lang.String join​(Y2YStreamConfigurationModel y2yStreamConfiguration,
                                        java.util.function.Function<Y2YColumnDefinitionModel,​java.lang.String> mapper)
        Create semicolon-delimited list of columns from configuration.
        Parameters:
        y2yStreamConfiguration - configuration
        mapper - how to process each column definition
        Returns:
        resulting list
      • createAllTasksInTx

        protected void createAllTasksInTx​(java.lang.String syncExecutionId,
                                          java.util.List<MediasForType> allMedia,
                                          Y2YSyncType syncType)
        Run prepared synchronization tasks.
        Parameters:
        syncExecutionId - session id
        allMedia - data descriptors
        syncType - how to synchronize
      • toStreamConfiguration

        protected StreamConfiguration toStreamConfiguration​(java.util.Map<java.lang.String,​java.lang.Object> globalQueryParameters,
                                                            Y2YStreamConfigurationModel y2YStreamConfigurationModel)
        Merge parameters with stream configuration.
        Parameters:
        globalQueryParameters - global settings
        y2YStreamConfigurationModel - stream own settings
        Returns:
        merged configuration
      • fillParameters

        protected void fillParameters​(java.util.Map<java.lang.String,​java.lang.Object> globalQueryParameters,
                                      CatalogVersionModel catalogVersion)
        Collect parameters.
        Parameters:
        globalQueryParameters - global parameters
        catalogVersion - optional catalog version
      • isChangesDetected

        protected boolean isChangesDetected​(java.util.List<MediasForType> allMedias)
      • setChangeDetectionService

        public void setChangeDetectionService​(ChangeDetectionService changeDetectionService)
      • setMediaService

        public void setMediaService​(MediaService mediaService)
      • setSyncTaskFactory

        public void setSyncTaskFactory​(SyncTaskFactory syncTaskFactory)
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setBatchSize

        public void setBatchSize​(int value)
      • getChangeDetectionService

        protected ChangeDetectionService getChangeDetectionService()
        Returns:
        change detection service.
      • getMediaService

        protected MediaService getMediaService()
        Returns:
        media service.
      • getSyncTaskFactory

        protected SyncTaskFactory getSyncTaskFactory()
        Returns:
        synchronization task factory.
      • getTypeService

        protected TypeService getTypeService()
        Returns:
        type service.
      • getBatchSize

        protected int getBatchSize()
        Returns:
        chunk length.