Interface HqlMatcher
Before the extraction process, Hansken will query the Extraction plugin for the PluginInfo object,
which also exposes the HQL string provided by the plugin, which is then compiled to a HqlMatcher instance.
This way, the extraction process can match the traces which
should be sent to the ExtractionPlugin for processing, to avoid sending irrelevant data to the plugin.
Delegating the matching process to the ExtractionPlugin itself would cause overhead, because in that case,
every trace should be sent to the plugin in order to determine if it should be processed.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanGetter for the match full flag.booleanmatch(ImmutableTrace trace, String dataType) This method matches the conditions defined in the query against the trace input.static booleanmatches(PluginType type, HqlMatcher matcher, Trace trace, String dataType) default Stringproperty()Getter for the property we would like to match.
-
Method Details
-
match
This method matches the conditions defined in the query against the trace input.- Parameters:
trace- the trace to processdataType- the type of the current trace processing iteration- Returns:
- true if the input trace satisfies the conditions of the query
-
property
Getter for the property we would like to match.- Returns:
- the property we would like to match against.
-
fullMatch
default boolean fullMatch()Getter for the match full flag.- Returns:
- the value of the flag of whether to match full(treating wildcards as string literals), untokenized string values, default false.
-
matches
Check that givenmatchermatches giventraceanddataType, taking into account which type ofpluginwe are dealing with.Currently, this means that matching on a
'meta'data type can only succeed when we have a plugin of typePluginType.META_EXTRACTION_PLUGINorPluginType.DEFERRED_META_EXTRACTION_PLUGIN. In all other cases, it can succeed for a plugin of typePluginType.EXTRACTION_PLUGINorPluginType.DEFERRED_EXTRACTION_PLUGIN. Note that even then, matching still only succeeds when the matcher does.Note: this function does no parameter validation, so care must be taken by the client.
- Parameters:
type- the type of the pluginmatcher- the matcher to usetrace- the trace to match ondataType- the data type contained in the current context- Returns:
trueif the match succeeded, otherwisefalse
-