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 Constructor Description Y2YSyncMasterJobPerformable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateAllTasksInTx(java.lang.String syncExecutionId, java.util.List<MediasForType> allMedias, Y2YSyncType syncType, java.lang.String nodeGroup)booleancreateDefaultJob()If method returnstruethen the initialization will create a default Job item of the given type.protected voidfillParameters(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters, CatalogVersionModel catalogVersion)protected java.util.Set<StreamConfigurationModel>getActiveConfigurations(Y2YStreamConfigurationContainerModel container)protected intgetBatchSize()protected ChangeDetectionServicegetChangeDetectionService()protected MediaServicegetMediaService()java.lang.StringgetType()Must return an existing subtype ofServicelayerJobModelas String.protected booleanisChangesDetected(java.util.List<MediasForType> allMedias)protected java.lang.Stringjoin(Y2YStreamConfigurationModel y2yStreamConfiguration, java.util.function.Function<Y2YColumnDefinitionModel,java.lang.String> mapper)PerformResultperform(Y2YSyncCronJobModel cronJob)The execution body for aServicelayerJob.voidsetChangeDetectionService(ChangeDetectionService changeDetectionService)voidsetMediaService(MediaService mediaService)voidsetSyncTaskFactory(SyncTaskFactory syncTaskFactory)protected StreamConfigurationtoStreamConfiguration(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters, Y2YStreamConfigurationModel y2YStreamConfigurationModel)-
Methods inherited from class de.hybris.platform.servicelayer.cronjob.AbstractJobPerformable
clearAbortRequestedIfNeeded, isAbortable, isPerformable, setFlexibleSearchService, setModelService, setSessionService
-
-
-
-
Method Detail
-
perform
public PerformResult perform(Y2YSyncCronJobModel cronJob)
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
protected boolean isChangesDetected(java.util.List<MediasForType> allMedias)
-
join
protected java.lang.String join(Y2YStreamConfigurationModel y2yStreamConfiguration, java.util.function.Function<Y2YColumnDefinitionModel,java.lang.String> mapper)
-
getBatchSize
protected int getBatchSize()
-
getActiveConfigurations
protected java.util.Set<StreamConfigurationModel> getActiveConfigurations(Y2YStreamConfigurationContainerModel container)
-
createAllTasksInTx
protected void createAllTasksInTx(java.lang.String syncExecutionId, java.util.List<MediasForType> allMedias, Y2YSyncType syncType, java.lang.String nodeGroup)
-
toStreamConfiguration
protected StreamConfiguration toStreamConfiguration(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters, Y2YStreamConfigurationModel y2YStreamConfigurationModel)
-
fillParameters
protected void fillParameters(java.util.Map<java.lang.String,java.lang.Object> globalQueryParameters, CatalogVersionModel catalogVersion)
-
setChangeDetectionService
public void setChangeDetectionService(ChangeDetectionService changeDetectionService)
-
getChangeDetectionService
protected ChangeDetectionService getChangeDetectionService()
-
setMediaService
public void setMediaService(MediaService mediaService)
-
getMediaService
protected MediaService getMediaService()
-
setSyncTaskFactory
public void setSyncTaskFactory(SyncTaskFactory syncTaskFactory)
-
getType
public java.lang.String 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
-
-