@RolesAllowed(value="ADMIN") public class OwnerService extends Object
| Constructor and Description |
|---|
OwnerService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.xcs.domain.entities.Owner |
create(es.uvigo.esei.xcs.domain.entities.Owner owner)
Creates a new owner.
|
List<es.uvigo.esei.xcs.domain.entities.Owner> |
findByPetName(String petName)
Returns the list of owners that have a pet with the specified name.
|
es.uvigo.esei.xcs.domain.entities.Owner |
get(String login)
Returns the owner identified by
login. |
List<es.uvigo.esei.xcs.domain.entities.Pet> |
getPets(String login)
Returns the list of pets of an owner.
|
List<es.uvigo.esei.xcs.domain.entities.Owner> |
list()
Returns the complete list of owners.
|
void |
remove(String login)
Deletes an owner.
|
es.uvigo.esei.xcs.domain.entities.Owner |
update(es.uvigo.esei.xcs.domain.entities.Owner owner)
Updates a new owner.
|
public es.uvigo.esei.xcs.domain.entities.Owner get(String login)
login. If there is no owner with
the specified login, null will be returned.login - the login of an owner.null if there is no
owner with the specified login.IllegalArgumentException - if login is null or it
does not identifies a valid owner.public List<es.uvigo.esei.xcs.domain.entities.Owner> list()
public List<es.uvigo.esei.xcs.domain.entities.Owner> findByPetName(String petName)
petName - a pet's name.IllegalArgumentException - if petName is null.public es.uvigo.esei.xcs.domain.entities.Owner create(es.uvigo.esei.xcs.domain.entities.Owner owner)
owner - a new owner to be stored.IllegalArgumentException - if owner is null.javax.persistence.EntityExistsException - if an owner with the same login already
exists.public es.uvigo.esei.xcs.domain.entities.Owner update(es.uvigo.esei.xcs.domain.entities.Owner owner)
owner - an owner to be updated.IllegalArgumentException - if owner is null.public void remove(String login)
login - the login of the owner to be deleted.IllegalArgumentException - if login is null or if
it does not identifies a valid owner.public List<es.uvigo.esei.xcs.domain.entities.Pet> getPets(String login)
login - the login of the owner that owns the pets.IllegalArgumentException - if login is null or it
does not identifies a valid owner.Copyright © 2015. All rights reserved.