Class VcsModificationProcessor

    • Constructor Detail

      • VcsModificationProcessor

        public VcsModificationProcessor()
    • Method Detail

      • getId

        @NotNull
        public abstract String getId()
        Should return a unique id of the processor. It is used as a key for caching calculated modifications.
        Returns:
        see above
      • getLimit

        @Nullable
        public abstract Integer getLimit()
        Returns:
        the limit for changes this processor uses or null if processor doesn't limit changes or doesn't limit them by the amount (e.g. limit by date).
      • changesCanBeCached

        public boolean changesCanBeCached()
        Returns:
        true if changes calculated with help of this processor can be cached and false otherwise Note: if false is returned by this method then existing cached changes won't be used when changes are computed with help of this processor
      • isSuitableFor

        public boolean isSuitableFor​(@NotNull
                                     VcsModificationProcessor anotherProcessor)
        Returns true if changes calculated with this processor are suitable for the provided processor too.
        Parameters:
        anotherProcessor -
        Returns:
      • processAttachedModification

        public abstract boolean processAttachedModification​(@NotNull
                                                            SVcsModification vcsModification)
        Processes a single SVcsModification. This method is called only for changes attached to a build configuration where the changes calculation is performed.
        Parameters:
        vcsModification - VCS modification to process.
        Returns:
        false if no further processing needed.
        Since:
        2019.2.3
      • processModification

        public boolean processModification​(@NotNull
                                           SVcsModification vcsModification)
        This method is called for every SVcsModification visited during the changes collection process.
        Parameters:
        vcsModification - visited VCS modification
        Returns:
        false if no further processing needed.
        Since:
        2019.2.3
      • processUnloadedModification

        public boolean processUnloadedModification​(long modId,
                                                   long vcsRootId)
        This method is called when we've reached a VCS modification which is not loaded into the in-memory cache. For instance, this can happen if the VCS modification is too old and was already unloaded from memory.
        Parameters:
        modId - id of the unloaded modification
        vcsRootId - id of the VCS root instance
        Returns:
        true if processing should be continued and false otherwise
      • filterOrderedModifications

        @NotNull
        public static List<SVcsModification> filterOrderedModifications​(@NotNull
                                                                        List<SVcsModification> orderedChanges,
                                                                        @NotNull
                                                                        VcsModificationProcessor processor)
        Traverse ordered changes and collect them while they confirm the given processor; on the first non-conforming item stop and return collected items.
        Parameters:
        orderedChanges - changes
        processor - processor
        Returns:
        filtered collection, see above