java.lang.Object
net.i2p.i2ptunnel.access.FilterDefinitionElement
Direct Known Subclasses:
ExplicitFilterDefinitionElement, FileFilterDefinitionElement

abstract class FilterDefinitionElementextends Object
Base class for filter definition elements.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final Threshold
    The access threshold this element's destinations are subject to.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an element that applies a single threshold to the destinations it names.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static Hash
    Utility method to create a Hash object from a .b32 string.
    (package private) Threshold
    The access limit applied to the destinations this element names.
    (package private) abstract void
    Updates the provided map with the hash(es) of remote destinations mentioned in this element.

    Methods inherited from class Object

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

    • threshold

      protected final Threshold threshold
      The access threshold this element's destinations are subject to.
  • Constructor Details

    • FilterDefinitionElement

      FilterDefinitionElement(Threshold threshold)
      Create an element that applies a single threshold to the destinations it names.
      Parameters:
      threshold - the access limit enforced against the destinations this element names
  • Method Details

    • update

      abstract void update(Map<Hash, DestTracker> map) throws IOException
      Updates the provided map with the hash(es) of remote destinations mentioned in this element.
      Parameters:
      map - the destination-to-tracker map the discovered hashes are added to
      Throws:
      IOException - if the destinations this element names cannot be read, as when a file-backed element cannot be opened
    • getThreshold

      Threshold getThreshold()
      The access limit applied to the destinations this element names.
      Returns:
      the connection count and window both are enforced over
    • fromBase32

      protected static Hash fromBase32(String b32) throws InvalidDefinitionException
      Utility method to create a Hash object from a .b32 string.
      Parameters:
      b32 - the 60 character ".b32.i2p" address to decode
      Returns:
      the destination hash the address names
      Throws:
      InvalidDefinitionException - if the string is not a well formed .b32.i2p address, or its base 32 payload does not decode