org.eclipse.viatra.query.runtime.matchers.backend

## Interface IQueryBackend

- All Known Implementing Classes:
    LocalSearchBackend, ReteEngine

      public interface IQueryBackend

  Internal interface for a VIATRA query specification. Each query is associated with a pattern. Methods instantiate a matcher of the pattern with various parameters.
  Since:
    0.9
  No Extend:
    This interface is not intended to be extended by users of the VIATRA framework, and should only be used by the query engine

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `dispose()` Disposes the query backend.
    `void` | `flushUpdates()` Propagates all pending updates in this query backend.
    `IQueryBackendFactory` | `getFactory()`
    `IQueryResultProvider` | `getResultProvider(PQuery query)` Returns a result provider for a given query.
    `IQueryResultProvider` | `getResultProvider(PQuery query, QueryEvaluationHint hints)` Returns a result provider for a given query.
    `boolean` | `isCaching()`
    `IQueryResultProvider` | `peekExistingResultProvider(PQuery query)` Returns an existing result provider for a given query, if it was previously constructed, returns null otherwise.

- - ### Method Detail

    - #### isCaching

          boolean isCaching()

      Returns:
        true iff this backend is incremental, i.e. it caches the results of queries for quick retrieval, and can provide update notifications on result set changes.

    - #### getResultProvider

          IQueryResultProvider getResultProvider(PQuery query)

      Returns a result provider for a given query. Repeated calls may return the same instance.
      Throws:
        `ViatraQueryRuntimeException`

    - #### getResultProvider

          IQueryResultProvider getResultProvider(PQuery query,
                                                 QueryEvaluationHint hints)

      Returns a result provider for a given query. Repeated calls may return the same instance.
      Parameters:
        `optional` - hints that may override engine and query defaults (as provided by `IQueryBackendHintProvider`). Can be null.
      Throws:
        `ViatraQueryRuntimeException`
      Since:
        1.4

    - #### peekExistingResultProvider

          IQueryResultProvider peekExistingResultProvider(PQuery query)

      Returns an existing result provider for a given query, if it was previously constructed, returns null otherwise. Will not construct and initialize new result providers.

    - #### flushUpdates

          void flushUpdates()

      Propagates all pending updates in this query backend. The implementation of this method is optional, and it can be ignored entirely if the backend does not delay updates.
      Since:
        1.6

    - #### dispose

          void dispose()

      Disposes the query backend.

    - #### getFactory

          IQueryBackendFactory getFactory()

      Returns:
        the factory that created this backend, if this functionality is supported
      Since:
        2.1