public class LabelManagerImpl extends Object implements LabelManager
BUILDRESULT_LABEL_NAMESPACE, DEFAULT_MAX_RESULTS, FAVOURITE_LABEL_NAME, FAVOURITE_UNMARK_LABEL_NAME, LABEL_ADDED_TO_BUILD_RESULT, LABEL_CREATED, LABEL_DELETED, LABEL_REMOVED_FROM_BUILD_RESULT, NO_CHANGE| Constructor and Description |
|---|
LabelManagerImpl(LabelDao labelDao,
BuildResultsIndexer buildResultsIndexer,
JiraIssueUtils jiraIssueUtils,
PlanManager planManager,
ProjectManager projectManager,
ResultsSummaryManager resultsSummaryManager,
com.atlassian.event.api.EventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
int |
addFavourite(Plan plan,
com.atlassian.user.User user)
Adds a build to a user as favourite.
|
int |
addLabel(String labelName,
PlanKey planKey,
com.atlassian.user.User user)
Creates a normal label for a plan
|
int |
addLabel(String labelName,
PlanResultKey planResultKey,
com.atlassian.user.User user)
Add a label against a build result.
|
protected int |
addLabel(String labelName,
String namespace,
Project project,
Plan plan,
ResultsSummary resultsSummary,
String userName) |
boolean |
addLabels(List<String> labelNames,
PlanKey planKey,
com.atlassian.user.User user)
Creates multiple normal labels for a plan
|
List<ResultsSummary> |
findBuildResultsSummaryByLabel(String labelName)
Finds all
ResultsSummary labelled with given labelname |
List<LabelCount> |
findLabels(String namespace,
int maxResults,
Plan plan,
Project project)
Finds all labels in a given build, with namespace and maxResults.
|
Set<Label> |
getAllPlanLabels()
All labels used on a plan level
|
List<String> |
getFavouritesForPlan(ImmutablePlan plan)
Retrieves a list of usernames which have the given plan set as a favourite.
|
List<String> |
getFavouritesForPlan(Plan plan) |
Collection<Label> |
getLabelsByName(List<String> labelNames)
Gets list of labels based on label names
|
Set<Label> |
getPlanLabels(ImmutablePlan plan)
Get labels defined for a plan
|
boolean |
hasBuildResultsLabel(ResultsSummary buildResultsSummary,
String label)
Checks whether the build results summary has a particular label
|
boolean |
hasPlanLabel(Plan plan,
String label)
Checks whether the Plan has a particular label
|
boolean |
isFavourite(ImmutablePlan plan,
com.atlassian.user.User user)
Determines if the build is a user's favourite
Note that its more efficient to use
PlanManager.filterFavouritedPlans(java.util.Collection, com.atlassian.user.User)
if you are performing this operation over a collection of Plans |
boolean |
isManuallyUnmarkedFavourite(Plan plan,
com.atlassian.user.User user)
Flag which determines if the user has manually unmarked this build as favourite.
|
int |
removeFavourite(Plan plan,
com.atlassian.user.User user)
Removes a build from a user's favourite.
|
int |
removeLabel(String labelName,
PlanKey planKey,
com.atlassian.user.User user)
Remove the standard label for a plan (not all the labels for that plan)
|
int |
removeLabel(String labelName,
PlanResultKey planResultKey,
com.atlassian.user.User user)
Removes a label against a build result.
|
protected int |
removeLabel(String labelName,
String namespace,
Project project,
ImmutablePlan plan,
ResultsSummary resultsSummary) |
void |
saveLabelling(Labelling labelling)
Saves a specific labelling - does not do any validation or checking.
|
public LabelManagerImpl(LabelDao labelDao, BuildResultsIndexer buildResultsIndexer, JiraIssueUtils jiraIssueUtils, PlanManager planManager, ProjectManager projectManager, ResultsSummaryManager resultsSummaryManager, com.atlassian.event.api.EventPublisher eventPublisher)
public void saveLabelling(Labelling labelling)
LabelManagersaveLabelling in interface LabelManagerlabelling - to savepublic int addLabel(@Nullable
String labelName,
@Nullable
PlanResultKey planResultKey,
@Nullable
com.atlassian.user.User user)
LabelManageraddLabel in interface LabelManagerint identifying result of add processpublic int addLabel(@Nullable
String labelName,
@Nullable
PlanKey planKey,
@Nullable
com.atlassian.user.User user)
LabelManageraddLabel in interface LabelManagerpublic boolean addLabels(List<String> labelNames, @Nullable PlanKey planKey, @Nullable com.atlassian.user.User user)
LabelManageraddLabels in interface LabelManagerpublic int addFavourite(Plan plan, com.atlassian.user.User user)
LabelManageraddFavourite in interface LabelManagerint identifying result of add processpublic int removeLabel(String labelName, @Nullable PlanResultKey planResultKey, com.atlassian.user.User user)
LabelManagerremoveLabel in interface LabelManagerint identifying result of delete processpublic int removeLabel(@Nullable
String labelName,
@Nullable
PlanKey planKey,
@Nullable
com.atlassian.user.User user)
LabelManagerremoveLabel in interface LabelManager@NotNull public Set<Label> getAllPlanLabels()
LabelManagergetAllPlanLabels in interface LabelManagerLabel related to any plan@NotNull public Set<Label> getPlanLabels(@NotNull ImmutablePlan plan)
LabelManagergetPlanLabels in interface LabelManagerplan - Plan to filter labels withLabel related to the planpublic int removeFavourite(@NotNull
Plan plan,
@Nullable
com.atlassian.user.User user)
LabelManagerremoveFavourite in interface LabelManagerint identifying result of removal processpublic boolean hasBuildResultsLabel(@NotNull
ResultsSummary buildResultsSummary,
@NotNull
String label)
LabelManagerhasBuildResultsLabel in interface LabelManagerlabel - . could be emptyResultsSummarypublic boolean hasPlanLabel(@NotNull
Plan plan,
@NotNull
String label)
LabelManagerhasPlanLabel in interface LabelManagerlabel - . could be emptyPlanpublic Collection<Label> getLabelsByName(List<String> labelNames)
LabelManagergetLabelsByName in interface LabelManager@NotNull public List<ResultsSummary> findBuildResultsSummaryByLabel(@NotNull String labelName)
LabelManagerResultsSummary labelled with given labelnamefindBuildResultsSummaryByLabel in interface LabelManagerList of ResultsSummarypublic boolean isFavourite(@NotNull
ImmutablePlan plan,
@Nullable
com.atlassian.user.User user)
LabelManagerPlanManager.filterFavouritedPlans(java.util.Collection, com.atlassian.user.User)
if you are performing this operation over a collection of PlansisFavourite in interface LabelManagerboolean yes or nopublic boolean isManuallyUnmarkedFavourite(@NotNull
Plan plan,
@Nullable
com.atlassian.user.User user)
LabelManagerisManuallyUnmarkedFavourite in interface LabelManagerboolean flagpublic List<String> getFavouritesForPlan(Plan plan)
getFavouritesForPlan in interface LabelManager@NotNull public List<String> getFavouritesForPlan(@NotNull ImmutablePlan plan)
LabelManagergetFavouritesForPlan in interface LabelManager@NotNull public List<LabelCount> findLabels(@NotNull String namespace, int maxResults, @Nullable Plan plan, @Nullable Project project)
LabelManagerfindLabels in interface LabelManagerproject - @return List of LabelCount objects, mapping (Label to count of occurrences.protected int addLabel(@NotNull
String labelName,
String namespace,
@Nullable
Project project,
@Nullable
Plan plan,
@Nullable
ResultsSummary resultsSummary,
String userName)
protected int removeLabel(@NotNull
String labelName,
@NotNull
String namespace,
@NotNull
Project project,
@Nullable
ImmutablePlan plan,
@Nullable
ResultsSummary resultsSummary)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.