Class NewsServiceDefault

java.lang.Object
org.spincast.website.services.NewsServiceDefault
All Implemented Interfaces:
NewsService

public class NewsServiceDefault extends Object implements NewsService
Spincast news service implementation.
  • Constructor Details

    • NewsServiceDefault

      @Inject public NewsServiceDefault(NewsRepository newsRepository, org.spincast.website.AppConfig appConfig)
      Constructor
  • Method Details

    • getNewsRepository

      protected NewsRepository getNewsRepository()
    • getAppConfig

      protected org.spincast.website.AppConfig getAppConfig()
    • getNewsEntries

      public List<NewsEntry> getNewsEntries(boolean ascOrder)
      Description copied from interface: NewsService
      Gets all the news entries.
      Specified by:
      getNewsEntries in interface NewsService
      Parameters:
      ascOrder - If true, returns the entries by their publication date in ascending order. Otherwise, in descending order.
    • getNewsEntries

      public NewsEntriesAndTotalNbr getNewsEntries(int startPos, int endPos, boolean ascOrder)
      Description copied from interface: NewsService
      Gets news entries.
      Specified by:
      getNewsEntries in interface NewsService
      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 - If true, 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

      public NewsEntry getNewsEntry(long newsId)
      Description copied from interface: NewsService
      Gets a specific news entry.
      Specified by:
      getNewsEntry in interface NewsService
      Returns:
      the news entry or null if not found.
    • getFeedNewsEntries

      public List<NewsEntry> getFeedNewsEntries()
      Description copied from interface: NewsService
      Gets the news entries for the RSS feed.
      Specified by:
      getFeedNewsEntries in interface NewsService