java.lang.Object
net.i2p.router.peermanager.PeerSelectionCriteria
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 TypeFieldDescriptionprivate intMost peers the caller will take.private intFewest peers the caller can accept.private intWhat the peers are for, from the constants above.static final intThe peers will be used for a test message.Constructor Summary
ConstructorsConstructorDescriptionLeaves 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 MethodsModifier and TypeMethodDescriptionintMaximum number of peers required.intMinimum number of peers required.intPurpose for which the peers will be used.voidsetMaximumRequired(int max) The maximum number of peers required.voidsetMinimumRequired(int min) The minimum number of peers required.voidsetPurpose(int purpose) The purpose for which the peers will be used.
Field Details
PURPOSE_TEST
public static final int PURPOSE_TESTThe peers will be used for a test message.- See Also:
_minReq
private int _minReqFewest peers the caller can accept._maxReq
private int _maxReqMost peers the caller will take._purpose
private int _purposeWhat 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_TESTconstant 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