Interface CatalogSynchronizationService

    • Method Detail

      • synchronizeFully

        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. The actual sync process is backed by a also new CatalogVersionSyncCronJobModel which is started synchronously.
        Parameters:
        numberOfThreads - specifies the number of sync workers to be used - overrides the number configured in catalog.sync.workers
      • synchronize

        SyncResult synchronize​(SyncItemJobModel syncJob,
                               SyncConfig syncConfig)
        Starts synchronization for an existing SyncItemJobModel. 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.
      • getSynchronizationSourceFor

        <T extends ItemModel> T getSynchronizationSourceFor​(SyncItemJobModel theSyncJob,
                                                            ItemModel target)
        Returns the counterpart for the target item against given sync job theSyncJob.
      • getSynchronizationTargetFor

        <T extends ItemModel> T getSynchronizationTargetFor​(SyncItemJobModel theSyncJob,
                                                            ItemModel source)
        Returns the counterpart for the source item against given sync job theSyncJob.
      • isInProgress

        boolean isInProgress​(SyncItemJobModel theSyncJob)
        Checks whether the given givenSyncJob is currently in progress.
      • lookupCurrentSynchronizations

        java.util.Collection<SyncResult> lookupCurrentSynchronizations​(SyncItemJobModel theSyncJob)
        Returns the current executions for the given theSyncJob.
      • 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 job
        principal - the principal
        Returns:
        a boolean