Class TeamService


  • public class TeamService
    extends java.lang.Object
    A 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
      Team createTeam​(Team team)
      Create new Team that will be available for all users.
      void createTeamMember​(TeamMember teamMember)
      Create new TeamMember that will be available for all users.
      void deleteTeam​(java.lang.String teamId)
      Delete Team identified by its id and check if username has permission to delete it.
      void deleteTeamMember​(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 empty
      java.util.List<TeamMember> getMembersList​(java.lang.String teamID)
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      java.util.List<Team> getTeams()
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      java.util.List<Team> getTeamsList​(java.lang.String userName)
      Retrieves the list of Teams with offset, limit and a keyword that can be empty
      Team updateTeam​(Team team)
      Update an existing Project on datasource.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TeamService

        public TeamService​(TeamStorage teamStorage)

        Constructor for TeamService.

        Parameters:
        teamStorage - a TeamStorage object.
    • 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 an EntityExistsException will be thrown.
        Parameters:
        team - Team to create
        Returns:
        stored Team in 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 an EntityNotFoundException will be thrown.
        Parameters:
        team - dto to update on store
        Returns:
        stored Team in datasource
        Throws:
        java.lang.Exception - when Exception is thrown or an error occurs while saving Project
      • deleteTeam

        public void deleteTeam​(java.lang.String teamId)
                        throws java.lang.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
        java.lang.IllegalAccessException - if user is not allowed to delete Team
        java.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 - a String object.
        Returns:
        List of Team that 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 - a String object.
        Returns:
        List of Team that 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 - a String object.
        Returns:
        List of Team that 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 Team that 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 an EntityExistsException will 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.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
        java.lang.IllegalAccessException - if user is not allowed to delete TeamMember
        java.lang.Exception - if any.