java.lang.Object
net.i2p.router.peermanager.PeerSelectionCriteria

class PeerSelectionCriteriaextends Object
Defines the criteria for selecting a set of peers for use when searching the PeerManager.

Only used by PeerTestJob (PURPOSE_TEST).

  • Field Summary

    Modifier and Type
    Field
    Description
    private int
    Most peers the caller will take.
    private int
    Fewest peers the caller can accept.
    private int
    What the peers are for, from the constants above.
    static final int
    The peers will be used for a test message.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Leaves the minimum, the maximum and the purpose at 0, which matches no peer set; the setters below must fill them in before the criteria are used.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    int
    Maximum number of peers required.
    int
    Minimum number of peers required.
    int
    Purpose for which the peers will be used.
    void
    The maximum number of peers required.
    void
    The minimum number of peers required.
    void
    setPurpose(int purpose)
    The purpose for which the peers will be used.

    Methods inherited from class Object

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

    • PURPOSE_TEST

      public static final int PURPOSE_TEST
      The peers will be used for a test message.
      See Also:
    • _minReq

      private int _minReq
      Fewest peers the caller can accept.
    • _maxReq

      private int _maxReq
      Most peers the caller will take.
    • _purpose

      private int _purpose
      What the peers are for, from the constants above.
  • Constructor Details

    • PeerSelectionCriteria

      PeerSelectionCriteria()
      Leaves the minimum, the maximum and the purpose at 0, which matches no peer set; the setters below must fill them in before the criteria are used.
  • Method Details

    • getMinimumRequired

      public int getMinimumRequired()
      Minimum number of peers required.
      Returns:
      the minimum number of peers
    • setMinimumRequired

      public void setMinimumRequired(int min)
      The minimum number of peers required.
      Parameters:
      min - the minimum number of peers
    • getMaximumRequired

      public int getMaximumRequired()
      Maximum number of peers required.
      Returns:
      the maximum number of peers
    • setMaximumRequired

      public void setMaximumRequired(int max)
      The maximum number of peers required.
      Parameters:
      max - the maximum number of peers
    • getPurpose

      public int getPurpose()
      Purpose for which the peers will be used.
      Returns:
      a PURPOSE_TEST constant naming why the selected peers will be used, or 0 if no purpose has been set
    • setPurpose

      public void setPurpose(int purpose)
      The purpose for which the peers will be used.
      Parameters:
      purpose - a PURPOSE_ constant, naming why the peers will be used