Class BaseBatchValidator<ResourceDraftT,​SyncOptionsT extends BaseSyncOptions,​SyncStatisticsT extends BaseSyncStatistics>

    • Method Detail

      • validateAndCollectReferencedKeys

        public abstract org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<ResourceDraftT>,​?> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                             java.util.List<ResourceDraftT> drafts)
        Given the List<D> (e.g.CustomerDraft) of drafts this method attempts to validate drafts and collect referenced keys from the draft and return an ImmutablePair<Set<D>, ?> which contains the Set of valid drafts and referenced keys.
        Parameters:
        drafts - the drafts to validate.
        Returns:
        ImmutablePair<Set<D>, ?> which contains the Set of valid drafts and referenced keys.
      • collectReferencedKeyFromResourceIdentifier

        protected <T> void collectReferencedKeyFromResourceIdentifier​(@Nullable
                                                                      com.commercetools.api.models.common.ResourceIdentifier resourceIdentifier,
                                                                      @Nonnull
                                                                      java.util.function.Consumer<java.lang.String> keyConsumer)
      • collectReferencedKeyFromCustomFieldsDraft

        protected void collectReferencedKeyFromCustomFieldsDraft​(@Nullable
                                                                 com.commercetools.api.models.type.CustomFieldsDraft customFieldsDraft,
                                                                 @Nonnull
                                                                 java.util.function.Consumer<java.lang.String> keyConsumer)
      • collectReferencedKeysFromAssetDrafts

        protected void collectReferencedKeysFromAssetDrafts​(@Nullable
                                                            java.util.List<com.commercetools.api.models.common.AssetDraft> assetDrafts,
                                                            @Nonnull
                                                            java.util.function.Consumer<java.lang.String> keyConsumer)
      • handleError

        protected void handleError​(@Nonnull
                                   SyncException syncException)
      • handleError

        protected void handleError​(@Nonnull
                                   java.lang.String errorMessage)