|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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()
|
|
DefaultRepositoryManager(com.atlassian.core.ofbiz.association.AssociationManager associationManager,
org.ofbiz.core.entity.GenericDelegator genericDelegator,
ServiceManager serviceManager,
PermissionManager permissionManager,
ChangeHistoryManager changeHistoryManager,
ProjectManager projectManager,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
Repository |
createRepository(java.lang.String type,
java.lang.String name,
java.lang.String description,
java.util.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(java.lang.String propertyName,
com.opensymphony.module.propertyset.PropertySet oldPropertySet,
java.util.Properties newProperties)
Gets and compares the values of given propety between old and new properties |
protected com.atlassian.core.ofbiz.association.AssociationManager |
getAssociationManager()
|
java.util.Map<java.lang.Long,java.util.Set<CVSCommit>> |
getCommits(Issue issue,
com.opensymphony.user.User remoteUser)
Retrieves all of the commits for this Issue from ALL of the repositories associated
with the issue's project. |
protected org.ofbiz.core.entity.GenericDelegator |
getGenericDelegator()
|
java.util.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 . |
java.util.Collection<Repository> |
getRepositories()
This method will return all Repository 's that exist within JIRA. |
java.util.Collection<Repository> |
getRepositoriesForProject(org.ofbiz.core.entity.GenericValue project)
This method will return a list of Repository s that are associated with the provided project. |
Repository |
getRepository(java.lang.Long id)
Retrieves the Repository by its Repository.getId() . |
Repository |
getRepository(java.lang.String name)
Retrieves the repository by name |
protected ServiceManager |
getServiceManager()
|
protected boolean |
isDifferentRepository(com.opensymphony.module.propertyset.PropertySet oldPropertySet,
java.util.Properties newProperties)
Checks if any of the new properties values will require a new repository to be created. |
boolean |
isValidType(java.lang.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(java.lang.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,
java.util.Collection<java.lang.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(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 |
---|
public DefaultRepositoryManager(com.atlassian.core.ofbiz.association.AssociationManager associationManager, org.ofbiz.core.entity.GenericDelegator genericDelegator, 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
public DefaultRepositoryManager() throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
Method Detail |
---|
public void start() throws java.lang.Exception
Startable
start
in interface Startable
java.lang.Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public java.util.Collection<Repository> getRepositoriesForProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
Repository
s that are associated with the provided project.
NOTE: In standard and professional editions the returned list will only ever contain a
single repository. If you have associated more than one repository with the project the list will contain
the first repository it encounters as stored in the database. JIRA enterprise edition allows you to associate
multiple repositories with a project.
getRepositoriesForProject
in interface RepositoryManager
project
- 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 java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsForRepository(Repository repository) throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
Repository
.
getProjectsForRepository
in interface RepositoryManager
repository
- represents the repository associated with the collection of projects returned.
GenericValue
s 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(java.lang.String name)
getRepository
in interface RepositoryManager
name
- name of the repository
public Repository getRepository(java.lang.Long id) throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
Repository
by its Repository.getId()
. If the repository
is not found in the datastore a RuntimeException will be generated.
getRepository
in interface RepositoryManager
id
- represents the repositories id.
Repository
object as found by id.
org.ofbiz.core.entity.GenericEntityException
- thrown if there is trouble accessing the datastore.public com.opensymphony.module.propertyset.PropertySet getPropertySet(org.ofbiz.core.entity.GenericValue versionControlGV)
RepositoryManager
PropertySet
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 RepositoryManager
versionControlGV
- the generic value representation of the repository.
PropertySet
for the specified repository.public boolean isValidType(java.lang.String type)
RepositoryManager
Repository.getType()
is valid for this RepositoryManager.
isValidType
in interface RepositoryManager
type
- is a repository type (e.g. RepositoryManager.CVS_TYPE
)
RepositoryManager.VCS_TYPES
, false otherwise.public java.util.Map<java.lang.Long,java.util.Set<CVSCommit>> getCommits(Issue issue, com.opensymphony.user.User remoteUser)
RepositoryManager
Issue
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 RepositoryManager
issue
- 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(java.lang.String type, java.lang.String name, java.lang.String description, java.util.Properties properties) throws java.lang.Exception
RepositoryManager
Repository
with the provided attributes and properties and creates a
VcsService
if one does not yet exist.
createRepository
in interface RepositoryManager
type
- 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.
java.lang.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(java.lang.Long id, java.lang.String type, java.lang.String name, java.lang.String description, java.util.Properties properties) throws org.ofbiz.core.entity.GenericEntityException
updateRepository
in interface RepositoryManager
id
- repository idtype
- VCS type, this method only supports RepositoryManager.CVS_TYPE
name
- 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, java.util.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(java.lang.String propertyName, com.opensymphony.module.propertyset.PropertySet oldPropertySet, java.util.Properties newProperties)
propertyName
- property nameoldPropertySet
- old propertiesnewProperties
- new properties
protected void markVcsServiceToRun()
public void removeRepository(java.lang.Long id) throws java.lang.Exception
RepositoryManager
Repository
specified by id from the datastore and it will remove all
associations that may exist from the repository to projects.
removeRepository
in interface RepositoryManager
id
- represents the repositories id.
java.lang.Exception
- thrown if there is trouble removing the values from the datastore.public void setProjectRepositories(org.ofbiz.core.entity.GenericValue project, java.util.Collection<java.lang.Long> repositoryIds) throws org.ofbiz.core.entity.GenericEntityException
setProjectRepositories
in interface RepositoryManager
project
- 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 java.util.Collection<Repository> getRepositories()
RepositoryManager
Repository
's that exist within JIRA.
getRepositories
in interface RepositoryManager
Repository
objects in the system.public boolean updateRepositories() throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
updateRepositories
in interface RepositoryManager
org.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, java.io.IOException, net.sf.statcvs.input.LogSyntaxException, LockException
org.netbeans.lib.cvsclient.command.CommandException
org.netbeans.lib.cvsclient.connection.AuthenticationException
java.io.IOException
net.sf.statcvs.input.LogSyntaxException
LockException
public void refresh() throws org.ofbiz.core.entity.GenericEntityException
RepositoryManager
Repository
's from the datastore.
refresh
in interface RepositoryManager
org.ofbiz.core.entity.GenericEntityException
- thrown if there is trouble accessing the datastore.protected org.ofbiz.core.entity.GenericDelegator getGenericDelegator()
protected com.atlassian.core.ofbiz.association.AssociationManager getAssociationManager()
protected ServiceManager getServiceManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |