|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RepositoryManager
The RepositoryManager is used to interface with JIRA's CVS integration. Through this manager you can create, retrieve, update, and delete CVS repository references. You can also associate/unassociate repositories with JIRA projects.
NOTE: JIRA also integrates with Perforce and Subversion repositories but this integration is done via JIRA's plugin framework and therefore does not utilize this manager.
Field Summary | |
---|---|
static String |
CVS_TYPE
|
static long |
VCS_SERVICE_DELAY
|
static String |
VCS_SERVICE_NAME
|
static Collection<String> |
VCS_TYPES
|
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. |
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 Repository s 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 its Repository.getName() . |
boolean |
isValidType(String type)
Validates if a Repository.getType() is valid for this RepositoryManager. |
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)
This method will associate the provided repositories with the provided project. |
boolean |
updateRepositories()
Tries to update (e.g. |
void |
updateRepository(Long id,
String type,
String name,
String description,
Properties properties)
Updates the properties and attributes of the Repository with the given id. |
Field Detail |
---|
static final String CVS_TYPE
static final Collection<String> VCS_TYPES
static final String VCS_SERVICE_NAME
static final long VCS_SERVICE_DELAY
Method Detail |
---|
Collection<Repository> getRepositoriesForProject(org.ofbiz.core.entity.GenericValue project) throws org.ofbiz.core.entity.GenericEntityException
Repository
s that are associated with the provided project.
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.void setProjectRepositories(org.ofbiz.core.entity.GenericValue project, Collection<Long> repositoryIds) throws org.ofbiz.core.entity.GenericEntityException
project
- a GenericValue representing the project to associate the repositories to.repositoryIds
- a list of Long
's representing the Repository.getId()
of the repositories you would like to associate with the project.
org.ofbiz.core.entity.GenericEntityException
- thrown if a repository id can not be resolved.Collection<org.ofbiz.core.entity.GenericValue> getProjectsForRepository(Repository repository) throws org.ofbiz.core.entity.GenericEntityException
Repository
.
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.Collection<Repository> getRepositories()
Repository
's that exist within JIRA.
Repository
objects.Repository getRepository(Long id) throws org.ofbiz.core.entity.GenericEntityException
Repository
by its Repository.getId()
. If the repository
is not found in the datastore a RuntimeException will be generated.
id
- represents the repositories id.
Repository
object as found by id.
org.ofbiz.core.entity.GenericEntityException
- thrown if there is trouble accessing the datastore.Repository getRepository(String name)
Repository
by its Repository.getName()
. If the repository
is not found then this will return null.
name
- represents the repositories name.
Repository
with the given name if one is found, null otherwise.boolean isValidType(String type)
Repository.getType()
is valid for this RepositoryManager.
type
- is a repository type (e.g. CVS_TYPE
)
VCS_TYPES
, false otherwise.void removeRepository(Long id) throws Exception
Repository
specified by id from the datastore and it will remove all
associations that may exist from the repository to projects.
id
- represents the repositories id.
Exception
- thrown if there is trouble removing the values from the datastore.void updateRepository(Long id, String type, String name, String description, Properties properties) throws org.ofbiz.core.entity.GenericEntityException
Repository
with the given id. All passed in values
will replace any previously existing values. For example, if you would like to change the description, but
not the name you should pass in all the existing attributes and properties as well as the new description.
id
- represents the repositories id.type
- represents the type to update the repository to.name
- represents the name to update the repository to.description
- represents the description to update the repository to.properties
- defines the properties to update on the repository.
org.ofbiz.core.entity.GenericEntityException
- thrown if the Repository
can not be found by id or if there is trouble
accessing the datastore.boolean updateRepositories() throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
- throw if there is trouble accessing the datastore.Repository createRepository(String type, String name, String description, Properties properties) throws Exception
Repository
with the provided attributes and properties and creates a
VcsService
if one does not yet exist.
type
- the type of the Repository, this should be 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
.void refresh() throws org.ofbiz.core.entity.GenericEntityException
Repository
's from the datastore.
org.ofbiz.core.entity.GenericEntityException
- thrown if there is trouble accessing the datastore.com.opensymphony.module.propertyset.PropertySet getPropertySet(org.ofbiz.core.entity.GenericValue versionControlGV)
PropertySet
for a repository provided the repositories GenericValue
. The property
set stores values such as ViewCvsBrowser.ROOT_PARAMETER
and
ViewCvsBrowser.KEY_BASE_URL
.
versionControlGV
- the generic value representation of the repository.
PropertySet
for the specified repository.Map<Long,Set<CVSCommit>> getCommits(Issue issue, com.atlassian.crowd.embedded.api.User remoteUser)
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.
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
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |