public class HibernateAuthorManagerImpl extends Object implements ExtendedAuthorManager
Constructor and Description |
---|
HibernateAuthorManagerImpl(AuthorDao authorDao) |
Modifier and Type | Method and Description |
---|---|
void |
createAndSaveAuthor(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.
|
List<Author> |
findAuthorsByName(String authorSearchString)
Performs a case insensitive search for authors by their author name.
|
List<Author> |
findAuthorsByUser(String userSearchString)
Performs a case insensitive search for authors by their linkedUserName.
|
List<Author> |
findAuthorsThatStartWith(String authorSearchString,
boolean unlinkedOnly)
Performs a case insensitive search for authors by their author name.
|
List<ResultsSummary> |
findBuildResultsBrokenByAuthor(ExtendedAuthor author,
int maxResultCount) |
List<ResultsSummary> |
findBuildResultsFailedByAuthor(ExtendedAuthor author,
int maxResultCount) |
List<ResultsSummary> |
findBuildResultsFixedByAuthor(ExtendedAuthor author,
int maxResultCount) |
List<ResultsSummary> |
findBuildResultsSuccessfulByAuthor(ExtendedAuthor author,
int maxResultCount) |
List<ResultsSummary> |
findBuildResultsTriggeredByAuthor(ExtendedAuthor author,
int maxResultCount) |
Collection<ResultsSummary> |
findLatestBuildBrokenByAuthorInEachPlan(ExtendedAuthor author)
Retrieves the last build broken by author for all the plans.
|
int |
findNumberOfBuildBrokenByAuthor(ExtendedAuthor author) |
int |
findNumberOfBuildFixedByAuthor(ExtendedAuthor author) |
int |
findNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author) |
int |
findNumberOfFailedBuildsByAuthor(ExtendedAuthor author) |
int |
findNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author) |
List<ResultsSummary> |
findRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors,
int maxDays)
Retrieve all build results triggered by the author in the last X days
|
Set |
getAllAuthors() |
Set<ExtendedAuthor> |
getAllUnlinkedAuthors() |
ExtendedAuthor |
getAuthorById(long id) |
Author |
getAuthorByName(String name) |
Set<Author> |
getAuthorsByResultSummary(ResultsSummary resultsSummary)
Retrieve unique set of authors that contributed to commits related to a given ResultsSummary
|
List<ExtendedAuthor> |
getAvailableAuthors(com.atlassian.user.User user)
Get authors available for a user.
|
ExtendedAuthor |
getExtendedAuthorByName(String name)
Get Author information by author name.
|
List<ExtendedAuthor> |
getLinkedAuthorForUser(com.atlassian.user.User user) |
void |
relinkUnlinkedAuthors()
Attempt to link any authors that currently aren't linked with a user.
|
void |
removeAuthor(ExtendedAuthor extendedAuthor)
removes an author
|
void |
saveAuthor(ExtendedAuthor author)
Save the author
|
void |
unlinkAllAuthors()
Remove all author links.
|
public HibernateAuthorManagerImpl(AuthorDao authorDao)
public void createAndSaveAuthor(@NotNull Author author)
ExtendedAuthorManager
createAndSaveAuthor
in interface ExtendedAuthorManager
public Set getAllAuthors()
getAllAuthors
in interface AuthorManager
Set
of all Author
public void unlinkAllAuthors()
ExtendedAuthorManager
unlinkAllAuthors
in interface ExtendedAuthorManager
public void relinkUnlinkedAuthors()
ExtendedAuthorManager
relinkUnlinkedAuthors
in interface ExtendedAuthorManager
public Author getAuthorByName(String name)
getAuthorByName
in interface AuthorManager
Author
with given name.@NotNull public Set<ExtendedAuthor> getAllUnlinkedAuthors()
getAllUnlinkedAuthors
in interface ExtendedAuthorManager
Set
of ExtendedAuthor
objects not linked to userspublic ExtendedAuthor getExtendedAuthorByName(String name)
ExtendedAuthorManager
getExtendedAuthorByName
in interface ExtendedAuthorManager
name
- trimmed author nameExtendedAuthor
with given name (assuming unique)@NotNull public List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount)
findBuildResultsTriggeredByAuthor
in interface ExtendedAuthorManager
maxResultCount
- if <= 0 all the results are returnedList
of BuildResultsSummary
triggered by authorpublic List<ResultsSummary> findRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int maxDays)
ExtendedAuthorManager
findRecentResultsTriggeredByAuthors
in interface ExtendedAuthorManager
authors
- the builds will be triggered bymaxDays
- number of days to look back in history@NotNull public List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount)
findBuildResultsFailedByAuthor
in interface ExtendedAuthorManager
maxResultCount
- if <= 0 all the results are returnedList
of BuildResultsSummary
triggered by author and failed@NotNull public List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount)
findBuildResultsSuccessfulByAuthor
in interface ExtendedAuthorManager
maxResultCount
- if <= 0 all the results are returnedList
of BuildResultsSummary
triggered by author and successful@NotNull public List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount)
findBuildResultsBrokenByAuthor
in interface ExtendedAuthorManager
maxResultCount
- if <= 0 all the results are returnedList
of BuildResultsSummary
broken by author@NotNull public Collection<ResultsSummary> findLatestBuildBrokenByAuthorInEachPlan(ExtendedAuthor author)
ExtendedAuthorManager
findLatestBuildBrokenByAuthorInEachPlan
in interface ExtendedAuthorManager
List
of BuildResultsSummary
broken by author@NotNull public List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount)
findBuildResultsFixedByAuthor
in interface ExtendedAuthorManager
maxResultCount
- if <= 0 all the results are returnedList
of BuildResultsSummary
fixed by authorpublic int findNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author)
findNumberOfBuildsTriggeredByAuthor
in interface ExtendedAuthorManager
public int findNumberOfFailedBuildsByAuthor(ExtendedAuthor author)
findNumberOfFailedBuildsByAuthor
in interface ExtendedAuthorManager
public int findNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author)
findNumberOfSuccessfulBuildsByAuthor
in interface ExtendedAuthorManager
public int findNumberOfBuildFixedByAuthor(ExtendedAuthor author)
findNumberOfBuildFixedByAuthor
in interface ExtendedAuthorManager
public int findNumberOfBuildBrokenByAuthor(ExtendedAuthor author)
findNumberOfBuildBrokenByAuthor
in interface ExtendedAuthorManager
public ExtendedAuthor getAuthorById(long id)
getAuthorById
in interface ExtendedAuthorManager
Author
given id@NotNull public List<ExtendedAuthor> getLinkedAuthorForUser(com.atlassian.user.User user)
getLinkedAuthorForUser
in interface ExtendedAuthorManager
List
of ExtendedAuthor
linked to the user.@NotNull public List<ExtendedAuthor> getAvailableAuthors(@Nullable com.atlassian.user.User user)
ExtendedAuthorManager
getAvailableAuthors
in interface ExtendedAuthorManager
user
- userExtendedAuthor
@NotNull public List<Author> findAuthorsByName(@NotNull String authorSearchString)
ExtendedAuthorManager
findAuthorsByName
in interface ExtendedAuthorManager
authorSearchString
- string to search for@NotNull public List<Author> findAuthorsThatStartWith(@NotNull String authorSearchString, boolean unlinkedOnly)
ExtendedAuthorManager
findAuthorsThatStartWith
in interface ExtendedAuthorManager
authorSearchString
- string to search forunlinkedOnly
- if true will only return users which have not been linked with an user already@NotNull public List<Author> findAuthorsByUser(@NotNull String userSearchString)
ExtendedAuthorManager
findAuthorsByUser
in interface ExtendedAuthorManager
userSearchString
- string to search for@NotNull public Set<Author> getAuthorsByResultSummary(@NotNull ResultsSummary resultsSummary)
ExtendedAuthorManager
getAuthorsByResultSummary
in interface ExtendedAuthorManager
resultsSummary
- ResultsSummarypublic void removeAuthor(ExtendedAuthor extendedAuthor)
ExtendedAuthorManager
removeAuthor
in interface ExtendedAuthorManager
public void saveAuthor(ExtendedAuthor author)
ExtendedAuthorManager
saveAuthor
in interface ExtendedAuthorManager
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.