com.atlassian.bamboo.author
Interface AuthorDao

All Superinterfaces:
BambooObjectDao<ExtendedAuthor>
All Known Implementing Classes:
AuthorHibernateDao

public interface AuthorDao
extends BambooObjectDao<ExtendedAuthor>


Method Summary
 Collection<? extends ExtendedAuthor> findAll()
          Get all ExtendedAuthor entities
 List<Author> findAuthorsByLinkedUser(String userSearchString)
          Performs a case insensitive search for authors by their linkedUserName.
 List<Author> findAuthorsByName(String authorSearchString)
          Performs a case insensitive search for authors by their author name.
 List<Author> findAuthorsThatStartWith(String authorSearchString, boolean unlinkedOnly)
          Performs a case insensitive search for authors by their author name.
 ExtendedAuthor findById(long id)
          Find an ExtendedAuthor object of a given id.
 Set<ExtendedAuthor> getAllUnlinkedAuthors()
           
 ExtendedAuthor getAuthorByName(String name)
           
 Set<Author> getAuthorsByResultSummary(ResultsSummary resultsSummary)
          Retrieve unique set of authors that contributed to commits related to a given ResultsSummary
 List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount)
           
 List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount)
           
 List<ResultsSummary> getBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount)
           
 List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount)
           
 List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount)
           
 List<ExtendedAuthor> getLinkedAuthorsForUser(com.atlassian.user.User user)
           
 int getNumberOfBuildBrokenByAuthor(ExtendedAuthor author)
           
 int getNumberOfBuildFixedByAuthor(ExtendedAuthor author)
           
 int getNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author)
           
 int getNumberOfFailedBuildsByAuthor(ExtendedAuthor author)
           
 int getNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author)
           
 List<ResultsSummary> getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> author, int maxDays)
          Retrieve all build results triggered by the author in the last X days
 void unlinkLinkedAuthors(com.atlassian.user.User user)
          Removes the link between User and all Author entities, User was linked to
 void updateLinkedAuthors(com.atlassian.user.User user, List<Long> authorIds)
          Updates list of Authors linked to a User.
 
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, executeReturnLong, findAll, findById, save, saveAll
 

Method Detail

findById

@Nullable
ExtendedAuthor findById(long id)
Find an ExtendedAuthor object of a given id.

Parameters:
id - id of Author to be found
Returns:
ExtendedAuthor object or null if not found

findAll

@NotNull
Collection<? extends ExtendedAuthor> findAll()
Get all ExtendedAuthor entities

Returns:
Collection of ExtendedAuthor

getAuthorByName

ExtendedAuthor getAuthorByName(String name)
Parameters:
name -
Returns:
a ExtendedAuthor object given an author name

getBuildResultsTriggeredByAuthor

@NotNull
List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author,
                                                              int maxResultCount)
Parameters:
author -
maxResultCount -
Returns:
List of BuildResultsSummary triggered by author

getBuildResultsFailedByAuthor

@NotNull
List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author,
                                                           int maxResultCount)
Parameters:
author -
maxResultCount -
Returns:
List of BuildResultsSummary triggered by author and failed

getBuildResultsSuccessfulByAuthor

@NotNull
List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author,
                                                               int maxResultCount)
Parameters:
author -
maxResultCount -
Returns:
List of BuildResultsSummary triggered by author and succesful

getBuildResultsBrokenByAuthor

@NotNull
List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author,
                                                           int maxResultCount)
Parameters:
author -
maxResultCount -
Returns:
List of BuildResultsSummary broken by author

getBuildResultsFixedByAuthor

@NotNull
List<ResultsSummary> getBuildResultsFixedByAuthor(ExtendedAuthor author,
                                                          int maxResultCount)
Parameters:
author -
maxResultCount -
Returns:
List of BuildResultsSummary fixed by author

getNumberOfBuildsTriggeredByAuthor

int getNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author)
Parameters:
author -
Returns:
int

getNumberOfFailedBuildsByAuthor

int getNumberOfFailedBuildsByAuthor(ExtendedAuthor author)
Parameters:
author -
Returns:
int

getNumberOfSuccessfulBuildsByAuthor

int getNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author)
Parameters:
author -
Returns:
int

getNumberOfBuildFixedByAuthor

int getNumberOfBuildFixedByAuthor(ExtendedAuthor author)
Parameters:
author -
Returns:
int

getNumberOfBuildBrokenByAuthor

int getNumberOfBuildBrokenByAuthor(ExtendedAuthor author)
Parameters:
author -
Returns:
int

getAllUnlinkedAuthors

@NotNull
Set<ExtendedAuthor> getAllUnlinkedAuthors()
Returns:
Set of ExtendedAuthor which are not yet linked to any user.

getLinkedAuthorsForUser

@NotNull
List<ExtendedAuthor> getLinkedAuthorsForUser(com.atlassian.user.User user)
Parameters:
user -
Returns:
List of ExtendedAuthor which are linked to a given user.

getRecentResultsTriggeredByAuthors

List<ResultsSummary> getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> author,
                                                        int maxDays)
Retrieve all build results triggered by the author in the last X days

Parameters:
author - the builds will be triggered by
maxDays - number of days to look back in history
Returns:
all build results triggered by the author in the last X days

unlinkLinkedAuthors

void unlinkLinkedAuthors(@NotNull
                         com.atlassian.user.User user)
Removes the link between User and all Author entities, User was linked to

Parameters:
user - user

updateLinkedAuthors

void updateLinkedAuthors(@NotNull
                         com.atlassian.user.User user,
                         @NotNull
                         List<Long> authorIds)
Updates list of Authors linked to a User. As a result of this operation only Authors with id listed in authorIds will be linked to user

Parameters:
user - user
authorIds - list of Author id that should be linked to user

findAuthorsByName

@NotNull
List<Author> findAuthorsByName(@NotNull
                                       String authorSearchString)
Performs a case insensitive search for authors by their author name. AuthorSearchString can appear anywhere in the authors name.

Parameters:
authorSearchString - string to search for
Returns:
any authors who's author name match the given string.

findAuthorsThatStartWith

@NotNull
List<Author> findAuthorsThatStartWith(String authorSearchString,
                                              boolean unlinkedOnly)
Performs a case insensitive search for authors by their author name.

Parameters:
authorSearchString - string to search for
unlinkedOnly - if true will only return users which have not been linked with a user already
Returns:
any authors who's author name match the given string.

findAuthorsByLinkedUser

@NotNull
List<Author> findAuthorsByLinkedUser(@NotNull
                                             String userSearchString)
Performs a case insensitive search for authors by their linkedUserName. userSearchString can appear anywhere in the linked user name.

Parameters:
userSearchString - string to search for
Returns:
any authors who's linkedusername match the given string.

getAuthorsByResultSummary

@NotNull
Set<Author> getAuthorsByResultSummary(@NotNull
                                              ResultsSummary resultsSummary)
Retrieve unique set of authors that contributed to commits related to a given ResultsSummary

Parameters:
resultsSummary - ResultsSummary
Returns:
list of authors


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.