@PermitAll public class StoryService extends Object
| Constructor and Description |
|---|
StoryService() |
| Modifier and Type | Method and Description |
|---|---|
Long |
countExploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
Date today,
DateRange dateRange)
Returns the number of stories matching given values for not
null arguments. |
Long |
countExploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
DateRange dateRange)
Returns the number of stories matching given values for not
null arguments. |
List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> |
exploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
Date today,
DateRange dateRange,
int pageSize,
int pageIndex)
Returns a list of stories matching given values for not
null arguments. |
List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> |
exploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre,
es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme,
DateRange dateRange,
int pageSize,
int pageIndex)
Returns the number of stories matching given values for not
null arguments. |
es.uvigo.esei.dgss.teamc.microstories.entities.Story |
get(Long id)
Returns the Story with the given id
|
Long |
getNumberStoriesByText(String text)
Returns the number of stories matching the search text
|
List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> |
getStoriesByText(String text,
int noOfStories,
int pageIndex)
Returns a list of stories filtered by a string
|
List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> |
listHottest()
Returns last month's 2 most read stories of each genre
|
List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> |
listRecent()
Returns the 6 most recent Stories
|
public List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> listRecent()
public es.uvigo.esei.dgss.teamc.microstories.entities.Story get(Long id) throws IllegalArgumentException
id - the id of the Story to returnIllegalArgumentException - if given id is nullpublic List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> getStoriesByText(String text, int noOfStories, int pageIndex) throws IllegalArgumentException
text - search string to filter the listnoOfStories - number of stories to be shown per pagepageIndex - index of page to be shownIllegalArgumentException - if given text is null or the page index is
negative or out of rangepublic Long getNumberStoriesByText(String text)
public List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> exploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre, es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme, Date today, DateRange dateRange, int pageSize, int pageIndex) throws IllegalArgumentException
null arguments.genre - genre to filter the stories by. It's not taken into account if it's nulltheme - theme to filter the stories by. It's not taken into account if it0s nulltoday - date used as today's date in order to calculate the date rangedateRange - range of date to filter the stories. Can't be nullpageSize - number of stories to show per page. Can't be equal to or less than 0pageIndex - index of the page to be returned. Can't be less than 0null argumentsIllegalArgumentException - if:
- dateRange is null
- pageSize is equal to or less than 0
- pageIndex is less than 0 or it refers to a page that is out of rangepublic List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> exploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre, es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme, DateRange dateRange, int pageSize, int pageIndex) throws IllegalArgumentException
null arguments.genre - genre to filter the stories by. It's not taken into account if it's nulltheme - theme to filter the stories by. It's not taken into account if it0s nulldateRange - range of date to filter the stories. Can't be nullpageSize - number of stories to show per page. Can't be equal to or less than 0pageIndex - index of the page to be returned. Can't be less than 0null argumentsIllegalArgumentException - if:
- dateRange is null
- pageSize is equal to or less than 0
- pageIndex is less than 0 or it refers to a page that is out of rangepublic Long countExploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre, es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme, Date today, DateRange dateRange) throws IllegalArgumentException
null arguments.genre - genre to filter the stories by. It's not taken into account if it's nulltheme - theme to filter the stories by. It's not taken into account if it0s nulldateRange - range of date to filter the stories. Can't be nullnull argumentsIllegalArgumentException - if dateRange is nullpublic Long countExploreStories(es.uvigo.esei.dgss.teamc.microstories.entities.Genre genre, es.uvigo.esei.dgss.teamc.microstories.entities.Theme theme, DateRange dateRange) throws IllegalArgumentException
null arguments.genre - genre to filter the stories by. It's not taken into account if it's nulltheme - theme to filter the stories by. It's not taken into account if it0s nulldateRange - range of date to filter the stories. Can't be nullnull argumentsIllegalArgumentException - if dateRange is nullpublic List<es.uvigo.esei.dgss.teamc.microstories.entities.Story> listHottest()
Copyright © 2021. All rights reserved.