Class SyncItemJob

    • Field Detail

      • START_TIME

        protected static final java.lang.String START_TIME
        Deprecated.
        See Also:
        Constant Field Values
      • HIDDEN_ATTRIBUTES

        public static final java.util.Set<java.lang.String> HIDDEN_ATTRIBUTES
        Deprecated.
    • Constructor Detail

      • SyncItemJob

        public SyncItemJob()
        Deprecated.
    • Method Detail

      • removeSyncTimestamps

        protected void removeSyncTimestamps​(SessionContext ctx)
        Deprecated.
      • getDefaultRootTypes

        public static java.util.List<ComposedType> getDefaultRootTypes()
        Deprecated.
        Provides the list of default root types. By now these are
        • Category
        • Product
        • Media
        • Keyword
        • PriceRow (global rows only)
        • TaxRow (global rows only)
        • DiscountRow (global rows only)
        • MediaContainer
      • isAbortable

        public boolean isAbortable​(CronJob conJob)
        Deprecated.
        The SyncCatalogVersionJob supports aborting.
        Overrides:
        isAbortable in class Job
        Parameters:
        conJob - the current execution of this job.
        Returns:
        true if the cronjob is running and the job supports aborting via GeneratedCronJob.setRequestAbort(boolean)
      • createSyncSessionContext

        protected SessionContext createSyncSessionContext​(SyncItemCronJob cronJob)
        Deprecated.
        Returns a new SessionContext with the following settings.
        • LANGUAGE: null
        • DISABLE_RESTRICTIONS: false
        • DISABLE_RESTRICTION_GROUP_INHERITANCE: false
        • USE_FAST_ALGORITHMS: true
        • DISABLE_ATTRIBUTE_CHECK: true
        • DISABLE_SUBCATEGORY_REMOVALCHECK: true
        • DISABLE_SETALLOWEDPRINCIPAL_RECURSIVELY: true
        • LANGUAGE_FALLBACK_ENABLED: false
        • TRANSACTION_4_ALLATTRIBUTES: false
        Parameters:
        cronJob - the assigned SyncItemCronJob
        Returns:
        new SessionContext instance:
      • initializeTimeCounter

        protected void initializeTimeCounter​(SyncItemCronJob cronJob)
        Deprecated.
      • getElapsedMillis

        public long getElapsedMillis​(SyncItemCronJob cronJob)
        Deprecated.
      • canUndo

        protected boolean canUndo​(CronJob cronJob)
        Deprecated.
        This job does not support undo!
        Overrides:
        canUndo in class Job
        Parameters:
        cronJob - the CronJob to undo changes for
        Returns:
        true if this Job is undoable, false otherwise.
      • checkCatalogVersionValidity

        protected boolean checkCatalogVersionValidity​(SyncItemCronJob cronJob,
                                                      SyncItemJob.SyncItemCopyContext syncItemCopyContext)
        Deprecated.
        Use this method to check if the given catalog version is valid for synchronization. As default this method will check whether or not duplicate product IDs exist or not. If so a error log is created.
        Parameters:
        cronJob -
        syncItemCopyContext -
        Returns:
        true if the catalog version is valid (and synchronization may use it)
      • registerSynchronizedItem

        protected void registerSynchronizedItem​(SyncItemCronJob cronjob,
                                                Item source,
                                                Item copy,
                                                java.lang.String message)
        Deprecated.
        Registers a synchronized item pair permanently by creating a ChangeDescriptorfor them. If the current cronjob is aborted or crashes these changes are loaded on restart so that no item is synchronized twice.

        Please note that this feature is disabled if change recording is disabled dor the executed chronjob !

        Parameters:
        cronjob - the SyncItemCronJob
        source - sourceitem
        copy - copyitem
        message - a message
      • getSingleVersionCatalogItems

        protected java.util.List<PK> getSingleVersionCatalogItems​(SessionContext ctx,
                                                                  ComposedType type,
                                                                  java.lang.String additionalQueryRestrictions,
                                                                  boolean fromSource,
                                                                  int start,
                                                                  int range)
        Deprecated.
      • getMissingTargetItems

        protected java.util.Set<Item> getMissingTargetItems​(java.util.Collection<? extends Item> sourceItems,
                                                            java.util.Collection<? extends Item> targetItems,
                                                            CatalogVersion sourceVersion)
        Deprecated.
      • addCatalogItemsToSync

        public void addCatalogItemsToSync​(SyncItemCronJob cronJob,
                                          java.util.Collection<? extends Item> items)
        Deprecated.
        Added any catalog item except categories to a syncronization.
        Parameters:
        cronJob - the synchronization cronjob
        items - the items to add
      • addCategoriesToSync

        public void addCategoriesToSync​(SyncItemCronJob cronJob,
                                        java.util.Collection<? extends Category> categories,
                                        boolean includeSubcategories,
                                        boolean includeProducts)
        Deprecated.
      • configureFullVersionSync

        public void configureFullVersionSync​(SyncItemCronJob cronJob)
        Deprecated.
        Collects all changes between the source and target version of this job. Depending whether or not new item creation and missing item removal has been configured new (source version) items and missing (source version) items are scheduled too.
      • toPendingItemsList

        protected java.util.List<PK[]> toPendingItemsList​(java.util.List<PK> itemPKs,
                                                          boolean remove)
        Deprecated.
      • configureFullSyncForItemType

        protected void configureFullSyncForItemType​(SessionContext ctx,
                                                    SyncItemCronJob cronJob,
                                                    ComposedType type,
                                                    java.lang.String additionalQueryRestrictions,
                                                    boolean removeMissing,
                                                    boolean createNew,
                                                    boolean forceUpdate,
                                                    int range)
        Deprecated.
        Configures a full synchronization of the items of a given type according to the specified sync cronjob settings.
        Parameters:
        ctx - the enclosing session context
        cronJob - the sync cronjob (among others) holding source and target version
        type - the item type specifying which items should be synchronized
        additionalQueryRestrictions - flexible search WHERE parameters to be considered when querying new, removed or possible item pairs when scheduling synchronization
        removeMissing - if true all items are removed which still exist in target version but do not exist in source version
        createNew - if true new items are created with the target version if the exist in source version
        forceUpdate - if true the process will include even item pairs which are considered up to date
        range - if > 0 this parameter enables paging logic while collecting items via flexible search; otherwise all matches are processed at once ( read as PK so no actual item is loaded into memory! )
      • performCronJob

        protected CronJob.CronJobResult performCronJob​(CronJob cronJob)
        Deprecated.
        Description copied from class: Job
        You have to implement this method in your Job. Here you can execute the job. You have to return a CronJobResult that indicates whether the Job was successfully executed or not.
        Specified by:
        performCronJob in class Job
        Parameters:
        cronJob - the CronJob to execute
        Returns:
        a CronJobResult that indicates whether the Job was successfully executed or not.

        See Also:
        CronJob.getFinishedResult(boolean), CronJob.getAbortResult()
      • doSynchronization

        protected boolean doSynchronization​(SyncItemJob.SyncItemCopyContext syncItemCopyContext,
                                            SyncItemCronJob cronJob)
                                     throws AbortCronJobException
        Deprecated.
        Executes actual synchronization.
        Parameters:
        syncItemCopyContext - the copy context
        cronJob - the cronjob
        Returns:
        true if no (ignored) errors occured, false otherwise
        Throws:
        AbortCronJobException - if the cronjob has been set to be aborted during execution
      • doAbort

        protected CronJob.CronJobResult doAbort​(SyncItemCronJob cronJob)
        Deprecated.
        This method is called if abort is requested by the user while still executing this job.
        Parameters:
        cronJob - the currently executing cronjob
        Returns:
        the abort cronjob result
      • canSelectAttribute

        protected boolean canSelectAttribute​(AttributeDescriptor attributeDescriptor)
        Deprecated.
      • setAllExportAttributeDescriptors

        public void setAllExportAttributeDescriptors​(SessionContext ctx,
                                                     java.util.Map syncMap)
        Deprecated.
        setter for HMC editor - we just set the 'includedInSync' attribute
        Specified by:
        setAllExportAttributeDescriptors in class GeneratedSyncItemJob
        Parameters:
        syncMap - Map<AttributeDescriptor,Boolean>
      • getConfigFor

        public SyncAttributeDescriptorConfig getConfigFor​(AttributeDescriptor attributeDescriptor,
                                                          boolean createOnDemand)
        Deprecated.
        Returns the SyncAttributeDescriptorConfig instance which is responsible for all publication settings of the specified attribute descriptor.

        Please note that the attribute descriptor cannot be a inherited one because publication settings are generally stored for declared attributes only!

        Parameters:
        attributeDescriptor - the attribute descriptor to get settings item for
        createOnDemand - if true and no settings item exists create one
      • getConfigFor

        public SyncAttributeDescriptorConfig getConfigFor​(SessionContext ctx,
                                                          AttributeDescriptor attributeDescriptor,
                                                          boolean createOnDemand)
        Deprecated.
        Returns the SyncAttributeDescriptorConfig instance which is responsible for all publication settings of the specified attribute descriptor.

        Please note that the attribute descriptor cannot be a inherited one because publication settings are generally stored for declared attributes only!

        Parameters:
        ctx - the enclosing session context
        attributeDescriptor - the attribute descriptor to get settings item for
        createOnDemand - if true and no settings item exists create one
      • getAttributeAndConfigPairs

        protected java.util.List<java.util.List> getAttributeAndConfigPairs()
        Deprecated.
        Returns [AttributeDescriptor,SyncAttributeDescriptorConfig] pairs for all existing declared attribute descriptors and their sync config item if it exists for this job. Otherwise the second entry is null.
      • assureCatalogItemTypes

        protected java.util.List<ComposedType> assureCatalogItemTypes​(java.util.List<ComposedType> types)
        Deprecated.