public class CalendarServiceImpl extends java.lang.Object implements CalendarService
Modifier and Type | Class and Description |
---|---|
static class |
CalendarServiceImpl.TimeInterval |
static class |
CalendarServiceImpl.TimeIntervals |
Constructor and Description |
---|
CalendarServiceImpl(CacheManager cacheManager,
EngineManager engineManager) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.time.ZonedDateTime> |
getCloseTime(long exchangeId)
Gets the time the exchange closes on the current date or Optional.EMPTY if the exchange is closed on the current date
|
java.util.Optional<java.time.ZonedDateTime> |
getCloseTime(long exchangeId,
java.time.LocalDate date)
Gets the time the exchange closes on a particular date or Optional.EMPTY if the exchange is closed on that day
|
java.time.LocalDate |
getCurrentTradingDate(long exchangeId)
Gets the current trading date of the specified exchange.
|
java.time.LocalDate |
getCurrentTradingDate(long exchangeId,
java.time.ZonedDateTime dateTime)
Gets the current trading date of the specified exchange.
|
java.time.ZonedDateTime |
getNextCloseTime(long exchangeId)
Gets the time the exchange closes the next time after the current dateTime
|
java.time.ZonedDateTime |
getNextCloseTime(long exchangeId,
java.time.ZonedDateTime dateTime)
Gets the time the exchange closes the next time after the specified dateTime
|
java.time.ZonedDateTime |
getNextOpenTime(long exchangeId)
Gets the time the exchange opens the next time after the current dateTime
|
java.time.ZonedDateTime |
getNextOpenTime(long exchangeId,
java.time.ZonedDateTime dateTime)
Gets the time the exchange opens the next time after the specified dateTime
|
java.util.Optional<java.time.ZonedDateTime> |
getOpenTime(long exchangeId)
Gets the time the exchange opens on the current date or Optional.EMPTY if the exchange is closed on the current date
|
java.util.Optional<java.time.ZonedDateTime> |
getOpenTime(long exchangeId,
java.time.LocalDate date)
Gets the time the exchange opens on a particular date or Optional.EMPTY if the exchange is closed on that day
|
boolean |
isOpen(long exchangeId)
Returns true, if the exchange is open at the current dateTime, taking into consideration the different
trading hours as well as holidays, early opens and early closes
|
boolean |
isOpen(long exchangeId,
java.time.ZonedDateTime dateTime)
Returns true, if the exchange is currently open at the specified dateTime, taking into consideration the different
trading hours as well as holidays, early opens and early closes
|
boolean |
isTradingDay(long exchangeId)
Returns true if the exchange is open on the current date
|
boolean |
isTradingDay(long exchangeId,
java.time.LocalDate date)
Returns true if the exchange is open on the specified date
|
public CalendarServiceImpl(CacheManager cacheManager, EngineManager engineManager)
public java.time.LocalDate getCurrentTradingDate(long exchangeId, java.time.ZonedDateTime dateTime)
getCurrentTradingDate
in interface CalendarService
public java.time.LocalDate getCurrentTradingDate(long exchangeId)
CalendarService
getCurrentTradingDate
in interface CalendarService
public boolean isOpen(long exchangeId, java.time.ZonedDateTime dateTime)
isOpen
in interface CalendarService
public boolean isOpen(long exchangeId)
CalendarService
isOpen
in interface CalendarService
public boolean isTradingDay(long exchangeId, java.time.LocalDate date)
isTradingDay
in interface CalendarService
public boolean isTradingDay(long exchangeId)
CalendarService
isTradingDay
in interface CalendarService
public java.util.Optional<java.time.ZonedDateTime> getOpenTime(long exchangeId, java.time.LocalDate date)
getOpenTime
in interface CalendarService
public java.util.Optional<java.time.ZonedDateTime> getOpenTime(long exchangeId)
CalendarService
getOpenTime
in interface CalendarService
public java.util.Optional<java.time.ZonedDateTime> getCloseTime(long exchangeId, java.time.LocalDate date)
getCloseTime
in interface CalendarService
public java.util.Optional<java.time.ZonedDateTime> getCloseTime(long exchangeId)
CalendarService
getCloseTime
in interface CalendarService
public java.time.ZonedDateTime getNextOpenTime(long exchangeId, java.time.ZonedDateTime dateTime)
CalendarService
getNextOpenTime
in interface CalendarService
public java.time.ZonedDateTime getNextOpenTime(long exchangeId)
CalendarService
getNextOpenTime
in interface CalendarService
public java.time.ZonedDateTime getNextCloseTime(long exchangeId, java.time.ZonedDateTime dateTime)
CalendarService
getNextCloseTime
in interface CalendarService
public java.time.ZonedDateTime getNextCloseTime(long exchangeId)
CalendarService
getNextCloseTime
in interface CalendarService