Class HistoryQueryEngineMock

java.lang.Object
de.calamanari.pk.activeobject.AbstractHistoryQueryEngine
de.calamanari.pk.activeobject.HistoryQueryEngineMock

public class HistoryQueryEngineMock
extends AbstractHistoryQueryEngine
History Query Engine Mock - in this example this is a component implementation for executing queries that may take some time.
Author:
Karl Eilebrecht
  • Constructor Summary

    Constructors
    Constructor Description
    HistoryQueryEngineMock​(java.util.List<java.lang.String[]> seedData, long queryDurationMillis)
    In this example the history data fill be fed at startup.
  • Method Summary

    Modifier and Type Method Description
    java.util.List<java.lang.String[]> queryHistoryData​(java.lang.String firstName, java.lang.String lastName, java.lang.String birthday)
    Perform a synchronous query, which may take some time.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HistoryQueryEngineMock

      public HistoryQueryEngineMock​(java.util.List<java.lang.String[]> seedData, long queryDurationMillis)
      In this example the history data fill be fed at startup.
      Parameters:
      seedData - list of String[4]=[firstName, lastName, birthday, data]
      queryDurationMillis - simulated time a query to this engine shall need
  • Method Details

    • queryHistoryData

      public java.util.List<java.lang.String[]> queryHistoryData​(java.lang.String firstName, java.lang.String lastName, java.lang.String birthday)
      Description copied from class: AbstractHistoryQueryEngine
      Perform a synchronous query, which may take some time.
      Specified by:
      queryHistoryData in class AbstractHistoryQueryEngine
      Parameters:
      firstName - person's first name (optional)
      lastName - person's last name (optional)
      birthday - person's birthday (mandatory)
      Returns:
      data list of (String[4]=[firstName, lastName, birthday, data]) according to the query or empty list if not found