public interface HqlMatcher
This interface specifies the minimum required methods that a compiled Matcher node needs to run.

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 Type
    Method
    Description
    default boolean
    Getter for the match full flag.
    boolean
    match(ImmutableTrace trace, String dataType)
    This method matches the conditions defined in the query against the trace input.
    static boolean
    matches(PluginType type, HqlMatcher matcher, Trace trace, String dataType)
    Check that given matcher matches given trace and dataType, taking into account which type of plugin we are dealing with.
    default String
    Getter for the property we would like to match.
  • Method Details

    • match

      boolean match(ImmutableTrace trace, String dataType)
      This method matches the conditions defined in the query against the trace input.
      Parameters:
      trace - the trace to process
      dataType - the type of the current trace processing iteration
      Returns:
      true if the input trace satisfies the conditions of the query
    • property

      default String 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

      static boolean matches(PluginType type, HqlMatcher matcher, Trace trace, String dataType)
      Check that given matcher matches given trace and dataType, taking into account which type of plugin we are dealing with.

      Currently, this means that matching on a 'meta' data type can only succeed when we have a plugin of type PluginType.META_EXTRACTION_PLUGIN or PluginType.DEFERRED_META_EXTRACTION_PLUGIN. In all other cases, it can succeed for a plugin of type PluginType.EXTRACTION_PLUGIN or PluginType.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 plugin
      matcher - the matcher to use
      trace - the trace to match on
      dataType - the data type contained in the current context
      Returns:
      true if the match succeeded, otherwise false