Class SubscriptionGraph


  • public class SubscriptionGraph
    extends Object
    A container which stores subscription relationship. A SubscriptionGraph is calculated every time changes are pushed. Some branches are updated in these changes, and if these branches are subscribed by other projects, SubscriptionGraph would record information about these updated branches and branches/projects affected.
    • Method Detail

      • getUpdatedBranches

        public com.google.common.collect.ImmutableSet<BranchNameKey> getUpdatedBranches()
        Get branches updated as part of the enclosing submit or push batch.
      • getAffectedSuperProjects

        public com.google.common.collect.ImmutableSet<Project.NameKey> getAffectedSuperProjects()
        Get all superprojects affected.
      • getAffectedSuperBranches

        public com.google.common.collect.ImmutableSet<BranchNameKey> getAffectedSuperBranches​(Project.NameKey project)
        Returns all branches within the superproject project which have submodule subscriptions.
      • getSortedSuperprojectAndSubmoduleBranches

        public com.google.common.collect.ImmutableSet<BranchNameKey> getSortedSuperprojectAndSubmoduleBranches()
        Get all affected branches, including the submodule branches and superproject branches, sorted by traversal order.
        See Also:
        sortedBranches
      • hasSuperproject

        public boolean hasSuperproject​(BranchNameKey branch)
        Check if a branch is a submodule of a superproject.
      • hasSubscription

        public boolean hasSubscription​(BranchNameKey branch)
        See if a branch is a superproject branch affected.
      • getSubscriptions

        public com.google.common.collect.ImmutableSet<SubmoduleSubscription> getSubscriptions​(BranchNameKey branch)
        Get all related SubmoduleSubscriptions whose super branch is branch.