Class AnalyzerUtilities

java.lang.Object
nl.basjes.parse.useragent.AnalyzerUtilities

public final class AnalyzerUtilities extends Object
  • Method Details

    • parseArguments

      @Nonnull public static AnalyzerUtilities.ParsedArguments parseArguments(@Nonnull String[] args, @Nonnull List<String> allAllowedFields, @Nonnull List<String> allAllowedHeaders)
    • 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 user
      allAllowedFields - 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.