Class MatchEngine

java.lang.Object
com.aquima.interactions.matching.impl.model.MatchEngine
All Implemented Interfaces:
IMatchEngine

public class MatchEngine extends Object implements IMatchEngine
Actual match engine implementation.
Since:
6.2
Author:
O. Kerpershoek, F. van der Meer
  • Constructor Details

    • MatchEngine

      public MatchEngine(IMetaModel model, IMatchEngineDS datasource, IMatchTypeFactory factory, IResourceManager resources, ILicenseProvider licenseProvider)
      Constructs the match engine using the provided parameters.
      Parameters:
      model - The meta model containing the attribute definitions.
      datasource - Data source providing the match configuration.
      factory - Optional match type factory for custom match functions.
      resources - The resource manager that may be used to locate resources.
      licenseProvider - The license provider to check if using the match engine is allowed.
      Throws:
      InitializationException - This exception is thrown when the match engine could not be initialized due to invalid data provided by the data source.
  • Method Details

    • getCaseBase

      public ICaseBase getCaseBase(String entityName)
      Description copied from interface: IMatchEngine
      This method returns the casebase for the specified entity type name.
      Specified by:
      getCaseBase in interface IMatchEngine
      Parameters:
      entityName - The name of the entity for which the casebase is requested.
      Returns:
      The casebase of the specified entity type.
    • getMutableCaseBase

      public IMutableCaseBase getMutableCaseBase(String entityName)
      Description copied from interface: IMatchEngine
      This method returns the mutable casebase for the specified entity type name. In a mutable casebase cases can be inserted, updated, and deleted while the application is running. After all changes in the case data are registered, the method IMatchEngine.applyCaseBaseUpdates() must be called to apply the changes to the casebases. Changes in the case data are applied to the casebases after all running match and detailMatch operations have finished.
      Specified by:
      getMutableCaseBase in interface IMatchEngine
      Parameters:
      entityName - The name of the entity for which the casebase is requested.
      Returns:
      The casebase of the specified entity type.
    • getMatchFunction

      public IMatchFunction getMatchFunction(String functionName)
      Description copied from interface: IMatchEngine
      This method returns the match function as defined in studio.
      Specified by:
      getMatchFunction in interface IMatchEngine
      Parameters:
      functionName - The name of the match function as defined in studio.
      Returns:
      A match function for the specified name.
    • match

      public IMatchResult match(IMatchRequest request)
      Description copied from interface: IMatchEngine
      This method matches the request against the internal casebase and returns the match result containing the matching cases.
      Specified by:
      match in interface IMatchEngine
      Parameters:
      request - The request that should be matched.
      Returns:
      Object containing the result of the match (never null).
    • detailMatch

      public IDetailMatchResult detailMatch(IMatchRequest request, String caseId)
      Description copied from interface: IMatchEngine
      This method may be used to match the request against a specific case, in order to get a detailed matched result explaining how each value of the request matches against the values of the case.
      Specified by:
      detailMatch in interface IMatchEngine
      Parameters:
      request - The request containing the values that should be matched against the case.
      caseId - The ID of the case that should be used to match the request against.
      Returns:
      Object containing detailed information about the match scores of the values that were matched from the request.
    • getMatchFunctionList

      protected MatchFunctionList getMatchFunctionList()
    • hasCaseBase

      protected boolean hasCaseBase(String entityName)
    • applyCaseBaseUpdates

      public void applyCaseBaseUpdates()
      Description copied from interface: IMatchEngine
      This method must be called to apply any modifications in the case data to the match engine. Changes in the case data are registered via the IMutableCaseBase interface. After all changes are registered, this method must be called to apply the changes to the casebases. Changes in the case data are applied to the casebases after all running match and detailMatch operations have finished.
      Specified by:
      applyCaseBaseUpdates in interface IMatchEngine