|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.project.AbstractProjectManager com.atlassian.jira.project.CachingProjectManager
public class CachingProjectManager
Constructor Summary | |
---|---|
protected |
CachingProjectManager(ProjectManager delegateProjectManager,
ProjectComponentManager projectComponentManager,
boolean updateCache)
This constructor is to allow test cases to fire up a caching project manager without instantiating the internal project cache. |
|
CachingProjectManager(ProjectManager delegateProjectManager,
ProjectComponentManager projectComponentManager,
ProjectFactory projectFactory,
com.atlassian.event.api.EventPublisher eventPublisher)
Normal constructor. |
Method Summary | |
---|---|
Project |
createProject(java.lang.String name,
java.lang.String key,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType,
java.lang.Long avatarId)
Creates the project in the database, and adds default project roles for this project. |
ProjectCache |
getCache()
|
org.ofbiz.core.entity.GenericValue |
getComponent(org.ofbiz.core.entity.GenericValue project,
java.lang.String name)
Deprecated. use ProjectComponentManager and ProjectComponent |
org.ofbiz.core.entity.GenericValue |
getComponent(java.lang.Long id)
Deprecated. use ProjectComponentManager and ProjectComponent |
java.util.Collection |
getComponents(org.ofbiz.core.entity.GenericValue project)
Deprecated. use ProjectComponentManager and ProjectComponent |
long |
getNextId(org.ofbiz.core.entity.GenericValue project)
Get the next issue ID from this project (transactional). |
long |
getNextId(Project project)
Get the next issue ID from this project (transactional). |
org.ofbiz.core.entity.GenericValue |
getProject(java.lang.Long id)
Retrieve a single project by it's id. |
org.ofbiz.core.entity.GenericValue |
getProjectByKey(java.lang.String key)
Retrieve a single project by it's project key. |
org.ofbiz.core.entity.GenericValue |
getProjectByName(java.lang.String name)
Retrieve a single project by it's project name. |
java.util.Collection |
getProjectCategories()
Get all ProjectCategories. |
org.ofbiz.core.entity.GenericValue |
getProjectCategory(java.lang.Long id)
Returns a single project category by id. |
org.ofbiz.core.entity.GenericValue |
getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
Returns a project's category. |
Project |
getProjectObj(java.lang.Long id)
Retrieves a single Project by its id. |
Project |
getProjectObjByKey(java.lang.String projectKey)
Returns a Project object based on the passed in project key. |
Project |
getProjectObjByKeyIgnoreCase(java.lang.String projectKey)
Returns a Project object based ont he passed in project key, not taking into account the case
of the project key. |
Project |
getProjectObjByName(java.lang.String projectName)
Returns a Project object based on the passed in project name. |
java.util.List<Project> |
getProjectObjects()
Return all Project s ordered by name. |
java.util.Collection<Project> |
getProjectObjectsFromProjectCategory(java.lang.Long projectCategoryId)
Returns a list of projects in a particular category. |
java.util.Collection<Project> |
getProjectObjectsWithNoCategory()
Returns a list of projects without project category, sorted by project name |
java.util.Collection<org.ofbiz.core.entity.GenericValue> |
getProjects()
Return all project GenericValue s. |
java.util.Collection |
getProjectsByLead(com.opensymphony.user.User leadUser)
Returns all the projects that leadUser is the project lead for. |
java.util.Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
Returns a list of projects in a particular category. |
java.util.Collection<org.ofbiz.core.entity.GenericValue> |
getProjectsWithNoCategory()
Returns a list of projects without project category, sorted by project name |
protected java.util.Collection |
noNull(java.util.Collection col)
|
void |
onClearCache(ClearCacheEvent event)
|
void |
refresh()
Causes a full refresh of the project cache. |
void |
refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
This will refresh the dependencies of a project. |
void |
removeProject(Project project)
Deletes the provided project from the database. |
void |
removeProjectIssues(Project project)
Removes all issues for a particular project. |
void |
setProjectCategory(org.ofbiz.core.entity.GenericValue project,
org.ofbiz.core.entity.GenericValue category)
Sets a projects category. |
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
void |
updateCache()
|
void |
updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
Persists a project GenericValue to the database. |
Project |
updateProject(Project updatedProject,
java.lang.String name,
java.lang.String description,
java.lang.String lead,
java.lang.String url,
java.lang.Long assigneeType,
java.lang.Long avatarId)
Updates the project provided with the new attributes passed in. |
void |
updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
Persist an updated project category. |
Methods inherited from class com.atlassian.jira.project.AbstractProjectManager |
---|
convertToProjects, createProject, getComponents, getDefaultAssignee, getProject, getProjectCategoryByName, getProjectCategoryByNameIgnoreCase, isDefaultAssignee, isDefaultAssignee, updateProject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingProjectManager(ProjectManager delegateProjectManager, ProjectComponentManager projectComponentManager, ProjectFactory projectFactory, com.atlassian.event.api.EventPublisher eventPublisher)
delegateProjectManager
- The ProjectManager
to delegate to.eventPublisher
- protected CachingProjectManager(ProjectManager delegateProjectManager, ProjectComponentManager projectComponentManager, boolean updateCache)
delegateProjectManager
- The ProjectManager
to delegate to.updateCache
- Whether to instantiate a ProjectCache
.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 void updateCache()
public long getNextId(Project project)
ProjectManager
getNextId
in interface ProjectManager
getNextId
in class AbstractProjectManager
project
- The Project
public long getNextId(org.ofbiz.core.entity.GenericValue project)
ProjectManager
getNextId
in interface ProjectManager
project
- project GenericValue
public void refreshProjectDependencies(org.ofbiz.core.entity.GenericValue project)
ProjectManager
ProjectManager.refresh()
refreshProjectDependencies
in interface ProjectManager
project
- project GenericValuepublic void refresh()
ProjectManager
refresh
in interface ProjectManager
public org.ofbiz.core.entity.GenericValue getProject(java.lang.Long id)
ProjectManager
getProject
in interface ProjectManager
id
- the Project ID.
public Project getProjectObj(java.lang.Long id)
ProjectManager
Project
by its id.
getProjectObj
in interface ProjectManager
id
- ID of the Project.
public org.ofbiz.core.entity.GenericValue getProjectByName(java.lang.String name)
ProjectManager
getProjectByName
in interface ProjectManager
name
- project name
public org.ofbiz.core.entity.GenericValue getProjectByKey(java.lang.String key)
ProjectManager
getProjectByKey
in interface ProjectManager
key
- the project key
public Project getProjectObjByKey(java.lang.String projectKey)
ProjectManager
Project
object based on the passed in project key.
getProjectObjByKey
in interface ProjectManager
projectKey
- the Project key.
Project
object specified by the key or nullpublic Project getProjectObjByKeyIgnoreCase(java.lang.String projectKey)
ProjectManager
Project
object based ont he passed in project key, not taking into account the case
of the project key.
getProjectObjByKeyIgnoreCase
in interface ProjectManager
projectKey
- the project key, case does not matter.
public Project getProjectObjByName(java.lang.String projectName)
ProjectManager
Project
object based on the passed in project name.
getProjectObjByName
in interface ProjectManager
projectName
- the name of the project
Project
object specified by the supplied name or nullpublic org.ofbiz.core.entity.GenericValue getComponent(org.ofbiz.core.entity.GenericValue project, java.lang.String name)
getComponent
in interface ProjectManager
project
- the Project.name
- the Component name.
ProjectComponentManager.findByComponentName(java.lang.Long, java.lang.String)
public org.ofbiz.core.entity.GenericValue getComponent(java.lang.Long id)
getComponent
in interface ProjectManager
id
- the id of the component to retrieve
ProjectComponentManager.find(Long)
public java.util.Collection getComponents(org.ofbiz.core.entity.GenericValue project)
getComponents
in interface ProjectManager
project
- the project (as a GenericValue) used to search on
ProjectComponentManager.findAllForProject(java.lang.Long)
public java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjects()
ProjectManager
GenericValue
s.
getProjects
in interface ProjectManager
public java.util.List<Project> getProjectObjects()
ProjectManager
Project
s ordered by name.
getProjectObjects
in interface ProjectManager
protected java.util.Collection noNull(java.util.Collection col)
public Project createProject(java.lang.String name, java.lang.String key, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
ProjectManager
createProject
in interface ProjectManager
name
- The name of the new projectkey
- The project key of the new projectdescription
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the new projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.avatarId
- the id of an existing system avatar.
public void updateProject(org.ofbiz.core.entity.GenericValue updatedProject)
ProjectManager
GenericValue
to the database.
updateProject
in interface ProjectManager
updatedProject
- Project details to update.public Project updateProject(Project updatedProject, java.lang.String name, java.lang.String description, java.lang.String lead, java.lang.String url, java.lang.Long assigneeType, java.lang.Long avatarId)
ProjectManager
updateProject
in interface ProjectManager
updatedProject
- The project to be updated.name
- The name for the updated projectdescription
- An optional description for the projectlead
- The lead developer for the projecturl
- An optional URL for the updated projectassigneeType
- The default assignee for issues created in this project. May be either project lead, or
unassigned if unassigned issues are enabled.avatarId
- the id of an existing avatar.
public void removeProjectIssues(Project project) throws RemoveException
ProjectManager
removeProjectIssues
in interface ProjectManager
project
- The project for which issues will be deleted.
RemoveException
- if there's any errors removing issuespublic void removeProject(Project project)
ProjectManager
ProjectService.deleteProject(com.opensymphony.user.User, com.atlassian.jira.bc.project.ProjectService.DeleteProjectValidationResult)
to
properly delete a project.
removeProject
in interface ProjectManager
project
- The project to be deleted.public java.util.Collection getProjectCategories()
ProjectManager
getProjectCategories
in interface ProjectManager
GenericValue
spublic org.ofbiz.core.entity.GenericValue getProjectCategory(java.lang.Long id)
ProjectManager
getProjectCategory
in interface ProjectManager
id
- Project Category ID.
GenericValue
public void updateProjectCategory(org.ofbiz.core.entity.GenericValue projectCat)
ProjectManager
updateProjectCategory
in interface ProjectManager
projectCat
- project category.public java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsFromProjectCategory(org.ofbiz.core.entity.GenericValue projectCategory)
ProjectManager
getProjectsFromProjectCategory
in interface ProjectManager
projectCategory
- project category.
GenericValue
s sorted by name.public java.util.Collection<Project> getProjectObjectsFromProjectCategory(java.lang.Long projectCategoryId)
ProjectManager
getProjectObjectsFromProjectCategory
in interface ProjectManager
projectCategoryId
- project category id.
Project
s sorted by name.public org.ofbiz.core.entity.GenericValue getProjectCategoryFromProject(org.ofbiz.core.entity.GenericValue project)
ProjectManager
getProjectCategoryFromProject
in interface ProjectManager
project
- project
GenericValue
or null if no category exists.public java.util.Collection<org.ofbiz.core.entity.GenericValue> getProjectsWithNoCategory()
ProjectManager
getProjectsWithNoCategory
in interface ProjectManager
GenericValue
s sorted by namepublic java.util.Collection<Project> getProjectObjectsWithNoCategory() throws DataAccessException
ProjectManager
getProjectObjectsWithNoCategory
in interface ProjectManager
Project
s sorted by name
DataAccessException
- If any errors occur accessing the DB.public void setProjectCategory(org.ofbiz.core.entity.GenericValue project, org.ofbiz.core.entity.GenericValue category)
ProjectManager
setProjectCategory
in interface ProjectManager
project
- projectcategory
- categorypublic java.util.Collection getProjectsByLead(com.opensymphony.user.User leadUser)
ProjectManager
getProjectsByLead
in interface ProjectManager
leadUser
- Project Lead
GenericValue
s
TODO: deprecate this method.public ProjectCache getCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |