com.atlassian.bamboo.labels
Interface LabelManager

All Known Implementing Classes:
LabelManagerImpl

public interface LabelManager


Field Summary
static java.lang.String BUILDRESULT_LABEL_NAMESPACE
           
static int DEFAULT_MAX_RESULTS
           
static java.lang.String FAVOURITE_LABEL_NAME
           
static java.lang.String FAVOURITE_UNMARK_LABEL_NAME
           
static int LABEL_ADDED_TO_BUILD_RESULT
           
static int LABEL_CREATED
           
static int LABEL_DELETED
           
static int LABEL_REMOVED_FROM_BUILD_RESULT
           
static int NO_CHANGE
           
 
Method Summary
 int addFavourite(Build build, com.atlassian.user.User user)
          Adds a build to a user as favourite.
 int addLabel(java.lang.String labelName, BuildResults buildResults, com.atlassian.user.User user)
          Add a label against a build result.
 java.util.List<BuildResultsSummary> findBuildResultsSummaryByLabel(java.lang.String labelName)
          Finds all BuildResultsSummary labelled with given labelname
 java.util.List<LabelCount> findLabels(java.lang.String namespace, int maxResults, Build build, Project project)
          Finds all labels in a given build, with namespace and maxResults.
 java.util.List getFavouritesForBuild(Build build)
          Retrieves a list of usernames which have the given build set as a favourite.
 boolean hasBuildResultsLabel(BuildResultsSummary buildResultsSummary, java.lang.String label)
          Checks whether the build results summary has a particular label
 boolean isFavourite(Build build, com.atlassian.user.User user)
          Determins if the build is a user's favourite
 boolean isManuallyUnmarkedFavourite(Build build, com.atlassian.user.User user)
          Flag which determines if the user has manually unmarked this build as favourite.
 int removeFavourite(Build build, com.atlassian.user.User user)
          Removes a build from a user's favourite.
 int removeLabel(java.lang.String labelName, BuildResults build, com.atlassian.user.User user)
          Removes a label against a build result.
 

Field Detail

NO_CHANGE

static final int NO_CHANGE
See Also:
Constant Field Values

LABEL_CREATED

static final int LABEL_CREATED
See Also:
Constant Field Values

LABEL_ADDED_TO_BUILD_RESULT

static final int LABEL_ADDED_TO_BUILD_RESULT
See Also:
Constant Field Values

LABEL_DELETED

static final int LABEL_DELETED
See Also:
Constant Field Values

LABEL_REMOVED_FROM_BUILD_RESULT

static final int LABEL_REMOVED_FROM_BUILD_RESULT
See Also:
Constant Field Values

BUILDRESULT_LABEL_NAMESPACE

static final java.lang.String BUILDRESULT_LABEL_NAMESPACE
See Also:
Constant Field Values

FAVOURITE_LABEL_NAME

static final java.lang.String FAVOURITE_LABEL_NAME
See Also:
Constant Field Values

FAVOURITE_UNMARK_LABEL_NAME

static final java.lang.String FAVOURITE_UNMARK_LABEL_NAME
See Also:
Constant Field Values

DEFAULT_MAX_RESULTS

static final int DEFAULT_MAX_RESULTS
See Also:
Constant Field Values
Method Detail

addLabel

int addLabel(@Nullable
             java.lang.String labelName,
             @Nullable
             BuildResults buildResults,
             @Nullable
             com.atlassian.user.User user)
Add a label against a build result.

Parameters:
labelName -
build -
user -
Returns:
an int identifying result of add process

removeLabel

int removeLabel(java.lang.String labelName,
                BuildResults build,
                com.atlassian.user.User user)
Removes a label against a build result. Will delete the Label entity if there are no more build results tied to it.

Parameters:
labelName -
build -
user -
Returns:
an int identifying result of delete process

findBuildResultsSummaryByLabel

java.util.List<BuildResultsSummary> findBuildResultsSummaryByLabel(java.lang.String labelName)
Finds all BuildResultsSummary labelled with given labelname

Parameters:
labelName -
Returns:
List of BuildResultsSummary

findLabels

@NotNull
java.util.List<LabelCount> findLabels(@NotNull
                                              java.lang.String namespace,
                                              int maxResults,
                                              @Nullable
                                              Build build,
                                              @Nullable
                                              Project project)
Finds all labels in a given build, with namespace and maxResults.

Parameters:
namespace -
maxResults -
build -
project -
Returns:
List of LabelCount objects, mapping (Label to count of occurances.

addFavourite

int addFavourite(Build build,
                 com.atlassian.user.User user)
Adds a build to a user as favourite. Adds a label to the build, with namespace = user name, and label name = ":favourite".

Parameters:
build -
user -
Returns:
an int identifying result of add process

removeFavourite

int removeFavourite(@NotNull
                    Build build,
                    @Nullable
                    com.atlassian.user.User user)
Removes a build from a user's favourite. Removes labelling object, where namespace = user name, and label name=":favourite".

Parameters:
build -
user -
Returns:
an int identifying result of removal process

isFavourite

boolean isFavourite(Build build,
                    com.atlassian.user.User user)
Determins if the build is a user's favourite

Parameters:
build -
user -
Returns:
boolean yes or no

isManuallyUnmarkedFavourite

boolean isManuallyUnmarkedFavourite(Build build,
                                    com.atlassian.user.User user)
Flag which determines if the user has manually unmarked this build as favourite.

Parameters:
build -
user -
Returns:
boolean flag

getFavouritesForBuild

java.util.List getFavouritesForBuild(Build build)
Retrieves a list of usernames which have the given build set as a favourite.

Parameters:
build -
Returns:
list of usernames (as Strings)

hasBuildResultsLabel

boolean hasBuildResultsLabel(BuildResultsSummary buildResultsSummary,
                             java.lang.String label)
Checks whether the build results summary has a particular label

Parameters:
buildResultsSummary - @NotNull
label - @NotNull . could be empty
Returns:
Returns true if there is a label object within the correct namespace and a labelling for the BuildResultsSummary


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.