@RolesAllowed(value={"ADMIN","USER"}) public class CompetitionService extends Object
| Constructor and Description |
|---|
CompetitionService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition |
create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
Creates a new competition.
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> |
findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User admin)
Returns a list of competitions which have the required administrator.
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition |
findByNameDescription(String name,
String description)
Gets a competition from the database searching by name or description
|
List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> |
findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
Returns a list of competitions which have the required sport.
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition |
getCompetition(int id)
Returns a competition identified by name as a parameter.
|
void |
remove(int id)
Logical deletion of the competition with the parameters name.
|
es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition |
update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
Updates the information of a competition.
|
public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition getCompetition(int id)
id - the id of a competition which identified it.null if there is no
competition with the specified name.public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition findByNameDescription(String name, String description)
name - name of the competition to searchdescription - description of the competition to searchpublic List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> findByAdmin(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.User admin)
admin - the administrator of the competition.IllegalArgumentException - if admin is null.public List<es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition> findBySport(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.SportType sport)
sport - the sport of the competition.IllegalArgumentException - if sport is null or is a not valid SportType.public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition create(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
competition - a new competition to be stored.IllegalArgumentException - if the competition is null.public es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition update(es.uvigo.esei.dgss.teamb.ligaaas.domain.entities.Competition competition)
competition - the competition to be updated.IllegalArgumentException - if the competition is null.public void remove(int id)
id - the id witch identifies the competition who wants to delete.javax.ejb.EJBAccessException - if the competition's administrator is not the current user.Copyright © 2017. All rights reserved.