Package org.spincast.website.services
Class NewsServiceDefault
java.lang.Object
org.spincast.website.services.NewsServiceDefault
- All Implemented Interfaces:
NewsService
Spincast news service implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionNewsServiceDefault(NewsRepository newsRepository, org.spincast.website.AppConfig appConfig) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected org.spincast.website.AppConfigGets the news entries for the RSS feed.getNewsEntries(boolean ascOrder) Gets all the news entries.getNewsEntries(int startPos, int endPos, boolean ascOrder) Gets news entries.getNewsEntry(long newsId) Gets a specific news entry.protected NewsRepository
-
Constructor Details
-
NewsServiceDefault
@Inject public NewsServiceDefault(NewsRepository newsRepository, org.spincast.website.AppConfig appConfig) Constructor
-
-
Method Details
-
getNewsRepository
-
getAppConfig
protected org.spincast.website.AppConfig getAppConfig() -
getNewsEntries
Description copied from interface:NewsServiceGets all the news entries.- Specified by:
getNewsEntriesin interfaceNewsService- Parameters:
ascOrder- Iftrue, returns the entries by their publication date in ascending order. Otherwise, in descending order.
-
getNewsEntries
Description copied from interface:NewsServiceGets news entries.- Specified by:
getNewsEntriesin interfaceNewsService- Parameters:
startPos- The position of the first entry to return. The first element is "1", not "0".endPos- The position of the last entry to return (inclusive).ascOrder- Iftrue, returns the entries by their publication date in ascending order. Otherwise, in descending order.- Returns:
- the news entries list and the total number of entries in the repository.
-
getNewsEntry
Description copied from interface:NewsServiceGets a specific news entry.- Specified by:
getNewsEntryin interfaceNewsService- Returns:
- the news entry or
nullif not found.
-
getFeedNewsEntries
Description copied from interface:NewsServiceGets the news entries for the RSS feed.- Specified by:
getFeedNewsEntriesin interfaceNewsService
-