Class StateSyncStatistics

    • Constructor Detail

      • StateSyncStatistics

        public StateSyncStatistics()
    • Method Detail

      • getReportMessage

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

        "Summary: 4 state(s) were processed in total (1 created, 1 updated, 1 failed to sync and 1 product(s) with a missing transition(s))."

        Specified by:
        getReportMessage in class BaseSyncStatistics<StateSyncStatistics>
        Returns:
        a summary message of the states sync statistics instance.
      • getThis

        protected StateSyncStatistics getThis()
        Description copied from class: BaseSyncStatistics
        Returns this instance of T, which extends BaseSyncStatistics. The purpose of this method is to make sure that this is an instance of a class which extends BaseSyncStatistics in order to be used in the generic methods of the class. Otherwise, without this method, the methods above would need to cast this to T which could lead to a runtime error of the class was extended in a wrong way.
        Specified by:
        getThis in class BaseSyncStatistics<StateSyncStatistics>
        Returns:
        an instance of the class that overrides this method.
      • getNumberOfStatesWithMissingParents

        public int getNumberOfStatesWithMissingParents()
        Returns the total number of states with missing parents.
        Returns:
        the total number of states with missing parents.
      • addMissingDependency

        public void addMissingDependency​(@Nonnull
                                         java.lang.String parentKey,
                                         @Nonnull
                                         java.lang.String childKey)
        This method checks if there is an entry with the key of the missingParentStateKey in the stateKeysWithMissingParents, if there isn't it creates a new entry with this parent key and as a value a new set containing the childKey. Otherwise, if there is already, it just adds the childKey to the existing set.
        Parameters:
        parentKey - the key of the missing parent.
        childKey - the key of the state with a missing parent.
      • removeAndGetReferencingKeys

        @Nullable
        public java.util.Set<java.lang.String> removeAndGetReferencingKeys​(@Nonnull
                                                                           java.lang.String key)