Class MarketEventService

java.lang.Object
com.bluebell.greenhouse.radicle.services.market.event.MarketEventService

@Service @Transactional(readOnly=true) public class MarketEventService extends Object
Service-layer for MarketEvent entities.
Version:
3.0.6
Author:
Stephen Prizio
  • Constructor Details

    • MarketEventService

      public MarketEventService()
  • Method Details

    • findMarketEventsWithinInterval

      @Cacheable(cacheNames="marketEvents", key="T(com.bluebell.greenhouse.platform.configuration.cache.market.event.MarketEventCacheKeys).forInterval(#start, #end, #zone, #locales)") public List<MarketEvent> findMarketEventsWithinInterval(LocalDate start, LocalDate end, ZoneId zone, String... locales)
      Returns a List of MarketEvent within the given start & end dates.
      Parameters:
      start - LocalDate start
      end - LocalDate end
      zone - ZoneId
      locales - locales / currencies
      Returns:
      List of MarketEvent
    • findMarketEventsForDay

      public List<MarketEvent> findMarketEventsForDay(LocalDate date, ZoneId zone)
      Returns an Optional MarketEvent for the given date.
      Parameters:
      date - LocalDate
      zone - ZoneId
      Returns:
      Optional MarketEvent
    • findMarketEventByDateTimeAndContentAndCountry

      public Optional<MarketEvent> findMarketEventByDateTimeAndContentAndCountry(LocalDateTime dateTime, String content, Country country, ZoneId zone)
      Obtains a MarketEvent for the given date time and content.
      Parameters:
      dateTime - LocalDateTime
      content - content
      country - Country
      zone - ZoneId
      Returns:
      Optional MarketEvent
    • fetchMarketEvents

      @Transactional @CacheEvict(cacheNames="marketEvents", allEntries=true) public boolean fetchMarketEvents()
      Pulls in market event data from Forex Factory.
      Returns:
      true if no errors occurred
    • saveAll

      @Transactional @CacheEvict(cacheNames="marketEvents", allEntries=true) public int saveAll(List<MarketEvent> marketEvents)
      Saves all market events to the database.
      Parameters:
      marketEvents - List of MarketEvent
      Returns:
      count of insertion/updates