java.lang.Object
net.i2p.i2ptunnel.access.FilterDefinition

class FilterDefinitionextends Object
Access filter definition.

POJO containing parsed representation from filter definition file.

  • Field Details

    • defaultThreshold

      private final Threshold defaultThreshold
      Limit applied when an element names none.
    • elements

      private final FilterDefinitionElement[] elements
      The rules of this definition.
    • recorders

      private final Recorder[] recorders
      Counters kept for the definition.
    • purgeSeconds

      private final int purgeSeconds
      How long a record is kept, in seconds.
  • Constructor Details

    • FilterDefinition

      FilterDefinition(Threshold defaultThreshold, FilterDefinitionElement[] elements, Recorder[] recorders)
      Create a definition and derive the purge interval from the longest threshold window among the default, the elements and the recorders.
      Parameters:
      defaultThreshold - threshold to apply to unknown remote destinations
      elements - the elements defined in the filter definition, if any
      recorders - the recorders defined in the filter definition, if any
  • Method Details

    • getDefaultThreshold

      Threshold getDefaultThreshold()
      The threshold applied to a destination matched by no element.
      Returns:
      the default threshold
    • getElements

      FilterDefinitionElement[] getElements()
      The per-destination thresholds parsed from the definition file.
      Returns:
      the array as parsed, not a copy
    • getRecorders

      Recorder[] getRecorders()
      The loggers invoked when a destination's threshold is reached.
      Returns:
      the recorder array as parsed, not a copy
    • getPurgeSeconds

      int getPurgeSeconds()
      How often to purge access records, in seconds; the widest threshold window in the definition.
      Returns:
      the purge seconds