Class BaseBatchValidator<D,​O extends BaseSyncOptions,​S extends BaseSyncStatistics>

    • Constructor Summary

      Constructors 
      Constructor Description
      BaseBatchValidator​(O syncOptions, S syncStatistics)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void collectReferencedKeyFromCustomFieldsDraft​(io.sphere.sdk.types.CustomFieldsDraft customFieldsDraft, java.util.function.Consumer<java.lang.String> keyConsumer)  
      protected <T> void collectReferencedKeyFromReference​(io.sphere.sdk.models.Reference<T> reference, java.util.function.Consumer<java.lang.String> keyInReferenceSupplier)  
      protected <T> void collectReferencedKeyFromResourceIdentifier​(io.sphere.sdk.models.ResourceIdentifier<T> resourceIdentifier, java.util.function.Consumer<java.lang.String> keyConsumer)  
      protected void collectReferencedKeysFromAssetDrafts​(java.util.List<io.sphere.sdk.models.AssetDraft> assetDrafts, java.util.function.Consumer<java.lang.String> keyConsumer)  
      protected void handleError​(SyncException syncException)  
      protected void handleError​(java.lang.String errorMessage)  
      abstract org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<D>,​?> validateAndCollectReferencedKeys​(java.util.List<D> drafts)
      Given the List<D> (e.g.CategoryDraft) 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseBatchValidator

        public BaseBatchValidator​(@Nonnull
                                  O syncOptions,
                                  @Nonnull
                                  S syncStatistics)
    • Method Detail

      • validateAndCollectReferencedKeys

        public abstract org.apache.commons.lang3.tuple.ImmutablePair<java.util.Set<D>,​?> validateAndCollectReferencedKeys​(@Nonnull
                                                                                                                                java.util.List<D> drafts)
        Given the List<D> (e.g.CategoryDraft) 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
                                                                      io.sphere.sdk.models.ResourceIdentifier<T> resourceIdentifier,
                                                                      @Nonnull
                                                                      java.util.function.Consumer<java.lang.String> keyConsumer)
      • collectReferencedKeyFromCustomFieldsDraft

        protected void collectReferencedKeyFromCustomFieldsDraft​(@Nullable
                                                                 io.sphere.sdk.types.CustomFieldsDraft customFieldsDraft,
                                                                 @Nonnull
                                                                 java.util.function.Consumer<java.lang.String> keyConsumer)
      • collectReferencedKeysFromAssetDrafts

        protected void collectReferencedKeysFromAssetDrafts​(@Nullable
                                                            java.util.List<io.sphere.sdk.models.AssetDraft> assetDrafts,
                                                            @Nonnull
                                                            java.util.function.Consumer<java.lang.String> keyConsumer)
      • collectReferencedKeyFromReference

        protected <T> void collectReferencedKeyFromReference​(@Nullable
                                                             io.sphere.sdk.models.Reference<T> reference,
                                                             @Nonnull
                                                             java.util.function.Consumer<java.lang.String> keyInReferenceSupplier)
      • handleError

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

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