public interface SyslogParser
SyslogParser defines an interface for classes that parse Syslog into Map.| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
parseLine(String line)
Parse a
String to a Map. |
void |
parseLine(String line,
java.util.function.Consumer<Map<String,Object>> consumer)
Parse a
String to a Map and provides that Map to the provided Consumer. |
List<Map<String,Object>> |
parseLines(Reader reader)
Reads each line from the
Reader and parses it to a List of Map. |
void |
parseLines(Reader reader,
java.util.function.Consumer<Map<String,Object>> consumer)
Reads each line from the
Reader and parses it to Map, which is passed to the
provided Consumer. |
void |
parseLines(Reader reader,
java.util.function.Consumer<Map<String,Object>> messageConsumer,
java.util.function.BiConsumer<String,Throwable> errorConsumer)
Reads each line from the
Reader and parses it to Map, which is passed to the
provided Consumer. |
Map<String,Object> parseLine(String line)
String to a Map.line - the line of Syslog to parseMapParseException - if there is an error parsingvoid parseLine(String line, java.util.function.Consumer<Map<String,Object>> consumer)
String to a Map and provides that Map to the provided Consumer.line - the line of Syslog to parserconsumer - the ConsumerParseException - if there is an error parsingList<Map<String,Object>> parseLines(Reader reader)
Reader and parses it to a List of Map.reader - Reader used. It is not closed in this method.List of MapParseException - if there is an error parsingIllegalArgumentException - if reader is nullvoid parseLines(Reader reader, java.util.function.Consumer<Map<String,Object>> consumer)
Reader and parses it to Map, which is passed to the
provided Consumer.reader - Reader used. It is not closed in this method.consumer - the ConsumerParseException - if there is an error parsing any lineIllegalArgumentException - if reader or consumer are nullvoid parseLines(Reader reader, java.util.function.Consumer<Map<String,Object>> messageConsumer, java.util.function.BiConsumer<String,Throwable> errorConsumer)
Reader and parses it to Map, which is passed to the
provided Consumer. For any line where a ParseException would be thrown, it will
will be passed to the errorConsumer.reader - Reader used. It is not closed in this method.messageConsumer - the Consumer for messageserrorConsumer - the Consumer for syslog lines and their errors.IllegalArgumentException - if reader, messageConsumer, or errorConsumer are nullCopyright © 2021 palindromicity. All rights reserved.