|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.jira.vcs.DefaultRepositoryManager
public class DefaultRepositoryManager
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.jira.vcs.RepositoryManager |
|---|
CVS_TYPE, VCS_SERVICE_DELAY, VCS_SERVICE_NAME, VCS_TYPES |
| Constructor Summary | |
|---|---|
DefaultRepositoryManager(AssociationManager associationManager,
OfBizDelegator ofBizDelegator,
ServiceManager serviceManager,
PermissionManager permissionManager,
ChangeHistoryManager changeHistoryManager,
ProjectManager projectManager,
com.atlassian.event.api.EventPublisher eventPublisher)
|
|
| Method Summary | |
|---|---|
Repository |
createRepository(String type,
String name,
String description,
Properties properties)
Creates a new Repository with the provided attributes and properties and creates a
VcsService if one does not yet exist. |
protected static boolean |
equals(String propertyName,
com.opensymphony.module.propertyset.PropertySet oldPropertySet,
Properties newProperties)
Gets and compares the values of given propety between old and new properties |
protected AssociationManager |
getAssociationManager()
|
Map<Long,Set<CVSCommit>> |
getCommits(Issue issue,
com.atlassian.crowd.embedded.api.User remoteUser)
Retrieves all of the commits for this Issue from ALL of the repositories associated
with the issue's project. |
Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsForRepository(Repository repository)
This method allows you to find the projects that have been associated with a given Repository. |
com.opensymphony.module.propertyset.PropertySet |
getPropertySet(org.ofbiz.core.entity.GenericValue versionControlGV)
Retrieves a PropertySet for a repository provided the repositories GenericValue. |
Collection<Repository> |
getRepositories()
This method will return all Repository's that exist within JIRA. |
Collection<Repository> |
getRepositoriesForProject(org.ofbiz.core.entity.GenericValue project)
This method will return a list of Repositorys that are associated with the provided project. |
Repository |
getRepository(Long id)
Retrieves the Repository by its Repository.getId(). |
Repository |
getRepository(String name)
Retrieves the repository by name |
protected ServiceManager |
getServiceManager()
|
protected boolean |
isDifferentRepository(com.opensymphony.module.propertyset.PropertySet oldPropertySet,
Properties newProperties)
Checks if any of the new properties values will require a new repository to be created. |
boolean |
isValidType(String type)
Validates if a Repository.getType() is valid for this RepositoryManager. |
protected void |
markVcsServiceToRun()
Adds VCS service to the schedule skipper of the service manager. |
void |
onClearCache(ClearCacheEvent event)
|
void |
refresh()
This will clear the repository cache and load all Repository's from the datastore. |
void |
removeRepository(Long id)
This method will remove the Repository specified by id from the datastore and it will remove all
associations that may exist from the repository to projects. |
void |
setProjectRepositories(org.ofbiz.core.entity.GenericValue project,
Collection<Long> 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 |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
boolean |
updateRepositories()
Tries to update (e.g. |
void |
updateRepository(Long id,
String type,
String name,
String description,
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 |
|---|
public DefaultRepositoryManager(AssociationManager associationManager,
OfBizDelegator ofBizDelegator,
ServiceManager serviceManager,
PermissionManager permissionManager,
ChangeHistoryManager changeHistoryManager,
ProjectManager projectManager,
com.atlassian.event.api.EventPublisher eventPublisher)
throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException| Method Detail |
|---|
public void start()
throws Exception
Startable
start in interface StartableException - Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public Collection<Repository> getRepositoriesForProject(org.ofbiz.core.entity.GenericValue project)
throws org.ofbiz.core.entity.GenericEntityException
RepositoryManagerRepositorys that are associated with the provided project.
getRepositoriesForProject in interface RepositoryManagerproject - a GenericValue representing the project associated with the repositories you would like to
retrieve.
Repository's.
org.ofbiz.core.entity.GenericEntityException - if there is a problem accessing the data store.
public Collection<org.ofbiz.core.entity.GenericValue> getProjectsForRepository(Repository repository)
throws org.ofbiz.core.entity.GenericEntityException
RepositoryManagerRepository.
getProjectsForRepository in interface RepositoryManagerrepository - represents the repository associated with the collection of projects returned.
GenericValues that represent the projects the provided repository are
associated with.
org.ofbiz.core.entity.GenericEntityException - thrown if there is trouble accessing the datastore.public Repository getRepository(String name)
getRepository in interface RepositoryManagername - name of the repository
public Repository getRepository(Long id)
RepositoryManagerRepository by its Repository.getId(). If the repository
is not found in the datastore a RuntimeException will be generated.
getRepository in interface RepositoryManagerid - represents the repositories id.
Repository object as found by id.public com.opensymphony.module.propertyset.PropertySet getPropertySet(org.ofbiz.core.entity.GenericValue versionControlGV)
RepositoryManagerPropertySet for a repository provided the repositories GenericValue. The property
set stores values such as ViewCvsBrowser.ROOT_PARAMETER and
ViewCvsBrowser.KEY_BASE_URL.
getPropertySet in interface RepositoryManagerversionControlGV - the generic value representation of the repository.
PropertySet for the specified repository.public boolean isValidType(String type)
RepositoryManagerRepository.getType() is valid for this RepositoryManager.
isValidType in interface RepositoryManagertype - is a repository type (e.g. RepositoryManager.CVS_TYPE)
RepositoryManager.VCS_TYPES, false otherwise.
public Map<Long,Set<CVSCommit>> getCommits(Issue issue,
com.atlassian.crowd.embedded.api.User remoteUser)
RepositoryManagerIssue from ALL of the repositories associated
with the issue's project. It will only show commits if the user has the
Permissions.VIEW_VERSION_CONTROL permission.
Returns a map of (repository id -> Set of CVSCommit):
If the map is empty, there are no associated repositories for the issue and user.
If the List of CVSCommit is null,
then the vcs log has not yet been parsed for that repository.
getCommits in interface RepositoryManagerissue - is the issue which identifies the project which should be used to find Repository's.remoteUser - is the user who's permissions will determine which commits are visible. This is the user
who is making the browse request.
CVSCommit)
public Repository createRepository(String type,
String name,
String description,
Properties properties)
throws Exception
RepositoryManagerRepository with the provided attributes and properties and creates a
VcsService if one does not yet exist.
createRepository in interface RepositoryManagertype - the type of the Repository, this should be RepositoryManager.CVS_TYPE.name - the name of the Repository.description - the description of the Repository.properties - are properties that are essential for the repository to work, such as
ViewCvsBrowser.ROOT_PARAMETER and
ViewCvsBrowser.KEY_BASE_URL.
Repository object representation of the newly created repository.
Exception - thrown if there is a problem creating the repository, this could be caused by trouble accessing
the datastore, or trouble creating the VcsService.
public void updateRepository(Long id,
String type,
String name,
String description,
Properties properties)
throws org.ofbiz.core.entity.GenericEntityException
updateRepository in interface RepositoryManagerid - repository idtype - VCS type, this method only supports RepositoryManager.CVS_TYPEname - VCS namedescription - VCS descriptionproperties - new properties to store
org.ofbiz.core.entity.GenericEntityException - thrown if the Repository can not be found by id or if there is trouble
accessing the datastore.
protected boolean isDifferentRepository(com.opensymphony.module.propertyset.PropertySet oldPropertySet,
Properties newProperties)
CvsRepository.KEY_MODULE_NAME,
CvsRepository.KEY_PASSWORD, CvsRepository.KEY_CVS_ROOT or
CvsRepository.KEY_FETCH_LOG values.
oldPropertySet - old propertiesnewProperties - new properties
protected static boolean equals(String propertyName,
com.opensymphony.module.propertyset.PropertySet oldPropertySet,
Properties newProperties)
propertyName - property nameoldPropertySet - old propertiesnewProperties - new properties
protected void markVcsServiceToRun()
public void removeRepository(Long id)
throws Exception
RepositoryManagerRepository specified by id from the datastore and it will remove all
associations that may exist from the repository to projects.
removeRepository in interface RepositoryManagerid - represents the repositories id.
Exception - thrown if there is trouble removing the values from the datastore.
public void setProjectRepositories(org.ofbiz.core.entity.GenericValue project,
Collection<Long> repositoryIds)
throws org.ofbiz.core.entity.GenericEntityException
setProjectRepositories in interface RepositoryManagerproject - project generic valuerepositoryIds - collection of repository ids <Long>
org.ofbiz.core.entity.GenericEntityException - if at least one repository with the given id does not existpublic Collection<Repository> getRepositories()
RepositoryManagerRepository's that exist within JIRA.
getRepositories in interface RepositoryManagerRepository objects in the system.
public boolean updateRepositories()
throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
updateRepositories in interface RepositoryManagerorg.ofbiz.core.entity.GenericEntityException - throw if there is trouble accessing the datastore.
protected boolean updateRepository(Repository repository)
throws org.netbeans.lib.cvsclient.command.CommandException,
org.netbeans.lib.cvsclient.connection.AuthenticationException,
IOException,
net.sf.statcvs.input.LogSyntaxException,
LockException
org.netbeans.lib.cvsclient.command.CommandException
org.netbeans.lib.cvsclient.connection.AuthenticationException
IOException
net.sf.statcvs.input.LogSyntaxException
LockException
public void refresh()
throws org.ofbiz.core.entity.GenericEntityException
RepositoryManagerRepository's from the datastore.
refresh in interface RepositoryManagerorg.ofbiz.core.entity.GenericEntityException - thrown if there is trouble accessing the datastore.protected AssociationManager getAssociationManager()
protected ServiceManager getServiceManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||