Package com.google.gerrit.server.submit
Class SubscriptionGraph
- java.lang.Object
-
- com.google.gerrit.server.submit.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SubscriptionGraph.DefaultFactory
static interface
SubscriptionGraph.Factory
static class
SubscriptionGraph.SubscriptionGraphModule
-
Constructor Summary
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<BranchNameKey>
getAffectedSuperBranches(Project.NameKey project)
Returns all branches within the superprojectproject
which have submodule subscriptions.com.google.common.collect.ImmutableSet<Project.NameKey>
getAffectedSuperProjects()
Get all superprojects affected.com.google.common.collect.ImmutableSet<BranchNameKey>
getSortedSuperprojectAndSubmoduleBranches()
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 relatedSubmoduleSubscription
s whose super branch isbranch
.com.google.common.collect.ImmutableSet<BranchNameKey>
getUpdatedBranches()
Get branches updated as part of the enclosing submit or push batch.boolean
hasSubscription(BranchNameKey branch)
See if abranch
is a superproject branch affected.boolean
hasSuperproject(BranchNameKey branch)
Check if abranch
is a submodule of a superproject.
-
-
-
Constructor Detail
-
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 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 superprojectproject
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 abranch
is a submodule of a superproject.
-
hasSubscription
public boolean hasSubscription(BranchNameKey branch)
See if abranch
is a superproject branch affected.
-
getSubscriptions
public com.google.common.collect.ImmutableSet<SubmoduleSubscription> getSubscriptions(BranchNameKey branch)
Get all relatedSubmoduleSubscription
s whose super branch isbranch
.
-
-