Class TeamService

java.lang.Object
org.exoplatform.timetracker.service.TeamService

public class TeamService extends Object
A Service to access and store Teams
Version:
$Id: $Id
Author:
medamine
  • Constructor Details

    • TeamService

      public TeamService(TeamStorage teamStorage)

      Constructor for TeamService.

      Parameters:
      teamStorage - a TeamStorage object.
  • Method Details

    • createTeam

      public Team createTeam(Team team) throws Exception
      Create new Team that will be available for all users. If the Team already exits an EntityExistsException will be thrown.
      Parameters:
      team - Team to create
      Returns:
      stored Team in datasource
      Throws:
      Exception - when Team already exists or an error occurs while creating Team or its attached image
    • updateTeam

      public Team updateTeam(Team team) throws Exception
      Update an existing Project on datasource. If the Project doesn't exit an EntityNotFoundException will be thrown.
      Parameters:
      team - dto to update on store
      Returns:
      stored Team in datasource
      Throws:
      Exception - when Exception is thrown or an error occurs while saving Project
    • deleteTeam

      public void deleteTeam(String teamId) throws Exception
      Delete Team identified by its id and check if username has permission to delete it.
      Parameters:
      teamId - technical identifier of Team
      Throws:
      javax.persistence.EntityNotFoundException - if Team wasn't found
      IllegalAccessException - if user is not allowed to delete Team
      Exception - if any.
    • getTeamsList

      public List<Team> getTeamsList(String userName) throws Exception
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      Parameters:
      userName - a String object.
      Returns:
      List of Team that contains the list of Teams
      Throws:
      Exception - if any.
    • getMembersList

      public List<TeamMember> getMembersList(String teamID) throws Exception
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      Parameters:
      teamID - a String object.
      Returns:
      List of Team that contains the list of Teams
      Throws:
      Exception - if any.
    • getEmployeesList

      public List<TeamMember> getEmployeesList(String userName) throws Exception
      Retrieves the list of Employees empty
      Parameters:
      userName - a String object.
      Returns:
      List of Team that contains the list of Teams
      Throws:
      Exception - if any.
    • getTeams

      public List<Team> getTeams() throws Exception
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      Returns:
      List of Team that contains the list of Teams
      Throws:
      Exception - if any.
    • createTeamMember

      public void createTeamMember(TeamMember teamMember) throws Exception
      Create new TeamMember that will be available for all users. If the TeamMember already exits an EntityExistsException will be thrown.
      Parameters:
      teamMember - TeamMember to create
      Throws:
      Exception - when TeamMember already exists or an error occurs while creating TeamMember or its attached image
    • deleteTeamMember

      public void deleteTeamMember(String teamMemberId) throws Exception
      Delete TeamMember identified by its id and check if username has permission to delete it.
      Parameters:
      teamMemberId - technical identifier of TeamMember
      Throws:
      javax.persistence.EntityNotFoundException - if TeamMember wasn't found
      IllegalAccessException - if user is not allowed to delete TeamMember
      Exception - if any.