Package nl.basjes.parse.useragent
Class AnalyzerUtilities
java.lang.Object
nl.basjes.parse.useragent.AnalyzerUtilities
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionIn several situations (mostly SQL class UDFs) we see the same need: A sequence of strings must be analyzed and converted into parameters for the UserAgentAnalyzer.
-
Method Details
-
parseArguments
-
parseArguments
@Nonnull public static AnalyzerUtilities.ParsedArguments parseArguments(@Nonnull List<String> args, @Nonnull List<String> allAllowedFields, @Nonnull List<String> allAllowedHeaders) In several situations (mostly SQL class UDFs) we see the same need: A sequence of strings must be analyzed and converted into parameters for the UserAgentAnalyzer. Supported format patterns this parser will detect: - useragent - useragent [ headername, headervalue ]+ - [ headername, headervalue ]+ Notes: - The useragent and any of the headervalues can be null or empty. - A trailing list of null values will be ignored - When not having the useragent as the first value the Analyzers will expect a "User-Agent" header in the list.- Parameters:
args
- The list of arguments passed from the userallAllowedFields
- The list of all supported fieldnames (i.e. all possible outputs)allAllowedHeaders
- The list of all supported headers (i.e. all supported inputs)- Returns:
- The list of request headers and the list of wanted fields. It is up to the calling system to choose which to use.
-