Package com.atlassian.bamboo.author
Class HibernateAuthorManagerImpl
java.lang.Object
com.atlassian.bamboo.author.HibernateAuthorManagerImpl
- All Implemented Interfaces:
AuthorManager,ExtendedAuthorManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateAndSaveAuthor(@NotNull Author author) Creates and saves author given author, if bamboo user with the same username exists the new author will be linked to that user.findAuthorsByName(@NotNull String authorSearchString) Performs a case insensitive search for authors by their author name.findAuthorsByUser(@NotNull String userSearchString) Performs a case insensitive search for authors by their linkedUserName.findAuthorsThatStartWith(@NotNull String authorSearchString, boolean unlinkedOnly) Performs a case insensitive search for authors by their author name.@NotNull List<ResultsSummary>findBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary>findBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary>findBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary>findBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary>findBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull Collection<ResultsSummary>Retrieves the last build broken by author for all the plans.intintintintintfindRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int maxDays) Retrieve all build results triggered by the author in the last X days@NotNull Set<ExtendedAuthor>getAuthorById(long id) getAuthorByName(String name) getAuthorsByResultSummary(@NotNull ResultsSummary resultsSummary) Retrieve unique set of authors that contributed to commits related to a given ResultsSummary@NotNull List<ExtendedAuthor>getAvailableAuthors(@Nullable com.atlassian.user.User user) Get authors available for a user.Get Author information by author name.@NotNull List<ExtendedAuthor>getLinkedAuthorForUser(com.atlassian.user.User user) voidAttempt to link any authors that currently aren't linked with a user.voidremoveAuthor(ExtendedAuthor extendedAuthor) removes an authorvoidsaveAuthor(ExtendedAuthor author) Save the authorvoidRemove all author links.
-
Constructor Details
-
HibernateAuthorManagerImpl
-
-
Method Details
-
createAndSaveAuthor
Description copied from interface:ExtendedAuthorManagerCreates and saves author given author, if bamboo user with the same username exists the new author will be linked to that user.- Specified by:
createAndSaveAuthorin interfaceExtendedAuthorManager
-
getAllAuthors
- Specified by:
getAllAuthorsin interfaceAuthorManager- Returns:
Setof allAuthor
-
unlinkAllAuthors
public void unlinkAllAuthors()Description copied from interface:ExtendedAuthorManagerRemove all author links. Useful if you have changed user management systems- Specified by:
unlinkAllAuthorsin interfaceExtendedAuthorManager
-
relinkUnlinkedAuthors
public void relinkUnlinkedAuthors()Description copied from interface:ExtendedAuthorManagerAttempt to link any authors that currently aren't linked with a user. Currently only checks for direct author/username matches- Specified by:
relinkUnlinkedAuthorsin interfaceExtendedAuthorManager
-
getAuthorByName
- Specified by:
getAuthorByNamein interfaceAuthorManager- Returns:
Authorwith given name.
-
getAllUnlinkedAuthors
- Specified by:
getAllUnlinkedAuthorsin interfaceExtendedAuthorManager- Returns:
SetofExtendedAuthorobjects not linked to users
-
getExtendedAuthorByName
Description copied from interface:ExtendedAuthorManagerGet Author information by author name. Author names in DB are kept trimmed, make sure that name param is trimmed as well- Specified by:
getExtendedAuthorByNamein interfaceExtendedAuthorManager- Parameters:
name- trimmed author name- Returns:
ExtendedAuthorwith given name (assuming unique)
-
findBuildResultsTriggeredByAuthor
@NotNull public @NotNull List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
findBuildResultsTriggeredByAuthorin interfaceExtendedAuthorManagermaxResultCount- if <= 0 all the results are returned- Returns:
ListofBuildResultsSummarytriggered by author
-
findRecentResultsTriggeredByAuthors
public List<ResultsSummary> findRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int maxDays) Description copied from interface:ExtendedAuthorManagerRetrieve all build results triggered by the author in the last X days- Specified by:
findRecentResultsTriggeredByAuthorsin interfaceExtendedAuthorManager- Parameters:
authors- the builds will be triggered bymaxDays- number of days to look back in history- Returns:
- all build results triggered by the author in the last X days
-
findBuildResultsFailedByAuthor
@NotNull public @NotNull List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
findBuildResultsFailedByAuthorin interfaceExtendedAuthorManagermaxResultCount- if <= 0 all the results are returned- Returns:
ListofBuildResultsSummarytriggered by author and failed
-
findBuildResultsSuccessfulByAuthor
@NotNull public @NotNull List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
findBuildResultsSuccessfulByAuthorin interfaceExtendedAuthorManagermaxResultCount- if <= 0 all the results are returned- Returns:
ListofBuildResultsSummarytriggered by author and successful
-
findBuildResultsBrokenByAuthor
@NotNull public @NotNull List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
findBuildResultsBrokenByAuthorin interfaceExtendedAuthorManagermaxResultCount- if <= 0 all the results are returned- Returns:
ListofBuildResultsSummarybroken by author
-
findLatestBuildBrokenByAuthorInEachPlan
@NotNull public @NotNull Collection<ResultsSummary> findLatestBuildBrokenByAuthorInEachPlan(ExtendedAuthor author) Description copied from interface:ExtendedAuthorManagerRetrieves the last build broken by author for all the plans.- Specified by:
findLatestBuildBrokenByAuthorInEachPlanin interfaceExtendedAuthorManager- Returns:
ListofBuildResultsSummarybroken by author
-
findBuildResultsFixedByAuthor
@NotNull public @NotNull List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
findBuildResultsFixedByAuthorin interfaceExtendedAuthorManagermaxResultCount- if <= 0 all the results are returned- Returns:
ListofBuildResultsSummaryfixed by author
-
findNumberOfBuildsTriggeredByAuthor
- Specified by:
findNumberOfBuildsTriggeredByAuthorin interfaceExtendedAuthorManager- Returns:
- int
-
findNumberOfFailedBuildsByAuthor
- Specified by:
findNumberOfFailedBuildsByAuthorin interfaceExtendedAuthorManager- Returns:
- int
-
findNumberOfSuccessfulBuildsByAuthor
- Specified by:
findNumberOfSuccessfulBuildsByAuthorin interfaceExtendedAuthorManager- Returns:
- int
-
findNumberOfBuildFixedByAuthor
- Specified by:
findNumberOfBuildFixedByAuthorin interfaceExtendedAuthorManager- Returns:
- int
-
findNumberOfBuildBrokenByAuthor
- Specified by:
findNumberOfBuildBrokenByAuthorin interfaceExtendedAuthorManager- Returns:
- int
-
getAuthorById
- Specified by:
getAuthorByIdin interfaceExtendedAuthorManager- Returns:
Authorgiven id
-
getLinkedAuthorForUser
- Specified by:
getLinkedAuthorForUserin interfaceExtendedAuthorManager- Returns:
ListofExtendedAuthorlinked to the user.
-
getAvailableAuthors
@NotNull public @NotNull List<ExtendedAuthor> getAvailableAuthors(@Nullable @Nullable com.atlassian.user.User user) Description copied from interface:ExtendedAuthorManagerGet authors available for a user. That includes all authors user is linked to and all unlinked authors.- Specified by:
getAvailableAuthorsin interfaceExtendedAuthorManager- Parameters:
user- user- Returns:
- List of
ExtendedAuthor
-
findAuthorsByName
@NotNull public @NotNull List<Author> findAuthorsByName(@NotNull @NotNull String authorSearchString) Description copied from interface:ExtendedAuthorManagerPerforms a case insensitive search for authors by their author name. AuthorSearchString can appear anywhere in the authors name.- Specified by:
findAuthorsByNamein interfaceExtendedAuthorManager- Parameters:
authorSearchString- string to search for- Returns:
- any authors who's author name match the given string.
-
findAuthorsThatStartWith
@NotNull public @NotNull List<Author> findAuthorsThatStartWith(@NotNull @NotNull String authorSearchString, boolean unlinkedOnly) Description copied from interface:ExtendedAuthorManagerPerforms a case insensitive search for authors by their author name.- Specified by:
findAuthorsThatStartWithin interfaceExtendedAuthorManager- Parameters:
authorSearchString- string to search forunlinkedOnly- if true will only return users which have not been linked with an user already- Returns:
- any authors who's author name match the given string.
-
findAuthorsByUser
Description copied from interface:ExtendedAuthorManagerPerforms a case insensitive search for authors by their linkedUserName. userSearchString can appear anywhere in the linked user name.- Specified by:
findAuthorsByUserin interfaceExtendedAuthorManager- Parameters:
userSearchString- string to search for- Returns:
- any authors who's linkedusername match the given string.
-
getAuthorsByResultSummary
@NotNull public @NotNull Set<Author> getAuthorsByResultSummary(@NotNull @NotNull ResultsSummary resultsSummary) Description copied from interface:ExtendedAuthorManagerRetrieve unique set of authors that contributed to commits related to a given ResultsSummary- Specified by:
getAuthorsByResultSummaryin interfaceExtendedAuthorManager- Parameters:
resultsSummary- ResultsSummary- Returns:
- list of authors
-
removeAuthor
Description copied from interface:ExtendedAuthorManagerremoves an author- Specified by:
removeAuthorin interfaceExtendedAuthorManager
-
saveAuthor
Description copied from interface:ExtendedAuthorManagerSave the author- Specified by:
saveAuthorin interfaceExtendedAuthorManager
-