Class DecoratorDbReader<T extends DecoratorInformation>
- java.lang.Object
-
- technology.dice.dicewhere.decorator.DecoratorDbReader<T>
-
- Direct Known Subclasses:
MaxmindVpnDecoratorDbReader
public abstract class DecoratorDbReader<T extends DecoratorInformation> extends Object
Reads one line at a time from the provided DB. Only hold one line in memory and stop reading when an IP is reached, that is outside of the requested oneT lastFetched holds the last line that was read from the DB The reader will keep reading until it reaches the end of the file or the end of the requested ip range;
-
-
Constructor Summary
Constructors Constructor Description DecoratorDbReader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<T>fetchForRange(IP rangeBoundStart, IP rangeBoundEnd)protected Optional<T>getLastFetched()protected abstract Optional<T>parseDbLine(String line)protected abstract Optional<T>readNextLine()protected voidsetLastFetched(T lastFetched)The last successfully parsed line read from the provided decorating DB
-
-
-
Method Detail
-
setLastFetched
protected void setLastFetched(T lastFetched)
The last successfully parsed line read from the provided decorating DB- Parameters:
lastFetched- set the last fetched line to the passed argument
-
-