Package org.netxms.client.events
Class TimeFrame
java.lang.Object
org.netxms.client.events.TimeFrame
Time frame configuration
Server format: time has format: startHours startMinutes endHours endMinutes dddddddd in int BCD format
date has format: 12 bits of months form December to January, 7 bits of week days form Sunday to Monday, 31 dates of month + last
bit is last day of month
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fillMessage
(NXCPMessage msg, long baseId) Fill NXCP messagelong
boolean[]
int
int
getFormattedDateString
(DateFormat dfTime, Locale locale) Format time frame to human readableboolean[]
int
int
boolean
isAnyDay()
Check if any date filter is selectedboolean
Check if any time filter is selectedboolean
isNever()
Check if this schedule will never be executedvoid
update
(int startHour, int startMinute, int endHour, int endMinute, boolean[] daysOfWeek, String daysOfMonth, boolean[] months) Update time frame with new data
-
Field Details
-
DAYS_OF_THE_WEEK
-
MONTHS
-
-
Constructor Details
-
TimeFrame
public TimeFrame()Default constructor -
TimeFrame
public TimeFrame(int time, long date) Constructor- Parameters:
time
- time form serverdate
- date from server
-
TimeFrame
Copy constructor- Parameters:
src
- source object
-
-
Method Details
-
getFormattedDateString
Format time frame to human readable- Parameters:
dfTime
- time formatlocale
- loacale to use- Returns:
- formatted and translated time frame string
-
fillMessage
Fill NXCP message- Parameters:
msg
- NXCP messagebaseId
- base field ID
-
getStartMinute
public int getStartMinute()- Returns:
- the startMinute
-
getStartHour
public int getStartHour()- Returns:
- the startHour
-
getEndMinute
public int getEndMinute()- Returns:
- the endMinute
-
getEndHour
public int getEndHour()- Returns:
- the endHour
-
getDaysOfMonth
- Returns:
- the daysOfMonth
-
getDaysOfWeek
public boolean[] getDaysOfWeek()- Returns:
- the daysOfWeek
-
getMonths
public boolean[] getMonths()- Returns:
- the months
-
getDaysConfiguration
public long getDaysConfiguration()- Returns:
- the daysConfiguration
-
update
public void update(int startHour, int startMinute, int endHour, int endMinute, boolean[] daysOfWeek, String daysOfMonth, boolean[] months) throws TimeFrameFormatException Update time frame with new data- Parameters:
startHour
- start hourstartMinute
- start minuteendHour
- end hourendMinute
- end minutedaysOfWeek
- selected days of weekdaysOfMonth
- selected days of monthmonths
- selected months- Throws:
TimeFrameFormatException
- exception in case of parsing error
-
isAnyDay
public boolean isAnyDay()Check if any date filter is selected- Returns:
- true if any date pass thought filter
-
isAnyTime
public boolean isAnyTime()Check if any time filter is selected- Returns:
- true if any time pass thought filter
-
isNever
public boolean isNever()Check if this schedule will never be executed- Returns:
- true if this filter is equal to never execute
-