public class UserService extends Object
| Constructor and Description |
|---|
UserService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.teama.microstories.domain.entities.Author |
createAuthor(es.uvigo.esei.dgss.teama.microstories.domain.entities.Author author)
Creates a new author.
|
es.uvigo.esei.dgss.teama.microstories.domain.entities.Story |
createStory(es.uvigo.esei.dgss.teama.microstories.domain.entities.Story story)
Creates a new story.
|
List<es.uvigo.esei.dgss.teama.microstories.domain.entities.Story> |
findStoriesByAuthor(String login)
Returns a list of microstories of an author.
|
List<es.uvigo.esei.dgss.teama.microstories.domain.entities.Story> |
findStoriesByAuthor(String login,
int page,
int limit)
Returns a paginated list of microstories of an author.
|
es.uvigo.esei.dgss.teama.microstories.domain.entities.Story |
findStoryById(int id)
Returns the story identified by
id. |
es.uvigo.esei.dgss.teama.microstories.domain.entities.Story |
updateStory(es.uvigo.esei.dgss.teama.microstories.domain.entities.Story story)
Updates a new story.
|
@RolesAllowed(value="AUTHOR") @Produces(value="application/json") public List<es.uvigo.esei.dgss.teama.microstories.domain.entities.Story> findStoriesByAuthor(String login)
login - the author login.@RolesAllowed(value="AUTHOR") @Produces(value="application/json") public List<es.uvigo.esei.dgss.teama.microstories.domain.entities.Story> findStoriesByAuthor(String login, int page, int limit)
login - the author loginpage - the page number. If it is less than 0 it returns the first page.limit - the number of stories contained in a page. If it is less than 0 or greater than 100, it
returns at most 100 stories.@PermitAll @Produces(value="application/json") public es.uvigo.esei.dgss.teama.microstories.domain.entities.Author createAuthor(es.uvigo.esei.dgss.teama.microstories.domain.entities.Author author)
author - a new author to be stored.IllegalArgumentException - if author is null.javax.persistence.EntityExistsException - if an author with the same login already exists.@RolesAllowed(value="AUTHOR") @Produces(value="application/json") public es.uvigo.esei.dgss.teama.microstories.domain.entities.Story createStory(es.uvigo.esei.dgss.teama.microstories.domain.entities.Story story)
story - a new story to be stored.IllegalArgumentException - if author is null.javax.ejb.EJBAccessException - if the story's author is not the current user.@RolesAllowed(value="AUTHOR") @Produces(value="application/json") public es.uvigo.esei.dgss.teama.microstories.domain.entities.Story updateStory(es.uvigo.esei.dgss.teama.microstories.domain.entities.Story story)
story - an story to be updated.IllegalArgumentException - if story is null.javax.ejb.EJBAccessException - if the story's author is not the current user.@RolesAllowed(value="AUTHOR") @Produces(value="application/json") public es.uvigo.esei.dgss.teama.microstories.domain.entities.Story findStoryById(int id)
id.id - the id of a story.null if there is no
story with the specified id.IllegalArgumentException - if a story with the specified identifier do not exists.javax.ejb.EJBAccessException - if the story's author is not the current user.Copyright © 2018. All rights reserved.