Class ProductTypeSyncStatistics

    • Constructor Detail

      • ProductTypeSyncStatistics

        public ProductTypeSyncStatistics()
    • Method Detail

      • getReportMessage

        public java.lang.String getReportMessage()
        Builds a summary of the product type sync statistics instance that looks like the following example:

        "Summary: 2 product types were processed in total (0 created, 0 updated, 0 failed to sync and 0 product types with at least one NestedType or a Set of NestedType attribute definition(s) referencing a missing productType)."

        Specified by:
        getReportMessage in class BaseSyncStatistics
        Returns:
        a summary message of the product types sync statistics instance.
      • getNumberOfProductTypesWithMissingNestedProductTypes

        public int getNumberOfProductTypesWithMissingNestedProductTypes()
        Returns the total number of product types with at least one NestedType or a Set of NestedType attribute definition(s) referencing a missing productType.
        Returns:
        the total number of product types with at least one NestedType or a Set of NestedType attribute definition(s) referencing a missing productType.
      • getProductTypeKeysWithMissingParents

        public java.util.Map<java.lang.String,​java.util.concurrent.ConcurrentHashMap<java.lang.String,​java.util.concurrent.ConcurrentHashMap.KeySetView<io.sphere.sdk.products.attributes.AttributeDefinitionDraft,​java.lang.Boolean>>> getProductTypeKeysWithMissingParents()
        Returns:
        an unmodifiable ConcurrentHashMap (missingNestedProductTypes) which keeps track of the keys of missing product types, the keys of the product types which are referencing those missing product types and a list of attribute definitions which contains those references.
        • key: key of the missing product type
        • value: a map of which consists of:
          • key: key of the product type referencing the missing product type.
          • value: a set of the attribute definition drafts which contains the reference to the missing product type.
      • putMissingNestedProductType

        public void putMissingNestedProductType​(@Nonnull
                                                java.lang.String missingNestedProductTypeKey,
                                                @Nonnull
                                                java.lang.String referencingProductTypeKey,
                                                @Nonnull
                                                io.sphere.sdk.products.attributes.AttributeDefinitionDraft referencingAttributeDefinitionDraft)
        Adds a new entry for a referencingAttributeDefinitionDraft that is pointed to by a referencingProductTypeKey which is pointed to by a missingNestedProductTypeKey.

        If any of the inner sets/maps is not existing (null), this method will create a new set/map with only this new entry.

        Important: This method is meant to be used only for internal use of the library and should not be used by externally.

        Parameters:
        missingNestedProductTypeKey - the key of the missing nested product type.
        referencingProductTypeKey - the key of the referencing product type.
        referencingAttributeDefinitionDraft - the referencing attribute definition draft.
      • removeReferencingProductTypeKey

        public void removeReferencingProductTypeKey​(@Nonnull
                                                    java.lang.String referencingProductTypeKey)
        Removes all occurrences of the referencing product type key from missingNestedProductTypes. If there are no referencing product types for any missing nested product type, the whole entry for this missing nested product type will be removed from missingNestedProductTypes.

        Important: This method is meant to be used only for internal use of the library and should not be used by externally.

        Parameters:
        referencingProductTypeKey - the key that should be removed from missingNestedProductTypes.