java.lang.Object
net.i2p.i2ptunnel.access.FilterDefinition
Access filter definition.
POJO containing parsed representation from filter definition file.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ThresholdLimit applied when an element names none.private final FilterDefinitionElement[]The rules of this definition.private final intHow long a record is kept, in seconds.private final Recorder[]Counters kept for the definition.Constructor Summary
ConstructorsConstructorDescriptionFilterDefinition(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.Method Summary
All MethodsModifier and TypeMethodDescription(package private) ThresholdThe threshold applied to a destination matched by no element.(package private) FilterDefinitionElement[]The per-destination thresholds parsed from the definition file.(package private) intHow often to purge access records, in seconds; the widest threshold window in the definition.(package private) Recorder[]The loggers invoked when a destination's threshold is reached.
Field Details
defaultThreshold
Limit applied when an element names none.elements
The rules of this definition.recorders
Counters kept for the definition.purgeSeconds
private final int purgeSecondsHow 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 destinationselements- the elements defined in the filter definition, if anyrecorders- 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