Package de.hybris.y2ysync.job
Class Y2YSyncMasterJobPerformable
java.lang.Object
de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable<Y2YSyncCronJobModel>
de.hybris.y2ysync.job.Y2YSyncMasterJobPerformable
- All Implemented Interfaces:
JobPerformable<Y2YSyncCronJobModel>,TypeAwareJobPerformable
public class Y2YSyncMasterJobPerformable
extends AbstractJobPerformable<Y2YSyncCronJobModel>
implements TypeAwareJobPerformable
-
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
flexibleSearchService, modelService, sessionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateAllTasksInTx(String syncExecutionId, List<MediasForType> allMedias, Y2YSyncType syncType, String nodeGroup) booleanIf method returnstruethen the initialization will create a default Job item of the given type.protected voidfillParameters(Map<String, Object> globalQueryParameters, CatalogVersionModel catalogVersion) protected Set<StreamConfigurationModel>protected intprotected ChangeDetectionServiceprotected MediaServicegetType()Must return an existing subtype ofServicelayerJobModelas String.protected booleanisChangesDetected(List<MediasForType> allMedias) protected Stringjoin(Y2YStreamConfigurationModel y2yStreamConfiguration, Function<Y2YColumnDefinitionModel, String> mapper) perform(Y2YSyncCronJobModel cronJob) The execution body for aServicelayerJob.voidsetChangeDetectionService(ChangeDetectionService changeDetectionService) voidsetMediaService(MediaService mediaService) voidsetSyncTaskFactory(SyncTaskFactory syncTaskFactory) protected StreamConfigurationtoStreamConfiguration(Map<String, Object> globalQueryParameters, Y2YStreamConfigurationModel y2YStreamConfigurationModel) Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
Constructor Details
-
Y2YSyncMasterJobPerformable
public Y2YSyncMasterJobPerformable()
-
-
Method Details
-
perform
Description copied from interface:JobPerformableThe execution body for aServicelayerJob. 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.- Specified by:
performin interfaceJobPerformable<Y2YSyncCronJobModel>- Specified by:
performin classAbstractJobPerformable<Y2YSyncCronJobModel>- Parameters:
cronJob- the related CronJob in whose context the execution will be performed.- Returns:
- a
PerformResultthat indicates whether theexecutionwas successfully executed or not and has finished or not.
-
isChangesDetected
-
join
protected String join(Y2YStreamConfigurationModel y2yStreamConfiguration, Function<Y2YColumnDefinitionModel, String> mapper) -
getBatchSize
protected int getBatchSize() -
getActiveConfigurations
protected Set<StreamConfigurationModel> getActiveConfigurations(Y2YStreamConfigurationContainerModel container) -
createAllTasksInTx
protected void createAllTasksInTx(String syncExecutionId, List<MediasForType> allMedias, Y2YSyncType syncType, String nodeGroup) -
toStreamConfiguration
protected StreamConfiguration toStreamConfiguration(Map<String, Object> globalQueryParameters, Y2YStreamConfigurationModel y2YStreamConfigurationModel) -
fillParameters
protected void fillParameters(Map<String, Object> globalQueryParameters, CatalogVersionModel catalogVersion) -
setChangeDetectionService
-
getChangeDetectionService
-
setMediaService
-
getMediaService
-
setSyncTaskFactory
-
getType
Description copied from interface:TypeAwareJobPerformableMust return an existing subtype ofServicelayerJobModelas String.- Specified by:
getTypein interfaceTypeAwareJobPerformable
-
createDefaultJob
public boolean createDefaultJob()Description copied from interface:TypeAwareJobPerformableIf method returnstruethen the initialization will create a default Job item of the given type. If your specific Job type requires specific parameters you have to returnfalse.- Specified by:
createDefaultJobin interfaceTypeAwareJobPerformable
-