Synchronization API

The Synchronization API provides operations to create jobs to synchronize content catalog versions, to retrieve the status of a synchronization job for a specified content catalog version pair or to retrieve the status of a synchronization job for a target content catalog version.

Facade

The Synchronization API exposes the following facade in the SynchronizationFacade.java file to create a synchronization job and get the job's status.

public interface SynchronizationFacade
{
    SyncJobData getSynchronizationByCatalogSourceTarget(SyncJobRequestData syncJobRequest) throws ValidationException;
    SyncJobData getLastSynchronizationByCatalogTarget(SyncJobRequestData syncJobRequest) throws ValidationException;
    SyncJobData createCatalogSynchronization(SyncJobRequestData syncJobRequest) throws SynchronizationInProgressException, CMSItemNotFoundException;
} 

Implementation

The default synchronization facade creates a cron job that contains information about how to perform the synchronization, such as the source and target content catalog versions. The source content catalog version represents where data is read from and the target content catalog version represents where data it written to. The facade uses a cron job service to schedule and execute the synchronization.

Beans

The Synchronization API relies on the following DTO as shown in this code excerpt from the cmsfacades-beans.xml file:

<bean class="de.hybris.platform.cmsfacades.data.SyncJobData">
    <property name="syncStatus" type="String" />
    <property name="startDate" type="java.util.Date" />
    <property name="endDate" type="java.util.Date" />
    <property name="creationDate" type="java.util.Date" />
    <property name="lastModifiedDate" type="java.util.Date" />
    <property name="syncResult" type="String" />
    <property name="sourceCatalogVersion" type="String" />
    <property name="targetCatalogVersion" type="String" />
    <property name="code" type="String"/>
</bean>
 
<bean class="de.hybris.platform.cmsfacades.data.SyncJobRequestData"
      extends="de.hybris.platform.cmsfacades.data.SyncRequestData">
</bean>
 
<bean class="de.hybris.platform.cmsfacades.data.SyncRequestData">
    <property name="catalogId" type="String"/>
    <property name="sourceVersionId" type="String"/>
    <property name="targetVersionId" type="String"/>
</bean>

Spring Configuration

The Synchronization API declares its Spring beans in the cmsfacades-spring.xml file.