Class TeamService
- java.lang.Object
-
- org.exoplatform.timetracker.service.TeamService
-
public class TeamService extends java.lang.ObjectA Service to access and store Teams- Version:
- $Id: $Id
- Author:
- medamine
-
-
Constructor Summary
Constructors Constructor Description TeamService(TeamStorage teamStorage)Constructor for TeamService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TeamcreateTeam(Team team)Create new Team that will be available for all users.voidcreateTeamMember(TeamMember teamMember)Create new TeamMember that will be available for all users.voiddeleteTeam(java.lang.String teamId)Delete Team identified by its id and check if username has permission to delete it.voiddeleteTeamMember(java.lang.String teamMemberId)Delete TeamMember identified by its id and check if username has permission to delete it.java.util.List<TeamMember>getEmployeesList(java.lang.String userName)Retrieves the list of Employees emptyjava.util.List<TeamMember>getMembersList(java.lang.String teamID)Retrieves the list of Teams with offset, limit and a keyword that can be emptyjava.util.List<Team>getTeams()Retrieves the list of Teams with offset, limit and a keyword that can be emptyjava.util.List<Team>getTeamsList(java.lang.String userName)Retrieves the list of Teams with offset, limit and a keyword that can be emptyTeamupdateTeam(Team team)Update an existing Project on datasource.
-
-
-
Constructor Detail
-
TeamService
public TeamService(TeamStorage teamStorage)
Constructor for TeamService.
- Parameters:
teamStorage- aTeamStorageobject.
-
-
Method Detail
-
createTeam
public Team createTeam(Team team) throws java.lang.Exception
Create new Team that will be available for all users. If the Team already exits anEntityExistsExceptionwill be thrown.- Parameters:
team- Team to create- Returns:
- stored
Teamin datasource - Throws:
java.lang.Exception- when Team already exists or an error occurs while creating Team or its attached image
-
updateTeam
public Team updateTeam(Team team) throws java.lang.Exception
Update an existing Project on datasource. If the Project doesn't exit anEntityNotFoundExceptionwill be thrown.- Parameters:
team- dto to update on store- Returns:
- stored
Teamin datasource - Throws:
java.lang.Exception- whenExceptionis thrown or an error occurs while saving Project
-
deleteTeam
public void deleteTeam(java.lang.String teamId) throws java.lang.ExceptionDelete 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 foundjava.lang.IllegalAccessException- if user is not allowed to delete Teamjava.lang.Exception- if any.
-
getTeamsList
public java.util.List<Team> getTeamsList(java.lang.String userName) throws java.lang.Exception
Retrieves the list of Teams with offset, limit and a keyword that can be empty- Parameters:
userName- aStringobject.- Returns:
- List of
Teamthat contains the list of Teams - Throws:
java.lang.Exception- if any.
-
getMembersList
public java.util.List<TeamMember> getMembersList(java.lang.String teamID) throws java.lang.Exception
Retrieves the list of Teams with offset, limit and a keyword that can be empty- Parameters:
teamID- aStringobject.- Returns:
- List of
Teamthat contains the list of Teams - Throws:
java.lang.Exception- if any.
-
getEmployeesList
public java.util.List<TeamMember> getEmployeesList(java.lang.String userName) throws java.lang.Exception
Retrieves the list of Employees empty- Parameters:
userName- aStringobject.- Returns:
- List of
Teamthat contains the list of Teams - Throws:
java.lang.Exception- if any.
-
getTeams
public java.util.List<Team> getTeams() throws java.lang.Exception
Retrieves the list of Teams with offset, limit and a keyword that can be empty- Returns:
- List of
Teamthat contains the list of Teams - Throws:
java.lang.Exception- if any.
-
createTeamMember
public void createTeamMember(TeamMember teamMember) throws java.lang.Exception
Create new TeamMember that will be available for all users. If the TeamMember already exits anEntityExistsExceptionwill be thrown.- Parameters:
teamMember- TeamMember to create- Throws:
java.lang.Exception- when TeamMember already exists or an error occurs while creating TeamMember or its attached image
-
deleteTeamMember
public void deleteTeamMember(java.lang.String teamMemberId) throws java.lang.ExceptionDelete 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 foundjava.lang.IllegalAccessException- if user is not allowed to delete TeamMemberjava.lang.Exception- if any.
-
-