com.atlassian.jira.vcs
Class DefaultRepositoryManager

java.lang.Object
  extended bycom.atlassian.jira.vcs.DefaultRepositoryManager
All Implemented Interfaces:
RepositoryManager
Direct Known Subclasses:
EnterpriseRepositoryManager

public class DefaultRepositoryManager
extends java.lang.Object
implements RepositoryManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.vcs.RepositoryManager
CVS_TYPE, VCS_SERVICE_DELAY, VCS_SERVICE_NAME, VCS_TYPES
 
Constructor Summary
DefaultRepositoryManager()
           
DefaultRepositoryManager(AssociationManager associationManager, GenericDelegator genericDelegator, ServiceManager serviceManager)
           
 
Method Summary
 Repository createRepository(java.lang.String type, java.lang.String name, java.lang.String description, java.util.Properties properties)
           
protected  AssociationManager getAssociationManager()
           
protected  GenericDelegator getGenericDelegator()
           
 java.util.Collection getProjectsForRepository(Repository repository)
           
 java.util.Collection getRepositories()
           
 java.util.Collection getRepositoriesForProject(GenericValue project)
           
 Repository getRepository(java.lang.Long id)
           
protected  ServiceManager getServiceManager()
           
 boolean isValidType(java.lang.String type)
           
 void refresh()
           
 void removeRepository(java.lang.Long id)
           
 void setProjectRepositories(GenericValue project, java.util.Collection repositoryIds)
          Given a project and a collection of repository ids, associates the project with the repositories that have the given ids NOTE: the old associations are removed
 boolean updateRepositories()
          Tries to update (e.g.
 void updateRepository(java.lang.Long id, java.lang.String type, java.lang.String name, java.lang.String description, java.util.Properties properties)
          Updates the repository with the given id.
protected  boolean updateRepository(Repository repository)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepositoryManager

public DefaultRepositoryManager(AssociationManager associationManager,
                                GenericDelegator genericDelegator,
                                ServiceManager serviceManager)
                         throws GenericEntityException

DefaultRepositoryManager

public DefaultRepositoryManager()
                         throws GenericEntityException
Method Detail

getRepositoriesForProject

public java.util.Collection getRepositoriesForProject(GenericValue project)
                                               throws GenericEntityException
Specified by:
getRepositoriesForProject in interface RepositoryManager
Throws:
GenericEntityException

getProjectsForRepository

public java.util.Collection getProjectsForRepository(Repository repository)
                                              throws GenericEntityException
Specified by:
getProjectsForRepository in interface RepositoryManager
Throws:
GenericEntityException

getRepository

public Repository getRepository(java.lang.Long id)
                         throws GenericEntityException
Specified by:
getRepository in interface RepositoryManager
Throws:
GenericEntityException

isValidType

public boolean isValidType(java.lang.String type)
Specified by:
isValidType in interface RepositoryManager

createRepository

public Repository createRepository(java.lang.String type,
                                   java.lang.String name,
                                   java.lang.String description,
                                   java.util.Properties properties)
                            throws java.lang.Exception
Specified by:
createRepository in interface RepositoryManager
Throws:
java.lang.Exception

updateRepository

public void updateRepository(java.lang.Long id,
                             java.lang.String type,
                             java.lang.String name,
                             java.lang.String description,
                             java.util.Properties properties)
                      throws GenericEntityException
Updates the repository with the given id. The values are updated based on the properties

Specified by:
updateRepository in interface RepositoryManager
Parameters:
id -
properties -
type -
name -
description -
Throws:
GenericEntityException

removeRepository

public void removeRepository(java.lang.Long id)
                      throws java.lang.Exception
Specified by:
removeRepository in interface RepositoryManager
Throws:
java.lang.Exception

setProjectRepositories

public void setProjectRepositories(GenericValue project,
                                   java.util.Collection repositoryIds)
                            throws GenericEntityException
Given a project and a collection of repository ids, associates the project with the repositories that have the given ids NOTE: the old associations are removed

Specified by:
setProjectRepositories in interface RepositoryManager
Parameters:
project -
repositoryIds -
Throws:
GenericEntityException - if at least one repository with the given id does not exist

getRepositories

public java.util.Collection getRepositories()
                                     throws GenericEntityException
Specified by:
getRepositories in interface RepositoryManager
Returns:
A List of all Repository objects in the system.
Throws:
GenericEntityException - if table could not be accessed

updateRepositories

public boolean updateRepositories()
                           throws GenericEntityException
Description copied from interface: RepositoryManager
Tries to update (e.g. cvs up)all the repositories in the system. This method returns true if ALL repositories were potentially updated without a problem, or false if exception occurred.

Specified by:
updateRepositories in interface RepositoryManager
Returns:
Throws:
GenericEntityException

updateRepository

protected boolean updateRepository(Repository repository)
                            throws CommandException,
                                   AuthenticationException,
                                   java.io.IOException,
                                   LogSyntaxException
Throws:
CommandException
AuthenticationException
java.io.IOException
LogSyntaxException

refresh

public void refresh()
             throws GenericEntityException
Specified by:
refresh in interface RepositoryManager
Throws:
GenericEntityException

getGenericDelegator

protected GenericDelegator getGenericDelegator()

getAssociationManager

protected AssociationManager getAssociationManager()

getServiceManager

protected ServiceManager getServiceManager()