Package nl.basjes.parse.useragent
Class AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA extends AbstractUserAgentAnalyzerDirect,B extends AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA,B>>
java.lang.Object
nl.basjes.parse.useragent.AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA,B>
- Direct Known Subclasses:
AbstractUserAgentAnalyzer.AbstractUserAgentAnalyzerBuilder
,UserAgentAnalyzerDirect.UserAgentAnalyzerDirectBuilder
- Enclosing class:
- AbstractUserAgentAnalyzerDirect
public abstract static class AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA extends AbstractUserAgentAnalyzerDirect,B extends AbstractUserAgentAnalyzerDirect.AbstractUserAgentAnalyzerDirectBuilder<UAA,B>>
extends Object
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOptionalResources
(String resourceString) Add a set of additional rules.addResources
(String resourceString) Add a set of additional rules.addYamlRule
(String yamlRule) Add a set of additional rules.build()
Construct the analyzer and run the preheat sequence (if requested).Load all patterns and rules but do not yet build the lookup hashMaps yet.Drop the default set of rules.Remove all testcases in memory after initialization.protected void
Set the stats logging during the startup of the analyzer back to the default of "minimal".Load all patterns and rules and immediately build the lookup hashMaps.Retain all testcases in memory after initialization.preheat()
Use the available testcases to preheat the jvm on this analyzer.preheat
(int iterations) Use the available testcases to preheat the jvm on this analyzer.Log additional information during the startup of the analyzer.Specify that we simply want to retrieve all possible fields.Specify an additional field that we want to retrieve.withFields
(String... fieldNames) Specify a set of additional fields that we want to retrieve.withFields
(Collection<String> fieldNames) Specify a set of additional fields that we want to retrieve.withUserAgentMaxLength
(int newUserAgentMaxLength) Set maximum length of a useragent for it to be classified as Hacker without any analysis.
-
Constructor Details
-
AbstractUserAgentAnalyzerDirectBuilder
-
-
Method Details
-
failIfAlreadyBuilt
protected void failIfAlreadyBuilt() -
dropDefaultResources
Drop the default set of rules. Useful in parsing ONLY company specific useragents.- Returns:
- the current Builder instance.
-
addResources
Add a set of additional rules. Useful in handling specific cases.- Parameters:
resourceString
- The resource list that needs to be added.- Returns:
- the current Builder instance.
-
addOptionalResources
Add a set of additional rules. Useful in handling specific cases. The startup will continue even if these do not exist.- Parameters:
resourceString
- The resource list that should to be added.- Returns:
- the current Builder instance.
-
addYamlRule
Add a set of additional rules. Useful in handling specific cases. The startup will continue even if these do not exist.- Parameters:
yamlRule
- The Yaml expression that should to be added.- Returns:
- the current Builder instance.
-
preheat
Use the available testcases to preheat the jvm on this analyzer.- Parameters:
iterations
- How many testcases must be run- Returns:
- the current Builder instance.
-
preheat
Use the available testcases to preheat the jvm on this analyzer. All available testcases will be run exactly once.- Returns:
- the current Builder instance.
-
withField
Specify an additional field that we want to retrieve.- Parameters:
fieldName
- The name of the additional field- Returns:
- the current Builder instance.
-
withFields
Specify a set of additional fields that we want to retrieve.- Parameters:
fieldNames
- The collection of names of the additional fields- Returns:
- the current Builder instance.
-
withFields
Specify a set of additional fields that we want to retrieve.- Parameters:
fieldNames
- The array of names of the additional fields- Returns:
- the current Builder instance.
-
withAllFields
Specify that we simply want to retrieve all possible fields.- Returns:
- the current Builder instance.
-
showMatcherLoadStats
Log additional information during the startup of the analyzer.- Returns:
- the current Builder instance.
-
hideMatcherLoadStats
Set the stats logging during the startup of the analyzer back to the default of "minimal".- Returns:
- the current Builder instance.
-
withUserAgentMaxLength
Set maximum length of a useragent for it to be classified as Hacker without any analysis.- Parameters:
newUserAgentMaxLength
- The new maximum length of a useragent for it to be classified as Hacker without any analysis.- Returns:
- the current Builder instance.
-
keepTests
Retain all testcases in memory after initialization.- Returns:
- the current Builder instance.
-
dropTests
Remove all testcases in memory after initialization.- Returns:
- the current Builder instance.
-
delayInitialization
Load all patterns and rules but do not yet build the lookup hashMaps yet. For the engine to run these lookup hashMaps are needed so they will be constructed once "just in time".- Returns:
- the current Builder instance.
-
immediateInitialization
Load all patterns and rules and immediately build the lookup hashMaps.- Returns:
- the current Builder instance.
-
showMinimalVersion
-
showFullVersion
-
build
Construct the analyzer and run the preheat sequence (if requested).- Returns:
- the new analyzer instance.
-