public abstract class C4CSyncJobPerformable extends AbstractJobPerformable<Y2YSyncCronJobModel>
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
COLUMNS_DELIMITER |
flexibleSearchService, modelService, sessionService| Constructor and Description |
|---|
C4CSyncJobPerformable() |
| Modifier and Type | Method and Description |
|---|---|
protected TypeChangesData |
addTypeChangesDataForConfig(java.util.Map<java.lang.String,TypeChangesData> containers,
Y2YStreamConfigurationModel y2YStreamConfigurationModel,
BatchingCollector collector)
Create entry of
TypeChangesData corresponding to the configuration. |
protected void |
assignStreamIds(C4CAggregatingCollector collector,
java.util.Set<StreamConfigurationModel> configurations)
Assign stream ids to corresponding collectors.
|
protected void |
createAllTasksInTx(java.lang.String syncExecutionId,
java.util.List<MediasForType> allMedia,
Y2YSyncType syncType)
Run prepared synchronization tasks.
|
protected void |
fillParameters(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters,
CatalogVersionModel catalogVersion)
Collect parameters.
|
protected java.util.Set<StreamConfigurationModel> |
getActiveConfigurations(Y2YStreamConfigurationContainerModel container)
All active configurations of given container.
|
protected abstract C4CAggregatingCollector |
getAggregatingCollector()
Get collector that joins customers and addresses.
|
protected int |
getBatchSize() |
protected ChangeDetectionService |
getChangeDetectionService() |
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.
|
protected MediaService |
getMediaService() |
protected C4CBatchingCollector |
getSplittingCollector(java.lang.String syncExecutionId,
java.lang.String collectorId)
Get collector that splits change list into chunks.
|
protected SyncTaskFactory |
getSyncTaskFactory() |
protected TypeService |
getTypeService() |
protected boolean |
isChangesDetected(java.util.List<MediasForType> allMedias) |
protected java.lang.String |
join(Y2YStreamConfigurationModel y2yStreamConfiguration,
java.util.function.Function<Y2YColumnDefinitionModel,java.lang.String> mapper)
Create semicolon-delimited list of columns from configuration.
|
PerformResult |
perform(Y2YSyncCronJobModel cronJob)
The execution body for a
ServicelayerJob. |
void |
setBatchSize(int value) |
void |
setChangeDetectionService(ChangeDetectionService changeDetectionService) |
void |
setMediaService(MediaService mediaService) |
void |
setSyncTaskFactory(SyncTaskFactory syncTaskFactory) |
void |
setTypeService(TypeService typeService) |
protected StreamConfiguration |
toStreamConfiguration(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters,
Y2YStreamConfigurationModel y2YStreamConfigurationModel)
Merge parameters with stream configuration.
|
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionServiceprotected static final java.lang.String COLUMNS_DELIMITER
protected abstract C4CAggregatingCollector getAggregatingCollector()
protected C4CBatchingCollector getSplittingCollector(java.lang.String syncExecutionId, java.lang.String collectorId)
public PerformResult perform(Y2YSyncCronJobModel cronJob)
JobPerformableServicelayerJob. Implement here your execution logic. It can be called
synchronous or asynchronous. So be aware of thread-safety. Method will return a result object saying if the
execution has reached end and if it was successful.perform in interface JobPerformable<Y2YSyncCronJobModel>perform in class AbstractJobPerformable<Y2YSyncCronJobModel>cronJob - the related CronJob in whose context the execution will be performed.PerformResult that indicates whether the execution was successfully executed
or not and has finished or not.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)
syncExecutionId - unique synchronization session idglobalQueryParameters - synchronization settingsconfigurations - what to synchronizeprotected void assignStreamIds(C4CAggregatingCollector collector, java.util.Set<StreamConfigurationModel> configurations)
Needed for further call of consumeChanges.
collector - aggregating collector, having separate sub-collectors for customers and for addresses.configurations - synchronization configurationsprotected TypeChangesData addTypeChangesDataForConfig(java.util.Map<java.lang.String,TypeChangesData> containers, Y2YStreamConfigurationModel y2YStreamConfigurationModel, BatchingCollector collector)
TypeChangesData corresponding to the configuration.containers - receiver of the entriesy2YStreamConfigurationModel - configuration detailsprotected java.lang.String join(Y2YStreamConfigurationModel y2yStreamConfiguration, java.util.function.Function<Y2YColumnDefinitionModel,java.lang.String> mapper)
y2yStreamConfiguration - configurationmapper - how to process each column definitionprotected java.util.Set<StreamConfigurationModel> getActiveConfigurations(Y2YStreamConfigurationContainerModel container)
container - configuration containerprotected void createAllTasksInTx(java.lang.String syncExecutionId,
java.util.List<MediasForType> allMedia,
Y2YSyncType syncType)
syncExecutionId - session idallMedia - data descriptorssyncType - how to synchronizeprotected StreamConfiguration toStreamConfiguration(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters, Y2YStreamConfigurationModel y2YStreamConfigurationModel)
globalQueryParameters - global settingsy2YStreamConfigurationModel - stream own settingsprotected void fillParameters(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters,
CatalogVersionModel catalogVersion)
globalQueryParameters - global parameterscatalogVersion - optional catalog versionprotected boolean isChangesDetected(java.util.List<MediasForType> allMedias)
public void setChangeDetectionService(ChangeDetectionService changeDetectionService)
public void setMediaService(MediaService mediaService)
public void setSyncTaskFactory(SyncTaskFactory syncTaskFactory)
public void setTypeService(TypeService typeService)
public void setBatchSize(int value)
protected ChangeDetectionService getChangeDetectionService()
protected MediaService getMediaService()
protected SyncTaskFactory getSyncTaskFactory()
protected TypeService getTypeService()
protected int getBatchSize()
Copyright © 2018 SAP SE. All Rights Reserved.