java.lang.Object
net.i2p.i2ptunnel.access.FilterDefinitionElement
- Direct Known Subclasses:
ExplicitFilterDefinitionElement, FileFilterDefinitionElement
Base class for filter definition elements.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionFilterDefinitionElement(Threshold threshold) Create an element that applies a single threshold to the destinations it names.Method Summary
Modifier and TypeMethodDescriptionprotected static HashfromBase32(String b32) Utility method to create a Hash object from a .b32 string.(package private) ThresholdThe access limit applied to the destinations this element names.(package private) abstract voidupdate(Map<Hash, DestTracker> map) Updates the provided map with the hash(es) of remote destinations mentioned in this element.
Field Details
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
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
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