@RolesAllowed(value="OWNER") public class PetService extends Object
| Constructor and Description |
|---|
PetService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.xcs.domain.entities.Pet |
create(es.uvigo.esei.xcs.domain.entities.Pet pet)
Creates a new pet owned by the current user.
|
es.uvigo.esei.xcs.domain.entities.Pet |
get(int id)
Returns a pet identified by the provided id.
|
List<es.uvigo.esei.xcs.domain.entities.Pet> |
list()
Returns the complete list of pets of the current owner.
|
void |
remove(int id)
Deletes a pet.
|
es.uvigo.esei.xcs.domain.entities.Pet |
update(es.uvigo.esei.xcs.domain.entities.Pet pet)
Updates the information of a pet.
|
public es.uvigo.esei.xcs.domain.entities.Pet get(int id)
EJBAccessException will be thrown.id - the identified of a pet.null if no
pet exists with the provided identifier.javax.ejb.EJBAccessException - if the current owner does not owns the pet.public List<es.uvigo.esei.xcs.domain.entities.Pet> list()
public es.uvigo.esei.xcs.domain.entities.Pet create(es.uvigo.esei.xcs.domain.entities.Pet pet)
pet - a new pet to be stored.javax.ejb.EJBAccessException - if the pet already has an owner and it is not
the current user. If the pet has no owner, this exception will be never
thrown.IllegalArgumentException - if a pet with the same identifier
already exists.public es.uvigo.esei.xcs.domain.entities.Pet update(es.uvigo.esei.xcs.domain.entities.Pet pet)
pet - a pet to be updated.IllegalArgumentException - if the pet has no owner.javax.ejb.EJBAccessException - if the pet's owner is not the current user.public void remove(int id)
id - the identifier of the pet to be deleted.IllegalArgumentException - if there is no pet with the provided
identifier.javax.ejb.EJBAccessException - if the pet's owner is not the current user.Copyright © 2015. All rights reserved.