Package org.openhab.core.ephemeris
Interface EphemerisManager
@NonNullByDefault
public interface EphemerisManager
This service provides functionality around days of the year and is the central
service to be used directly by others.
- Author:
- Gaƫl L'hopital - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable String
Get given day name from given userfile@Nullable String
getBankHolidayName
(ZonedDateTime date, String filename) Get given day name from given userfile@Nullable String
getBankHolidayName
(ZonedDateTime date, URL resource) Get given day name from given userfilelong
getDaysUntil
(ZonedDateTime from, String searchedHoliday) Gets the number of days until searchedHolidaylong
getDaysUntil
(ZonedDateTime from, String searchedHoliday, String filename) Gets the number of days until searchedHoliday in user filelong
getDaysUntil
(ZonedDateTime from, String searchedHoliday, URL resource) Gets the number of days until searchedHoliday in user file@Nullable String
getHolidayDescription
(@Nullable String holiday) Gets the localized holiday description@Nullable String
getNextBankHoliday
(ZonedDateTime startDate) Gets the first next to come holiday in a 1 year time window@Nullable String
getNextBankHoliday
(ZonedDateTime startDate, String filename) Gets the first next to come holiday in a 1 year time window@Nullable String
getNextBankHoliday
(ZonedDateTime startDate, URL resource) Gets the first next to come holiday in a 1 year time windowboolean
isBankHoliday
(ZonedDateTime date) Tests given day statusboolean
isBankHoliday
(ZonedDateTime date, String filename) Tests given day status against given userfileboolean
isBankHoliday
(ZonedDateTime date, URL resource) Tests given day status against given userfileboolean
isInDayset
(String daysetName, ZonedDateTime date) Tests given day status against configured daysetboolean
isWeekend
(ZonedDateTime date) Tests given day status against configured weekend days
-
Method Details
-
isWeekend
Tests given day status against configured weekend days- Parameters:
date
- observed day- Returns:
- whether the day is on weekend
-
isInDayset
Tests given day status against configured dayset- Parameters:
daysetName
- name of the requested dayset, without prefixdate
- observed day- Returns:
- whether the day is in the dayset
-
isBankHoliday
Tests given day status- Parameters:
date
- observed day- Returns:
- whether the day is bank holiday or not
-
isBankHoliday
Tests given day status against given userfile- Parameters:
date
- observed dayresource
- bundle resource file containing holiday definitions- Returns:
- whether the day is bank holiday or not
-
isBankHoliday
Tests given day status against given userfile- Parameters:
date
- observed dayfilename
- absolute or relative path to the file on local file system- Returns:
- whether the day is bank holiday or not
- Throws:
FileNotFoundException
-
getBankHolidayName
Get given day name from given userfile- Parameters:
date
- observed day- Returns:
- name of the day or null if no corresponding entry
-
getBankHolidayName
Get given day name from given userfile- Parameters:
date
- observed dayresource
- bundle resource file containing holiday definitions- Returns:
- name of the day or null if no corresponding entry
-
getBankHolidayName
@Nullable String getBankHolidayName(ZonedDateTime date, String filename) throws FileNotFoundException Get given day name from given userfile- Parameters:
date
- observed dayfilename
- absolute or relative path to the file on local file system- Returns:
- name of the day or null if no corresponding entry
- Throws:
FileNotFoundException
-
getNextBankHoliday
Gets the first next to come holiday in a 1 year time window- Parameters:
startDate
- first day of the time window- Returns:
- next coming holiday
-
getNextBankHoliday
Gets the first next to come holiday in a 1 year time window- Parameters:
startDate
- first day of the time windowresource
- bundle resource file containing holiday definitions- Returns:
- next coming holiday
-
getNextBankHoliday
@Nullable String getNextBankHoliday(ZonedDateTime startDate, String filename) throws FileNotFoundException Gets the first next to come holiday in a 1 year time window- Parameters:
startDate
- first day of the time windowfilename
- absolute or relative path to the file on local file system- Returns:
- next coming holiday
- Throws:
FileNotFoundException
-
getHolidayDescription
Gets the localized holiday description- Parameters:
holiday
- code of searched holiday- Returns:
- localized holiday description
-
getDaysUntil
Gets the number of days until searchedHoliday- Parameters:
from
- first day of the time windowsearchedHoliday
- name of the searched holiday- Returns:
- difference in days, -1 if not found
-
getDaysUntil
Gets the number of days until searchedHoliday in user file- Parameters:
from
- first day of the time windowsearchedHoliday
- name of the searched holidayresource
- bundle resource file containing holiday definitions- Returns:
- difference in days, -1 if not found
-
getDaysUntil
long getDaysUntil(ZonedDateTime from, String searchedHoliday, String filename) throws FileNotFoundException Gets the number of days until searchedHoliday in user file- Parameters:
from
- first day of the time windowsearchedHoliday
- name of the searched holidayfilename
- absolute or relative path to the file on local file system- Returns:
- difference in days, -1 if not found
- Throws:
FileNotFoundException
-