Class TimeFrame

java.lang.Object
org.netxms.client.events.TimeFrame

public class TimeFrame extends Object
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 Details

    • DAYS_OF_THE_WEEK

      public static final String[] DAYS_OF_THE_WEEK
    • MONTHS

      public static final String[] MONTHS
  • Constructor Details

    • TimeFrame

      public TimeFrame()
      Default constructor
    • TimeFrame

      public TimeFrame(int time, long date)
      Constructor
      Parameters:
      time - time form server
      date - date from server
    • TimeFrame

      public TimeFrame(TimeFrame src)
      Copy constructor
      Parameters:
      src - source object
  • Method Details

    • getFormattedDateString

      public String getFormattedDateString(DateFormat dfTime, Locale locale)
      Format time frame to human readable
      Parameters:
      dfTime - time format
      locale - loacale to use
      Returns:
      formatted and translated time frame string
    • fillMessage

      public void fillMessage(NXCPMessage msg, long baseId)
      Fill NXCP message
      Parameters:
      msg - NXCP message
      baseId - 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

      public String 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 hour
      startMinute - start minute
      endHour - end hour
      endMinute - end minute
      daysOfWeek - selected days of week
      daysOfMonth - selected days of month
      months - 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