Class IntervalControlHelper.IntervalRule

java.lang.Object
org.codelibs.fess.helper.IntervalControlHelper.IntervalRule
Enclosing class:
IntervalControlHelper

public static class IntervalControlHelper.IntervalRule extends Object
Represents a rule for controlling crawler intervals. Each rule defines a time range, applicable days, and delay amount.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int[]
    Array of days when this rule applies (1=Sunday, 7=Saturday)
    protected long
    Delay in milliseconds to apply during this interval
    protected int
    Starting hour of the interval
    protected int
    Starting minute of the interval
    protected boolean
    Flag indicating if the interval spans across midnight
    protected int
    Ending hour of the interval
    protected int
    Ending minute of the interval
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntervalRule(String from, String to, String days, long delay)
    Creates a new interval rule.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    compareTime(int h1, int m1, int h2, int m2)
    Compares two times.
    long
    Gets the delay amount for this rule.
    boolean
    isTarget(int hours, int minutes, int day)
    Checks if this rule applies to the given time and day.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • fromHours

      protected int fromHours
      Starting hour of the interval
    • fromMinutes

      protected int fromMinutes
      Starting minute of the interval
    • toHours

      protected int toHours
      Ending hour of the interval
    • toMinutes

      protected int toMinutes
      Ending minute of the interval
    • delay

      protected long delay
      Delay in milliseconds to apply during this interval
    • days

      protected int[] days
      Array of days when this rule applies (1=Sunday, 7=Saturday)
    • reverse

      protected boolean reverse
      Flag indicating if the interval spans across midnight
  • Constructor Details

    • IntervalRule

      public IntervalRule(String from, String to, String days, long delay)
      Creates a new interval rule.
      Parameters:
      from - the start time in HH:MM format
      to - the end time in HH:MM format
      days - comma-separated list of days (1=Sunday, 7=Saturday)
      delay - the delay in milliseconds to apply during this interval
  • Method Details

    • getDelay

      public long getDelay()
      Gets the delay amount for this rule.
      Returns:
      the delay in milliseconds
    • isTarget

      public boolean isTarget(int hours, int minutes, int day)
      Checks if this rule applies to the given time and day.
      Parameters:
      hours - the hour of the day (0-23)
      minutes - the minute of the hour (0-59)
      day - the day of the week (1=Sunday, 7=Saturday)
      Returns:
      true if this rule applies, false otherwise
    • compareTime

      protected int compareTime(int h1, int m1, int h2, int m2)
      Compares two times.
      Parameters:
      h1 - the first hour
      m1 - the first minute
      h2 - the second hour
      m2 - the second minute
      Returns:
      positive if first time is earlier, 0 if equal, negative if later