public class DefaultCatalogSynchronizationService extends java.lang.Object implements CatalogSynchronizationService
| Constructor and Description |
|---|
DefaultCatalogSynchronizationService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addScheduleFromConfig(SyncItemCronJobModel cronJob,
SyncConfig config) |
boolean |
canSynchronize(SyncItemJobModel syncJob,
PrincipalModel principal)
Returns true if the principal has sync permissions to synchronize between catalog versions from given sync job.
|
protected SyncConfig |
cloneSyncConfig(SyncConfig givenSyncConfig) |
protected SyncItemCronJobModel |
createSyncCronJob(SyncItemJobModel job) |
protected CatalogVersionSyncJobModel |
createSyncJob(CatalogVersionModel source,
CatalogVersionModel target) |
protected CatalogVersionSyncJobModel |
createSyncJob(CatalogVersionModel source,
CatalogVersionModel target,
int numberOfThreads) |
java.util.List<ItemModel> |
getApplicableItems(java.util.List<ItemModel> inputItems,
SyncItemJobModel syncItemJob)
Filters given items returning only the ones being applicable to the given sync job.
|
protected java.lang.Integer |
getMaxThreads() |
ItemModel |
getSynchronizationSourceFor(SyncItemJobModel theSyncJob,
ItemModel targetItem)
Returns the counterpart for the
target item against given sync job theSyncJob. |
ItemSyncTimestampModel |
getSynchronizationSourceTimestampFor(SyncItemJobModel theSyncJob,
ItemModel source)
Returns the existing
ItemSyncTimestampModel for the source item in the scope of the given
sync job. |
ItemModel |
getSynchronizationTargetFor(SyncItemJobModel theSyncJob,
ItemModel sourceItem)
Returns the counterpart for the
source item against given sync job theSyncJob. |
ItemSyncTimestampModel |
getSynchronizationTargetTimestampFor(SyncItemJobModel theSyncJob,
ItemModel target)
Returns the existing
ItemSyncTimestampModel for the target item in the scope of the given sync job. |
SyncItemJobModel |
getSyncJob(CatalogVersionModel source,
CatalogVersionModel target,
java.lang.String qualifier)
Returns the publication rule (as
SyncItemJobModel item) between a specified source catalog version and target
catalog version. |
boolean |
isInProgress(SyncItemJobModel theSyncJob)
Checks whether the given
givenSyncJob is currently in progress. |
java.util.Collection<SyncResult> |
lookupCurrentSynchronizations(SyncItemJobModel theSyncJob)
Returns the current executions for the given
theSyncJob. |
java.util.List<SyncResult> |
performSynchronization(java.util.List<ItemModel> givenItems,
java.util.List<SyncItemJobModel> syncItemJobs,
SyncConfig syncConfig)
Performs the synchronization for given items against given sync jobs.
|
SyncResult |
performSynchronization(java.util.List<ItemModel> givenItems,
SyncItemJobModel syncItemJob,
SyncConfig syncConfig)
Performs the synchronization for given items.
|
protected SyncConfig |
scheduleItemsWithConfig(SyncConfig syncConfig,
SyncItemJobModel syncJob,
java.util.List<ItemModel> applicableItems) |
void |
setCatalogTypeService(CatalogTypeService catalogTypeService) |
void |
setCatalogVersionService(CatalogVersionService catalogVersionService) |
void |
setCronJobService(CronJobService cronJobService) |
void |
setFlexibleSearchService(FlexibleSearchService flexibleSearchService) |
void |
setItemSyncTimestampDao(ItemSyncTimestampDao itemSyncTimestampDao) |
void |
setModelService(ModelService modelService) |
void |
setSyncJobApplicableTypesStrategy(SyncJobApplicableTypesStrategy syncJobApplicableTypesStrategy) |
void |
setUserService(UserService userService) |
SyncResult |
synchronize(SyncItemJobModel syncJob,
SyncConfig syncConfig)
Starts synchronization for an existing
SyncItemJobModel. |
void |
synchronizeFully(CatalogVersionModel source,
CatalogVersionModel target)
For the given catalog version pair a new
CatalogVersionSyncJobModel is being created configured to sync
all default catalog item types. |
void |
synchronizeFully(CatalogVersionModel source,
CatalogVersionModel target,
int numberOfThreads)
For the given catalog version pair a new
CatalogVersionSyncJobModel is being created configured to sync
all default catalog item types. |
void |
synchronizeFullyInBackground(CatalogVersionModel source,
CatalogVersionModel target)
For the given catalog version pair a new
CatalogVersionSyncJobModel is being created configured to sync
all default catalog item types. |
public DefaultCatalogSynchronizationService()
public void synchronizeFully(CatalogVersionModel source, CatalogVersionModel target)
CatalogSynchronizationServiceCatalogVersionSyncJobModel is being created configured to sync
all default catalog item types.
The actual sync process is backed by a also new CatalogVersionSyncCronJobModel which is performed
synchronously.synchronizeFully in interface CatalogSynchronizationServicepublic void synchronizeFully(CatalogVersionModel source, CatalogVersionModel target, int numberOfThreads)
CatalogSynchronizationServiceCatalogVersionSyncJobModel is being created configured to sync
all default catalog item types.
The actual sync process is backed by a also new CatalogVersionSyncCronJobModel which is started
synchronously.synchronizeFully in interface CatalogSynchronizationServicenumberOfThreads - specifies the number of sync workers to be used - overrides the number configured in
catalog.sync.workerspublic void synchronizeFullyInBackground(CatalogVersionModel source, CatalogVersionModel target)
CatalogSynchronizationServiceCatalogVersionSyncJobModel is being created configured to sync
all default catalog item types.
The actual sync process is backed by a also new CatalogVersionSyncCronJobModel which is started
asynchronously.synchronizeFullyInBackground in interface CatalogSynchronizationServicepublic SyncResult synchronize(SyncItemJobModel syncJob, SyncConfig syncConfig)
CatalogSynchronizationServiceSyncItemJobModel. The configuration parameter allows to
configure/override a number of synchronization job settings.
The returned SyncResult gives both access to the execution result or, in case the process was started
asynchronously, to observe the running processsynchronize in interface CatalogSynchronizationServicepublic java.util.List<SyncResult> performSynchronization(java.util.List<ItemModel> givenItems, java.util.List<SyncItemJobModel> syncItemJobs, SyncConfig syncConfig)
CatalogSynchronizationServiceperformSynchronization in interface CatalogSynchronizationServiceprotected SyncConfig scheduleItemsWithConfig(SyncConfig syncConfig, SyncItemJobModel syncJob, java.util.List<ItemModel> applicableItems)
public SyncItemJobModel getSyncJob(CatalogVersionModel source, CatalogVersionModel target, java.lang.String qualifier)
CatalogSynchronizationServiceSyncItemJobModel item) between a specified source catalog version and target
catalog version.getSyncJob in interface CatalogSynchronizationServicepublic SyncResult performSynchronization(java.util.List<ItemModel> givenItems, SyncItemJobModel syncItemJob, SyncConfig syncConfig)
CatalogSynchronizationServiceperformSynchronization in interface CatalogSynchronizationServicepublic java.util.List<ItemModel> getApplicableItems(java.util.List<ItemModel> inputItems, SyncItemJobModel syncItemJob)
CatalogSynchronizationServicegetApplicableItems in interface CatalogSynchronizationServicepublic boolean isInProgress(SyncItemJobModel theSyncJob)
CatalogSynchronizationServicegivenSyncJob is currently in progress.isInProgress in interface CatalogSynchronizationServicepublic java.util.Collection<SyncResult> lookupCurrentSynchronizations(SyncItemJobModel theSyncJob)
CatalogSynchronizationServicetheSyncJob.lookupCurrentSynchronizations in interface CatalogSynchronizationServicepublic ItemSyncTimestampModel getSynchronizationSourceTimestampFor(SyncItemJobModel theSyncJob, ItemModel source)
CatalogSynchronizationServiceItemSyncTimestampModel for the source item in the scope of the given
sync job. In case of the item never been synchronized before NULL is returned.getSynchronizationSourceTimestampFor in interface CatalogSynchronizationServicepublic ItemSyncTimestampModel getSynchronizationTargetTimestampFor(SyncItemJobModel theSyncJob, ItemModel target)
CatalogSynchronizationServiceItemSyncTimestampModel for the target item in the scope of the given sync job. In
case of the original source item being deleted this methods will return NULL.getSynchronizationTargetTimestampFor in interface CatalogSynchronizationServicepublic ItemModel getSynchronizationSourceFor(SyncItemJobModel theSyncJob, ItemModel targetItem)
CatalogSynchronizationServicetarget item against given sync job theSyncJob.getSynchronizationSourceFor in interface CatalogSynchronizationServicepublic ItemModel getSynchronizationTargetFor(SyncItemJobModel theSyncJob, ItemModel sourceItem)
CatalogSynchronizationServicesource item against given sync job theSyncJob.getSynchronizationTargetFor in interface CatalogSynchronizationServicepublic boolean canSynchronize(SyncItemJobModel syncJob, PrincipalModel principal)
canSynchronize in interface CatalogSynchronizationServicesyncJob - the sync jobprincipal - the principalprotected void addScheduleFromConfig(SyncItemCronJobModel cronJob, SyncConfig config)
protected CatalogVersionSyncJobModel createSyncJob(CatalogVersionModel source, CatalogVersionModel target)
protected CatalogVersionSyncJobModel createSyncJob(CatalogVersionModel source, CatalogVersionModel target, int numberOfThreads)
protected SyncItemCronJobModel createSyncCronJob(SyncItemJobModel job)
protected SyncConfig cloneSyncConfig(SyncConfig givenSyncConfig)
protected java.lang.Integer getMaxThreads()
public void setCronJobService(CronJobService cronJobService)
public void setModelService(ModelService modelService)
public void setItemSyncTimestampDao(ItemSyncTimestampDao itemSyncTimestampDao)
public void setSyncJobApplicableTypesStrategy(SyncJobApplicableTypesStrategy syncJobApplicableTypesStrategy)
public void setCatalogTypeService(CatalogTypeService catalogTypeService)
public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
public void setUserService(UserService userService)
Copyright © 2018 SAP SE. All Rights Reserved.