Interface CatalogSynchronizationService
-
- All Known Implementing Classes:
DefaultCatalogSynchronizationService
public interface CatalogSynchronizationService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canSynchronize(SyncItemJobModel syncJob, PrincipalModel principal)
Returns true if the principal has sync permissions to synchronize between catalog versions from given sync job.java.util.List<ItemModel>
getApplicableItems(java.util.List<ItemModel> givenItems, SyncItemJobModel syncItemJob)
Filters given items returning only the ones being applicable to the given sync job.<T extends ItemModel>
TgetSynchronizationSourceFor(SyncItemJobModel theSyncJob, ItemModel target)
Returns the counterpart for thetarget
item against given sync jobtheSyncJob
.ItemSyncTimestampModel
getSynchronizationSourceTimestampFor(SyncItemJobModel theSyncJob, ItemModel source)
Returns the existingItemSyncTimestampModel
for thesource
item in the scope of the given sync job.<T extends ItemModel>
TgetSynchronizationTargetFor(SyncItemJobModel theSyncJob, ItemModel source)
Returns the counterpart for thesource
item against given sync jobtheSyncJob
.ItemSyncTimestampModel
getSynchronizationTargetTimestampFor(SyncItemJobModel theSyncJob, ItemModel target)
Returns the existingItemSyncTimestampModel
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 (asSyncItemJobModel
item) between a specified source catalog version and target catalog version.boolean
isInProgress(SyncItemJobModel theSyncJob)
Checks whether the givengivenSyncJob
is currently in progress.java.util.Collection<SyncResult>
lookupCurrentSynchronizations(SyncItemJobModel theSyncJob)
Returns the current executions for the giventheSyncJob
.SyncResult
performSynchronization(java.util.List<ItemModel> givenItems, SyncItemJobModel syncItemJob, SyncConfig syncConfig)
Performs the synchronization for given items.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
synchronize(SyncItemJobModel syncJob, SyncConfig syncConfig)
Starts synchronization for an existingSyncItemJobModel
.void
synchronizeFully(CatalogVersionModel source, CatalogVersionModel target)
For the given catalog version pair a newCatalogVersionSyncJobModel
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 newCatalogVersionSyncJobModel
is being created configured to sync all default catalog item types.void
synchronizeFullyInBackground(CatalogVersionModel source, CatalogVersionModel target)
For the given catalog version pair a newCatalogVersionSyncJobModel
is being created configured to sync all default catalog item types.
-
-
-
Method Detail
-
synchronizeFully
void synchronizeFully(CatalogVersionModel source, CatalogVersionModel target)
For the given catalog version pair a newCatalogVersionSyncJobModel
is being created configured to sync all default catalog item types. The actual sync process is backed by a also newCatalogVersionSyncCronJobModel
which is performed synchronously.
-
synchronizeFully
void synchronizeFully(CatalogVersionModel source, CatalogVersionModel target, int numberOfThreads)
For the given catalog version pair a newCatalogVersionSyncJobModel
is being created configured to sync all default catalog item types. The actual sync process is backed by a also newCatalogVersionSyncCronJobModel
which is started synchronously.- Parameters:
numberOfThreads
- specifies the number of sync workers to be used - overrides the number configured incatalog.sync.workers
-
synchronizeFullyInBackground
void synchronizeFullyInBackground(CatalogVersionModel source, CatalogVersionModel target)
For the given catalog version pair a newCatalogVersionSyncJobModel
is being created configured to sync all default catalog item types. The actual sync process is backed by a also newCatalogVersionSyncCronJobModel
which is started asynchronously.
-
synchronize
SyncResult synchronize(SyncItemJobModel syncJob, SyncConfig syncConfig)
Starts synchronization for an existingSyncItemJobModel
. 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 process
-
performSynchronization
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.Note that for each job the list of items is being filtered to schedule only the ones which are actually applicable (being compatible with the job's root type collection).
For influencing the sync behavior a sync config object can be passed, e.g. for controlling the level of multi-threading.
-
performSynchronization
SyncResult performSynchronization(java.util.List<ItemModel> givenItems, SyncItemJobModel syncItemJob, SyncConfig syncConfig)
Performs the synchronization for given items.Note that the list of items is being filtered to schedule only the ones which are actually applicable (being compatible with the job's root type collection).
For influencing the sync behavior a sync config object can be passed, e.g. for controlling the level of multi-threading.
-
getApplicableItems
java.util.List<ItemModel> getApplicableItems(java.util.List<ItemModel> givenItems, SyncItemJobModel syncItemJob)
Filters given items returning only the ones being applicable to the given sync job. Being applicable means whether or not an item is compatible to the job's root type collection and whether it belongs to the specified catalog version.
-
getSynchronizationSourceTimestampFor
ItemSyncTimestampModel getSynchronizationSourceTimestampFor(SyncItemJobModel theSyncJob, ItemModel source)
Returns the existingItemSyncTimestampModel
for thesource
item in the scope of the given sync job. In case of the item never been synchronized before NULL is returned.
-
getSynchronizationTargetTimestampFor
ItemSyncTimestampModel getSynchronizationTargetTimestampFor(SyncItemJobModel theSyncJob, ItemModel target)
Returns the existingItemSyncTimestampModel
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.
-
getSynchronizationSourceFor
<T extends ItemModel> T getSynchronizationSourceFor(SyncItemJobModel theSyncJob, ItemModel target)
Returns the counterpart for thetarget
item against given sync jobtheSyncJob
.
-
getSynchronizationTargetFor
<T extends ItemModel> T getSynchronizationTargetFor(SyncItemJobModel theSyncJob, ItemModel source)
Returns the counterpart for thesource
item against given sync jobtheSyncJob
.
-
isInProgress
boolean isInProgress(SyncItemJobModel theSyncJob)
Checks whether the givengivenSyncJob
is currently in progress.
-
lookupCurrentSynchronizations
java.util.Collection<SyncResult> lookupCurrentSynchronizations(SyncItemJobModel theSyncJob)
Returns the current executions for the giventheSyncJob
.
-
getSyncJob
SyncItemJobModel getSyncJob(CatalogVersionModel source, CatalogVersionModel target, java.lang.String qualifier)
Returns the publication rule (asSyncItemJobModel
item) between a specified source catalog version and target catalog version.
-
canSynchronize
boolean canSynchronize(SyncItemJobModel syncJob, PrincipalModel principal)
Returns true if the principal has sync permissions to synchronize between catalog versions from given sync job.- Parameters:
syncJob
- the sync jobprincipal
- the principal- Returns:
- a boolean
-
-