@RolesAllowed(value={"ADMIN","USER"}) public class TeamService extends Object
| Constructor and Description |
|---|
TeamService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
acceptInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
Accepts the invitation of a team
|
void |
addPlayer(String teamName,
int playerId)
Adds a player in the team
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
Creates a new team in the database
|
void |
delete(String name)
Logical deletes a team in the database
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
Gets a List of Teams from the database that are managed by a given user
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findByNameDescription(String name,
String description)
Gets a Team from the database searching by name or description
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findByNameDescriptionUser(String name,
String description,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
Gets a Team from the database searching by name or description
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
Gets a List of Teams from the database of a given sport type
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findBySportUser(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
Gets a List of Teams from the database of a given sport type and a given user
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> |
findInvitations(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
Returns the competitions that have sent an invitation to that team
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.InvitationBetweenTeamCompetition.State |
findStateInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
Find the state of an invitation between a team and a competition
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> |
findVisibles()
Gets a List of Teams from the database that are visibles in the system
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
get(String name)
Gets a Team from the database
|
Boolean |
isTeamNameAvaliable(String name)
Returns if a concrete team name is avaliable
|
void |
realDelete(String name)
Deletes a team from the database
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
rejectInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
Rejects the invitation of a team
|
void |
removePlayer(String teamName,
int playerId)
Removes a player from the team
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team |
update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
Updates a team in the database
|
public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team get(String name)
name - is the name of the team for searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findByNameDescription(String name, String description)
name - name of the Team to searchdescription - description of the Team to searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findByNameDescriptionUser(String name, String description, es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
name - name of the Team to searchdescription - description of the Team to searchuser - User administrator of the Team to searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
user - a user that manages teamspublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
sport - a SportType for search teamspublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findBySportUser(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport, es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User user)
sport - a SportType for search teamsuser - a user for search teamspublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team> findVisibles()
public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
team - the team to be inserted in the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
team - the team to be updated in the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void delete(String name)
name - the name of the team to be logical deleted from the databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void addPlayer(String teamName, int playerId)
teamName - the name of the team where we want to add the playerplayerId - the player ID of the player we what to add to the teamjavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void removePlayer(String teamName, int playerId)
teamName - the name of the team where we want to remove the playerplayerId - the player ID of the player we what to remove from the teamjavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public void realDelete(String name)
name - the bane of the team to delete from databasejavax.ejb.EJBAccessException - if the team user is not the current user does not have access to
do this action.public Boolean isTeamNameAvaliable(String name)
name - the name to check if it is avaliablepublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> findInvitations(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team)
team - the team that requests the invitationspublic es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team acceptInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
team - the team that accepts the invitationcompetition - the competition that sent the invitationIllegalArgumentException - if a competition is nullpublic es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team rejectInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
team - the team that rejects the invitationcompetition - the competition that sent the invitationIllegalArgumentException - if a competition is nullpublic es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.InvitationBetweenTeamCompetition.State findStateInvitation(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Team team,
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
team - the team to checkcompetition - the competition to checkIllegalArgumentException - if a competition is nullCopyright © 2017. All rights reserved.