Class MarketEventService
java.lang.Object
com.bluebell.greenhouse.radicle.services.market.event.MarketEventService
Service-layer for
MarketEvent entities.- Version:
- 3.0.6
- Author:
- Stephen Prizio
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanPulls in market event data from Forex Factory.findMarketEventByDateTimeAndContentAndCountry(LocalDateTime dateTime, String content, Country country, ZoneId zone) Obtains aMarketEventfor the given date time and content.findMarketEventsForDay(LocalDate date, ZoneId zone) Returns anOptionalMarketEventfor the given date.findMarketEventsWithinInterval(LocalDate start, LocalDate end, ZoneId zone, String... locales) Returns aListofMarketEventwithin the given start & end dates.intsaveAll(List<MarketEvent> marketEvents) Saves all market events to the database.
-
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 aListofMarketEventwithin the given start & end dates.- Parameters:
start-LocalDatestartend-LocalDateendzone-ZoneIdlocales- locales / currencies- Returns:
ListofMarketEvent
-
findMarketEventsForDay
Returns anOptionalMarketEventfor the given date.- Parameters:
date-LocalDatezone-ZoneId- Returns:
OptionalMarketEvent
-
findMarketEventByDateTimeAndContentAndCountry
public Optional<MarketEvent> findMarketEventByDateTimeAndContentAndCountry(LocalDateTime dateTime, String content, Country country, ZoneId zone) Obtains aMarketEventfor the given date time and content.- Parameters:
dateTime-LocalDateTimecontent- contentcountry-Countryzone-ZoneId- Returns:
OptionalMarketEvent
-
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-ListofMarketEvent- Returns:
- count of insertion/updates
-