org.itracker.services.implementations
Class ProjectServiceImpl

java.lang.Object
  extended by org.itracker.services.implementations.ProjectServiceImpl
All Implemented Interfaces:
ProjectService

public class ProjectServiceImpl
extends Object
implements ProjectService


Constructor Summary
ProjectServiceImpl(ComponentDAO componentDAO, CustomFieldDAO customFieldDAO, ProjectDAO projectDAO, ProjectScriptDAO projectScriptDAO, UserDAO userDAO, VersionDAO versionDAO, IssueDAO issueDAO)
           
 
Method Summary
 Component addProjectComponent(Integer projectId, Component component)
           
 ProjectScript addProjectScript(Integer projectId, ProjectScript projectScript)
           
 Version addProjectVersion(Integer projectId, Version version)
           
 Long countIssuesByComponent(Integer componentId)
          Counts the number of issues for a given component.
 Long countIssuesByVersion(Integer versionId)
          Counts the number of issues for a given version.
 Project createProject(Project project, Integer userId)
          Creates a new issue in a project.
 List<Project> getAllAvailableProjects()
           
 List<Project> getAllProjects()
           
 Date getLatestIssueUpdatedDateByProjectId(Integer projectId)
           
 List<Project> getListOfAllAvailableProjects()
           
 List<CustomField> getListOfProjectFields(Integer projectId)
           
 List<User> getListOfProjectOwners(Integer projectId)
           
 Project getProject(Integer projectId)
           
 Component getProjectComponent(Integer componentId)
           
 List<CustomField> getProjectFields(Integer projectId)
           
 List<CustomField> getProjectFields(Integer projectId, Locale locale)
          TODO: implement Locale-aware ProjectFields.
 List<User> getProjectOwners(Integer projectId)
           
 ProjectScript getProjectScript(Integer scriptId)
           
 List<ProjectScript> getProjectScripts()
           
 Long[] getProjectStats(Integer projectId)
          Returns the number of open and resolved issues in the given project.
 Version getProjectVersion(Integer versionId)
           
 Long getTotalNumberIssuesByProject(Integer projectId)
           
 Long getTotalNumberOpenIssuesByProject(Integer projectId)
           
 Long getTotalNumberResolvedIssuesByProject(Integer projectId)
           
 Boolean isUniqueProjectName(String projectName, Integer updatedProjectId)
          Check if this project name is used by any of the projects which already exist in the database.
 boolean removeProjectComponent(Integer projectId, Integer componentId)
           
 boolean removeProjectScript(Integer projectId, Integer scriptId)
           
 boolean removeProjectVersion(Integer projectId, Integer versionId)
           
 boolean setProjectFields(Project project, Set<Integer> setOfNewsFieldIds)
           
 boolean setProjectOwners(Project project, Set<Integer> setOfNewOwnerIds)
           
 Project updateProject(Project project, Integer userId)
          update a project, as the user with userId
 Component updateProjectComponent(Component component)
           
 ProjectScript updateProjectScript(ProjectScript projectScript)
           
 Version updateProjectVersion(Version version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectServiceImpl

public ProjectServiceImpl(ComponentDAO componentDAO,
                          CustomFieldDAO customFieldDAO,
                          ProjectDAO projectDAO,
                          ProjectScriptDAO projectScriptDAO,
                          UserDAO userDAO,
                          VersionDAO versionDAO,
                          IssueDAO issueDAO)
Method Detail

getProject

public Project getProject(Integer projectId)
Specified by:
getProject in interface ProjectService

getAllProjects

public List<Project> getAllProjects()
Specified by:
getAllProjects in interface ProjectService

getAllAvailableProjects

public List<Project> getAllAvailableProjects()
Specified by:
getAllAvailableProjects in interface ProjectService

getListOfAllAvailableProjects

public List<Project> getListOfAllAvailableProjects()

updateProjectComponent

public Component updateProjectComponent(Component component)
Specified by:
updateProjectComponent in interface ProjectService

addProjectComponent

public Component addProjectComponent(Integer projectId,
                                     Component component)
Specified by:
addProjectComponent in interface ProjectService

removeProjectComponent

public boolean removeProjectComponent(Integer projectId,
                                      Integer componentId)
Specified by:
removeProjectComponent in interface ProjectService

getProjectComponent

public Component getProjectComponent(Integer componentId)
Specified by:
getProjectComponent in interface ProjectService

addProjectVersion

public Version addProjectVersion(Integer projectId,
                                 Version version)
Specified by:
addProjectVersion in interface ProjectService

removeProjectVersion

public boolean removeProjectVersion(Integer projectId,
                                    Integer versionId)
Specified by:
removeProjectVersion in interface ProjectService

updateProjectVersion

public Version updateProjectVersion(Version version)
Specified by:
updateProjectVersion in interface ProjectService

getProjectVersion

public Version getProjectVersion(Integer versionId)
Specified by:
getProjectVersion in interface ProjectService

getProjectOwners

public List<User> getProjectOwners(Integer projectId)
Specified by:
getProjectOwners in interface ProjectService

setProjectOwners

public boolean setProjectOwners(Project project,
                                Set<Integer> setOfNewOwnerIds)
Specified by:
setProjectOwners in interface ProjectService

getProjectFields

public List<CustomField> getProjectFields(Integer projectId)
Specified by:
getProjectFields in interface ProjectService

getProjectFields

public List<CustomField> getProjectFields(Integer projectId,
                                          Locale locale)
TODO: implement Locale-aware ProjectFields.

Specified by:
getProjectFields in interface ProjectService

setProjectFields

public boolean setProjectFields(Project project,
                                Set<Integer> setOfNewsFieldIds)
Specified by:
setProjectFields in interface ProjectService

getProjectScript

public ProjectScript getProjectScript(Integer scriptId)
Specified by:
getProjectScript in interface ProjectService

getProjectScripts

public List<ProjectScript> getProjectScripts()
Specified by:
getProjectScripts in interface ProjectService

addProjectScript

public ProjectScript addProjectScript(Integer projectId,
                                      ProjectScript projectScript)
Specified by:
addProjectScript in interface ProjectService

removeProjectScript

public boolean removeProjectScript(Integer projectId,
                                   Integer scriptId)
Specified by:
removeProjectScript in interface ProjectService

updateProjectScript

public ProjectScript updateProjectScript(ProjectScript projectScript)
Specified by:
updateProjectScript in interface ProjectService

getTotalNumberIssuesByProject

public Long getTotalNumberIssuesByProject(Integer projectId)
Specified by:
getTotalNumberIssuesByProject in interface ProjectService

countIssuesByVersion

public Long countIssuesByVersion(Integer versionId)
Description copied from interface: ProjectService
Counts the number of issues for a given version.

Specified by:
countIssuesByVersion in interface ProjectService
Parameters:
versionId - Id of the version to which the issues must be associated
Returns:
0 if the version has no issues or doesn't exist

countIssuesByComponent

public Long countIssuesByComponent(Integer componentId)
Description copied from interface: ProjectService
Counts the number of issues for a given component.

Specified by:
countIssuesByComponent in interface ProjectService
Parameters:
componentId - Id of the component to which the issues must be associated
Returns:
0 if the component has no issues or doesn't exist

getProjectStats

public Long[] getProjectStats(Integer projectId)
Description copied from interface: ProjectService
Returns the number of open and resolved issues in the given project.

PENDING: should use a class to hold statistics info to improve type- safety.

Specified by:
getProjectStats in interface ProjectService
Returns:
int[0] = open issues, int[1] = resolved issues

getListOfProjectFields

public List<CustomField> getListOfProjectFields(Integer projectId)
Specified by:
getListOfProjectFields in interface ProjectService

getListOfProjectOwners

public List<User> getListOfProjectOwners(Integer projectId)
Specified by:
getListOfProjectOwners in interface ProjectService

getTotalNumberOpenIssuesByProject

public Long getTotalNumberOpenIssuesByProject(Integer projectId)
Specified by:
getTotalNumberOpenIssuesByProject in interface ProjectService

getTotalNumberResolvedIssuesByProject

public Long getTotalNumberResolvedIssuesByProject(Integer projectId)
Specified by:
getTotalNumberResolvedIssuesByProject in interface ProjectService

getLatestIssueUpdatedDateByProjectId

public Date getLatestIssueUpdatedDateByProjectId(Integer projectId)
Specified by:
getLatestIssueUpdatedDateByProjectId in interface ProjectService

createProject

public Project createProject(Project project,
                             Integer userId)
Description copied from interface: ProjectService
Creates a new issue in a project.

Specified by:
createProject in interface ProjectService
userId - the id of registered creator of the new issue
Returns:
an Issue containing the newly created issue, or null if the create failed

updateProject

public Project updateProject(Project project,
                             Integer userId)
Description copied from interface: ProjectService
update a project, as the user with userId

Specified by:
updateProject in interface ProjectService
Returns:
the updated project from Persistence

isUniqueProjectName

public Boolean isUniqueProjectName(String projectName,
                                   Integer updatedProjectId)
Description copied from interface: ProjectService
Check if this project name is used by any of the projects which already exist in the database.

Specified by:
isUniqueProjectName in interface ProjectService
updatedProjectId - The updated project which will be use the new name.
Returns:
true if the name is unique.


Copyright © 2002-2012 itracker. All Rights Reserved.