Class C4CSyncJobPerformable

java.lang.Object
de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<Y2YSyncCronJobModel>
de.hybris.platform.c4ccustomer.job.C4CSyncJobPerformable
All Implemented Interfaces:
de.hybris.platform.servicelayer.cronjob.JobPerformable<Y2YSyncCronJobModel>

public abstract class C4CSyncJobPerformable extends de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<Y2YSyncCronJobModel>
C4C synchronization cron job.
  • Field Details

  • Constructor Details

    • C4CSyncJobPerformable

      public C4CSyncJobPerformable()
  • Method Details

    • getAggregatingCollector

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

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

      public de.hybris.platform.servicelayer.cronjob.PerformResult perform(Y2YSyncCronJobModel cronJob)
      Specified by:
      perform in interface de.hybris.platform.servicelayer.cronjob.JobPerformable<Y2YSyncCronJobModel>
      Specified by:
      perform in class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<Y2YSyncCronJobModel>
    • getChangesDataMap

      protected Map<String,TypeChangesData> getChangesDataMap(String syncExecutionId, Map<String,Object> globalQueryParameters, 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, 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
    • addTypeChangesDataForConfig

      protected TypeChangesData addTypeChangesDataForConfig(Map<String,TypeChangesData> containers, Y2YStreamConfigurationModel y2YStreamConfigurationModel, de.hybris.y2ysync.deltadetection.collector.BatchingCollector collector)
      Create entry of TypeChangesData corresponding to the configuration.
      Parameters:
      containers - receiver of the entries
      y2YStreamConfigurationModel - configuration details
    • join

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

      protected Set<StreamConfigurationModel> getActiveConfigurations(Y2YStreamConfigurationContainerModel container)
      All active configurations of given container.
      Parameters:
      container - configuration container
      Returns:
      subsequent configurations
    • createAllTasksInTx

      protected void createAllTasksInTx(String syncExecutionId, List<de.hybris.y2ysync.task.internal.MediasForType> allMedia, Y2YSyncType syncType)
      Run prepared synchronization tasks.
      Parameters:
      syncExecutionId - session id
      allMedia - data descriptors
      syncType - how to synchronize
    • toStreamConfiguration

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

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

      protected boolean isChangesDetected(List<de.hybris.y2ysync.task.internal.MediasForType> allMedias)
    • setChangeDetectionService

      public void setChangeDetectionService(de.hybris.deltadetection.ChangeDetectionService changeDetectionService)
    • setMediaService

      public void setMediaService(de.hybris.platform.servicelayer.media.MediaService mediaService)
    • setSyncTaskFactory

      public void setSyncTaskFactory(de.hybris.y2ysync.task.internal.SyncTaskFactory syncTaskFactory)
    • setTypeService

      public void setTypeService(de.hybris.platform.servicelayer.type.TypeService typeService)
    • setBatchSize

      public void setBatchSize(int value)
    • getChangeDetectionService

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

      protected de.hybris.platform.servicelayer.media.MediaService getMediaService()
      Returns:
      media service.
    • getSyncTaskFactory

      protected de.hybris.y2ysync.task.internal.SyncTaskFactory getSyncTaskFactory()
      Returns:
      synchronization task factory.
    • getTypeService

      protected de.hybris.platform.servicelayer.type.TypeService getTypeService()
      Returns:
      type service.
    • getBatchSize

      protected int getBatchSize()
      Returns:
      chunk length.