Package com.google.gerrit.server.submit
Class SubscriptionGraph
java.lang.Object
com.google.gerrit.server.submit.SubscriptionGraph
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic class -
Constructor Summary
ConstructorsConstructorDescriptionSubscriptionGraph(Set<BranchNameKey> updatedBranches, com.google.common.collect.SetMultimap<BranchNameKey, SubmoduleSubscription> targets, com.google.common.collect.SetMultimap<Project.NameKey, BranchNameKey> branchesByProject, Set<BranchNameKey> subscribedBranches, Set<BranchNameKey> sortedBranches) -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet<BranchNameKey> getAffectedSuperBranches(Project.NameKey project) Returns all branches within the superprojectprojectwhich have submodule subscriptions.com.google.common.collect.ImmutableSet<Project.NameKey> Get all superprojects affected.com.google.common.collect.ImmutableSet<BranchNameKey> Get all affected branches, including the submodule branches and superproject branches, sorted by traversal order.com.google.common.collect.ImmutableSet<SubmoduleSubscription> getSubscriptions(BranchNameKey branch) Get all relatedSubmoduleSubscriptions whose super branch isbranch.com.google.common.collect.ImmutableSet<BranchNameKey> Get branches updated as part of the enclosing submit or push batch.booleanhasSubscription(BranchNameKey branch) See if abranchis a superproject branch affected.booleanhasSuperproject(BranchNameKey branch) Check if abranchis a submodule of a superproject.
-
Constructor Details
-
SubscriptionGraph
public SubscriptionGraph(Set<BranchNameKey> updatedBranches, com.google.common.collect.SetMultimap<BranchNameKey, SubmoduleSubscription> targets, com.google.common.collect.SetMultimap<Project.NameKey, BranchNameKey> branchesByProject, Set<BranchNameKey> subscribedBranches, Set<BranchNameKey> sortedBranches)
-
-
Method Details
-
getUpdatedBranches
Get branches updated as part of the enclosing submit or push batch. -
getAffectedSuperProjects
Get all superprojects affected. -
getAffectedSuperBranches
public com.google.common.collect.ImmutableSet<BranchNameKey> getAffectedSuperBranches(Project.NameKey project) Returns all branches within the superprojectprojectwhich 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:
-
hasSuperproject
Check if abranchis a submodule of a superproject. -
hasSubscription
See if abranchis a superproject branch affected. -
getSubscriptions
public com.google.common.collect.ImmutableSet<SubmoduleSubscription> getSubscriptions(BranchNameKey branch) Get all relatedSubmoduleSubscriptions whose super branch isbranch.
-