public class ProductTypeSyncStatistics extends BaseSyncStatistics
reportMessage| Constructor and Description |
|---|
ProductTypeSyncStatistics() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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() |
java.lang.String |
getReportMessage()
Builds a summary of the product type sync statistics instance that looks like the following example:
|
void |
putMissingNestedProductType(java.lang.String missingNestedProductTypeKey,
java.lang.String referencingProductTypeKey,
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. |
void |
removeReferencingProductTypeKey(java.lang.String referencingProductTypeKey)
Removes all occurrences of the referencing product type key from
missingNestedProductTypes. |
calculateProcessingTime, getCreated, getFailed, getLatestBatchHumanReadableProcessingTime, getLatestBatchProcessingTimeInDays, getLatestBatchProcessingTimeInHours, getLatestBatchProcessingTimeInMillis, getLatestBatchProcessingTimeInMinutes, getLatestBatchProcessingTimeInSeconds, getProcessed, getUpdated, incrementCreated, incrementCreated, incrementFailed, incrementFailed, incrementProcessed, incrementProcessed, incrementUpdated, incrementUpdated, startTimerpublic java.lang.String getReportMessage()
"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)."
getReportMessage in class BaseSyncStatisticspublic int getNumberOfProductTypesWithMissingNestedProductTypes()
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()
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.
public void putMissingNestedProductType(@Nonnull
java.lang.String missingNestedProductTypeKey,
@Nonnull
java.lang.String referencingProductTypeKey,
@Nonnull
io.sphere.sdk.products.attributes.AttributeDefinitionDraft referencingAttributeDefinitionDraft)
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.
missingNestedProductTypeKey - the key of the missing nested product type.referencingProductTypeKey - the key of the referencing product type.referencingAttributeDefinitionDraft - the referencing attribute definition draft.public void removeReferencingProductTypeKey(@Nonnull
java.lang.String referencingProductTypeKey)
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.
referencingProductTypeKey - the key that should be removed from missingNestedProductTypes.