public class AuthorHibernateDao extends BambooHibernateObjectDao<ExtendedAuthor> implements AuthorDao
Constructor and Description |
---|
AuthorHibernateDao(PlanDiscriminatorRegistry planDiscriminatorRegistry) |
Modifier and Type | Method and Description |
---|---|
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> authors,
int daysToFilter)
Retrieve all build results triggered by the author in the last X days
|
void |
unlinkLinkedAuthors(String username)
Removes all links between a user and author entities.
|
void |
updateLinkedAuthors(com.atlassian.user.User user,
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 Collection<? extends ExtendedAuthor> findAll()
AuthorDao
ExtendedAuthor
entitiesfindAll
in interface AuthorDao
ExtendedAuthor
@Nullable public ExtendedAuthor getAuthorByName(String name)
getAuthorByName
in interface AuthorDao
ExtendedAuthor
object given an author name@NotNull public List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsFailedByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author and failed@NotNull public List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsSuccessfulByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author and succesful@NotNull public List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsBrokenByAuthor
in interface AuthorDao
List
of BuildResultsSummary
broken by author@NotNull public 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 Set<ExtendedAuthor> getAllUnlinkedAuthors()
getAllUnlinkedAuthors
in interface AuthorDao
Set
of ExtendedAuthor
which are not yet linked to any user.@NotNull public List<ExtendedAuthor> getLinkedAuthorsForUser(com.atlassian.user.User user)
getLinkedAuthorsForUser
in interface AuthorDao
List
of ExtendedAuthor
which are linked to a given user.@NotNull public List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount)
getBuildResultsTriggeredByAuthor
in interface AuthorDao
List
of BuildResultsSummary
triggered by author@NotNull public 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 String username)
AuthorDao
unlinkLinkedAuthors
in interface AuthorDao
username
- name of the userpublic void updateLinkedAuthors(@NotNull com.atlassian.user.User user, @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 List<Author> findAuthorsByLinkedUser(@NotNull String userSearchString)
AuthorDao
findAuthorsByLinkedUser
in interface AuthorDao
userSearchString
- string to search for@NotNull public List<Author> findAuthorsByName(@NotNull String authorSearchString)
AuthorDao
findAuthorsByName
in interface AuthorDao
authorSearchString
- string to search for@NotNull public List<Author> findAuthorsThatStartWith(@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 Set<Author> getAuthorsByResultSummary(@NotNull ResultsSummary resultsSummary)
AuthorDao
getAuthorsByResultSummary
in interface AuthorDao
resultsSummary
- ResultsSummaryCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.