com.atlassian.bamboo.author
Class HibernateAuthorManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.author.HibernateAuthorManagerImpl
All Implemented Interfaces:
AuthorManager, ExtendedAuthorManager

public class HibernateAuthorManagerImpl
extends java.lang.Object
implements ExtendedAuthorManager


Constructor Summary
HibernateAuthorManagerImpl()
           
 
Method Summary
 void createAndSaveAuthor(java.lang.String authorName)
          Creates and saves author given authorName, if bamboo user with the same username exists the new author will be linked to that user.
 java.util.List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author)
          Deprecated. 
 java.util.List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount)
           
 java.util.List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author)
          Deprecated. 
 java.util.List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount)
           
 java.util.List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author)
          Deprecated. 
 java.util.List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount)
           
 java.util.List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author)
          Deprecated. 
 java.util.List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount)
           
 java.util.List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author)
          Deprecated. 
 java.util.List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount)
           
 java.util.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)
           
 ExtendedAuthor generateOrRetrieveAuthorFromCommit(Commit commit, java.lang.String authorName)
          Either retrieves an existing author (if exists) or creates a new one (if author does not exist) for a given commit
 java.util.Set getAllAuthors()
           
 java.util.Set<ExtendedAuthor> getAllUnlinkedAuthors()
           
 ExtendedAuthor getAuthorById(long id)
           
 Author getAuthorByName(java.lang.String name)
           
 AuthorDao getAuthorDao()
           
 ExtendedAuthor getExtendedAuthorByName(java.lang.String name)
           
 java.util.List<ExtendedAuthor> getLinkedAuthorForUser(com.atlassian.user.User user)
           
 void removeAuthor(ExtendedAuthor extendedAuthor)
          removes an author
 void saveAuthor(Author author)
          Save the author
 void setAuthorDao(AuthorDao authorDao)
           
 void setBambooUserManager(BambooUserManager userManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernateAuthorManagerImpl

public HibernateAuthorManagerImpl()
Method Detail

createAndSaveAuthor

public void createAndSaveAuthor(java.lang.String authorName)
Description copied from interface: ExtendedAuthorManager
Creates and saves author given authorName, if bamboo user with the same username exists the new author will be linked to that user.

Specified by:
createAndSaveAuthor in interface ExtendedAuthorManager

generateOrRetrieveAuthorFromCommit

public ExtendedAuthor generateOrRetrieveAuthorFromCommit(Commit commit,
                                                         java.lang.String authorName)
Description copied from interface: ExtendedAuthorManager
Either retrieves an existing author (if exists) or creates a new one (if author does not exist) for a given commit

Specified by:
generateOrRetrieveAuthorFromCommit in interface ExtendedAuthorManager
Returns:
ExtendedAuthor which made the commit.

getAllAuthors

public java.util.Set getAllAuthors()
Specified by:
getAllAuthors in interface AuthorManager
Returns:
Set of all Author

getAuthorByName

public Author getAuthorByName(java.lang.String name)
Specified by:
getAuthorByName in interface AuthorManager
Returns:
Author with given name.

getAllUnlinkedAuthors

public java.util.Set<ExtendedAuthor> getAllUnlinkedAuthors()
Specified by:
getAllUnlinkedAuthors in interface ExtendedAuthorManager
Returns:
Set of ExtendedAuthor objects not linked to users

getExtendedAuthorByName

public ExtendedAuthor getExtendedAuthorByName(java.lang.String name)
Specified by:
getExtendedAuthorByName in interface ExtendedAuthorManager
Returns:
ExtendedAuthor with given name (assuming unique)

findBuildResultsTriggeredByAuthor

@Deprecated
public java.util.List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author)
Deprecated. 

Specified by:
findBuildResultsTriggeredByAuthor in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary triggered by author

findBuildResultsTriggeredByAuthor

@NotNull
public java.util.List<ResultsSummary> findBuildResultsTriggeredByAuthor(ExtendedAuthor author,
                                                                                int maxResultCount)
Specified by:
findBuildResultsTriggeredByAuthor in interface ExtendedAuthorManager
maxResultCount - if <= 0 all the results are returned
Returns:
List of BuildResultsSummary triggered by author

findBuildResultsFailedByAuthor

@Deprecated
public java.util.List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author)
Deprecated. 

Specified by:
findBuildResultsFailedByAuthor in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary triggered by author and failed

findBuildResultsFailedByAuthor

@NotNull
public java.util.List<ResultsSummary> findBuildResultsFailedByAuthor(ExtendedAuthor author,
                                                                             int maxResultCount)
Specified by:
findBuildResultsFailedByAuthor in interface ExtendedAuthorManager
maxResultCount - if <= 0 all the results are returned
Returns:
List of BuildResultsSummary triggered by author and failed

findBuildResultsSuccessfulByAuthor

@Deprecated
public java.util.List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author)
Deprecated. 

Specified by:
findBuildResultsSuccessfulByAuthor in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary triggered by author and successful

findBuildResultsSuccessfulByAuthor

@NotNull
public java.util.List<ResultsSummary> findBuildResultsSuccessfulByAuthor(ExtendedAuthor author,
                                                                                 int maxResultCount)
Specified by:
findBuildResultsSuccessfulByAuthor in interface ExtendedAuthorManager
maxResultCount - if <= 0 all the results are returned
Returns:
List of BuildResultsSummary triggered by author and successful

findBuildResultsBrokenByAuthor

@Deprecated
public java.util.List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author)
Deprecated. 

Specified by:
findBuildResultsBrokenByAuthor in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary broken by author

findBuildResultsBrokenByAuthor

@NotNull
public java.util.List<ResultsSummary> findBuildResultsBrokenByAuthor(ExtendedAuthor author,
                                                                             int maxResultCount)
Specified by:
findBuildResultsBrokenByAuthor in interface ExtendedAuthorManager
maxResultCount - if <= 0 all the results are returned
Returns:
List of BuildResultsSummary broken by author

findLatestBuildBrokenByAuthorInEachPlan

@NotNull
public java.util.Collection<ResultsSummary> findLatestBuildBrokenByAuthorInEachPlan(ExtendedAuthor author)
Description copied from interface: ExtendedAuthorManager
Retrieves the last build broken by author for all the plans.

Specified by:
findLatestBuildBrokenByAuthorInEachPlan in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary broken by author

findBuildResultsFixedByAuthor

@Deprecated
public java.util.List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author)
Deprecated. 

Specified by:
findBuildResultsFixedByAuthor in interface ExtendedAuthorManager
Returns:
List of BuildResultsSummary fixed by author

findBuildResultsFixedByAuthor

@NotNull
public java.util.List<ResultsSummary> findBuildResultsFixedByAuthor(ExtendedAuthor author,
                                                                            int maxResultCount)
Specified by:
findBuildResultsFixedByAuthor in interface ExtendedAuthorManager
maxResultCount - if <= 0 all the results are returned
Returns:
List of BuildResultsSummary fixed by author

findNumberOfBuildsTriggeredByAuthor

public int findNumberOfBuildsTriggeredByAuthor(ExtendedAuthor author)
Specified by:
findNumberOfBuildsTriggeredByAuthor in interface ExtendedAuthorManager
Returns:
int

findNumberOfFailedBuildsByAuthor

public int findNumberOfFailedBuildsByAuthor(ExtendedAuthor author)
Specified by:
findNumberOfFailedBuildsByAuthor in interface ExtendedAuthorManager
Returns:
int

findNumberOfSuccessfulBuildsByAuthor

public int findNumberOfSuccessfulBuildsByAuthor(ExtendedAuthor author)
Specified by:
findNumberOfSuccessfulBuildsByAuthor in interface ExtendedAuthorManager
Returns:
int

findNumberOfBuildFixedByAuthor

public int findNumberOfBuildFixedByAuthor(ExtendedAuthor author)
Specified by:
findNumberOfBuildFixedByAuthor in interface ExtendedAuthorManager
Returns:
int

findNumberOfBuildBrokenByAuthor

public int findNumberOfBuildBrokenByAuthor(ExtendedAuthor author)
Specified by:
findNumberOfBuildBrokenByAuthor in interface ExtendedAuthorManager
Returns:
int

getAuthorById

public ExtendedAuthor getAuthorById(long id)
Specified by:
getAuthorById in interface ExtendedAuthorManager
Returns:
Author given id

getLinkedAuthorForUser

public java.util.List<ExtendedAuthor> getLinkedAuthorForUser(com.atlassian.user.User user)
Specified by:
getLinkedAuthorForUser in interface ExtendedAuthorManager
Returns:
List of ExtendedAuthor linked to the user.

removeAuthor

public void removeAuthor(ExtendedAuthor extendedAuthor)
Description copied from interface: ExtendedAuthorManager
removes an author

Specified by:
removeAuthor in interface ExtendedAuthorManager

saveAuthor

public void saveAuthor(Author author)
Description copied from interface: ExtendedAuthorManager
Save the author

Specified by:
saveAuthor in interface ExtendedAuthorManager

getAuthorDao

public AuthorDao getAuthorDao()

setAuthorDao

public void setAuthorDao(AuthorDao authorDao)

setBambooUserManager

public void setBambooUserManager(BambooUserManager userManager)


Copyright © 2011 Atlassian. All Rights Reserved.