public class AuthorHibernateDao extends BambooHibernateObjectDao<ExtendedAuthor> implements AuthorDao
Constructor and Description |
---|
AuthorHibernateDao(PlanDiscriminatorRegistry planDiscriminatorRegistry) |
Modifier and Type | Method and Description |
---|---|
@NotNull Collection<? extends ExtendedAuthor> |
findAll()
Get all
ExtendedAuthor entities |
@NotNull List<Author> |
findAuthorsByLinkedUser(@NotNull String userSearchString)
Performs a case insensitive search for authors by their linkedUserName.
|
@NotNull List<Author> |
findAuthorsByName(@NotNull String authorSearchString)
Performs a case insensitive search for authors by their author name.
|
@NotNull List<Author> |
findAuthorsThatStartWith(@NotNull 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. |
@NotNull Set<ExtendedAuthor> |
getAllUnlinkedAuthors() |
@Nullable ExtendedAuthor |
getAuthorByName(String name) |
@NotNull Set<Author> |
getAuthorsByResultSummary(@NotNull ResultsSummary resultsSummary)
Retrieve unique set of authors that contributed to commits related to a given ResultsSummary
|
@NotNull List<ResultsSummary> |
getBuildResultsBrokenByAuthor(ExtendedAuthor author,
int maxResultCount) |
@NotNull List<ResultsSummary> |
getBuildResultsFailedByAuthor(ExtendedAuthor author,
int maxResultCount) |
@NotNull List<ResultsSummary> |
getBuildResultsFixedByAuthor(ExtendedAuthor author,
int maxResultCount) |
@NotNull List<ResultsSummary> |
getBuildResultsSuccessfulByAuthor(ExtendedAuthor author,
int maxResultCount) |
@NotNull List<ResultsSummary> |
getBuildResultsTriggeredByAuthor(ExtendedAuthor author,
int maxResultCount) |
@NotNull 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) |
@NotNull List<ResultsSummary> |
getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors,
int daysToFilter)
Retrieve all build results triggered by the author in the last X days
|
void |
unlinkLinkedAuthors(@NotNull String username)
Removes all links between a user and author entities.
|
void |
updateLinkedAuthors(@NotNull com.atlassian.user.User user,
@NotNull List<Long> authorIds)
Updates list of Authors linked to a User.
|
countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findById, merge, save, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
unlinkLinkedAuthors
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
public AuthorHibernateDao(PlanDiscriminatorRegistry planDiscriminatorRegistry)
public ExtendedAuthor findById(long id)
AuthorDao
ExtendedAuthor
object of a given id.findById
in interface AuthorDao
id
- id of Author
to be foundExtendedAuthor
object or null if not found@NotNull public @NotNull Collection<? extends ExtendedAuthor> findAll()
AuthorDao
ExtendedAuthor
entitiesfindAll
in interface AuthorDao
ExtendedAuthor
@Nullable public @Nullable ExtendedAuthor getAuthorByName(String name)
getAuthorByName
in interface AuthorDao
ExtendedAuthor
object given an author name@NotNull public @NotNull List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsFailedByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author and failed@NotNull public @NotNull List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsSuccessfulByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author and succesful@NotNull public @NotNull List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsBrokenByAuthor
in interface AuthorDao
List
of BuildResultsSummary
broken by author@NotNull public @NotNull List<ResultsSummary> getBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsFixedByAuthor
in interface AuthorDao
List
of BuildResultsSummary
fixed by authorpublic int getNumberOfFailedBuildsByAuthor(ExtendedAuthor author)
getNumberOfFailedBuildsByAuthor
in interface AuthorDao
public int getNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author)
getNumberOfSuccessfulBuildsByAuthor
in interface AuthorDao
public int getNumberOfBuildFixedByAuthor(ExtendedAuthor author)
getNumberOfBuildFixedByAuthor
in interface AuthorDao
public int getNumberOfBuildBrokenByAuthor(ExtendedAuthor author)
getNumberOfBuildBrokenByAuthor
in interface AuthorDao
@NotNull public @NotNull Set<ExtendedAuthor> getAllUnlinkedAuthors()
getAllUnlinkedAuthors
in interface AuthorDao
Set
of ExtendedAuthor
which are not yet linked to any user.@NotNull public @NotNull List<ExtendedAuthor> getLinkedAuthorsForUser(com.atlassian.user.User user)
getLinkedAuthorsForUser
in interface AuthorDao
List
of ExtendedAuthor
which are linked to a given user.@NotNull public @NotNull List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsTriggeredByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author@NotNull public @NotNull List<ResultsSummary> getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int daysToFilter)
AuthorDao
getRecentResultsTriggeredByAuthors
in interface AuthorDao
authors
- the builds will be triggered bydaysToFilter
- number of days to look back in historypublic int getNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author)
getNumberOfBuildsTriggeredByAuthor
in interface AuthorDao
public void unlinkLinkedAuthors(@NotNull @NotNull String username)
AuthorDao
unlinkLinkedAuthors
in interface AuthorDao
username
- name of the userpublic void updateLinkedAuthors(@NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull List<Long> authorIds)
AuthorDao
Author
s with id listed in authorIds will be linked to userupdateLinkedAuthors
in interface AuthorDao
user
- userauthorIds
- list of Author
id that should be linked to user@NotNull public @NotNull List<Author> findAuthorsByLinkedUser(@NotNull @NotNull String userSearchString)
AuthorDao
findAuthorsByLinkedUser
in interface AuthorDao
userSearchString
- string to search for@NotNull public @NotNull List<Author> findAuthorsByName(@NotNull @NotNull String authorSearchString)
AuthorDao
findAuthorsByName
in interface AuthorDao
authorSearchString
- string to search for@NotNull public @NotNull List<Author> findAuthorsThatStartWith(@NotNull @NotNull String authorSearchString, boolean unlinkedOnly)
AuthorDao
findAuthorsThatStartWith
in interface AuthorDao
authorSearchString
- string to search forunlinkedOnly
- if true will only return users which have not been linked with a user already@NotNull public @NotNull Set<Author> getAuthorsByResultSummary(@NotNull @NotNull ResultsSummary resultsSummary)
AuthorDao
getAuthorsByResultSummary
in interface AuthorDao
resultsSummary
- ResultsSummaryCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.