@PermitAll public class StoryService extends Object
| Constructor and Description |
|---|
StoryService() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.microstories.domain.Story |
findStoryById(int id)
Returns a story identified by his id.
|
es.uvigo.esei.dgss.microstories.domain.User |
get(String login)
Returns the user identified by
login. |
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getAllMyStories(es.uvigo.esei.dgss.microstories.domain.User user) |
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getMyStories(es.uvigo.esei.dgss.microstories.domain.User user,
int currentPageNumber,
int pageSize) |
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getRecentStories()
Returns the recent stories, the last 6 stories.
|
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getStoriesByText(String text,
int pageNumber,
int pageSize)
Returns the stories that contains the text on the title or text with pagination
|
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getStoriesByUser(int pageNumber,
int pageSize)
Returns the stories about user logged with pagination
|
List<es.uvigo.esei.dgss.microstories.domain.Story> |
getStoriesToExplore(String genre,
String theme,
Date date,
int pageNumber,
int pageSize)
Returns the stories that indicates the explorer filters with pagination
|
long |
getTotalSearchRows(String genre,
String theme,
Date date)
Returns the number stories that indicates the explorer filters
|
long |
totalSearchRows(String word)
Returns the total of rows in a search
|
es.uvigo.esei.dgss.microstories.domain.User |
validateUser(String login,
String password)
Validates if a user exist
|
public es.uvigo.esei.dgss.microstories.domain.User get(String login)
login. If there is no user with
the specified login, null will be returned.login - the login of a user.null if there is no
user with the specified login.IllegalArgumentException - if login is null or it
does not identifies a valid user.public List<es.uvigo.esei.dgss.microstories.domain.Story> getRecentStories()
public List<es.uvigo.esei.dgss.microstories.domain.Story> getStoriesByText(String text, int pageNumber, int pageSize)
text - the text that filters the storiespublic es.uvigo.esei.dgss.microstories.domain.Story findStoryById(int id)
id - the identifier of a Story.null if no
story exists with the provided identifier.public long totalSearchRows(String word)
word - The word to searchpublic List<es.uvigo.esei.dgss.microstories.domain.Story> getStoriesToExplore(String genre, String theme, Date date, int pageNumber, int pageSize)
genre - the genre of the stories listtheme - the theme of the stories listdate - the date of publication of the stories listpublic long getTotalSearchRows(String genre, String theme, Date date)
genre - the genre of the stories listtheme - the theme of the stories listdate - the date of publication of the stories listpublic List<es.uvigo.esei.dgss.microstories.domain.Story> getStoriesByUser(int pageNumber, int pageSize)
public es.uvigo.esei.dgss.microstories.domain.User validateUser(String login, String password)
login - password - public List<es.uvigo.esei.dgss.microstories.domain.Story> getMyStories(es.uvigo.esei.dgss.microstories.domain.User user, int currentPageNumber, int pageSize)
public List<es.uvigo.esei.dgss.microstories.domain.Story> getAllMyStories(es.uvigo.esei.dgss.microstories.domain.User user)
Copyright © 2020. All rights reserved.