org.modeshape.jcr.query

## Interface QueryEngine

- All Known Implementing Classes:
    IndexQueryEngine, ScanningQueryEngine

      public interface QueryEngine

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `QueryContext` | `createQueryContext(ExecutionContext context, RepositoryCache repositoryCache, Set<String> workspaceNames, Map<String,NodeCache> overriddenNodeCachesByWorkspaceName, Schemata schemata, RepositoryIndexes indexDefns, NodeTypes nodeTypes, BufferManager bufferManager, PlanHints hints, Map<String,Object> variables)` Create a new context for query execution.
    `QueryResults` | `execute(QueryContext context, QueryCommand query)` Execute the supplied query by planning, optimizing, and then processing it.
    `void` | `shutdown()` Signal that the engine is no longer needed and should clean up and/or close any resources.

- - ### Method Detail

    - #### execute

          QueryResults execute(QueryContext context,
                             QueryCommand query)
                               throws QueryCancelledException,
                                      RepositoryException

      Execute the supplied query by planning, optimizing, and then processing it.
      Parameters:
        `context` - the context in which the query should be executed
        `query` - the query that is to be executed
      Returns:
        the query results; never null
      Throws:
        `IllegalArgumentException` - if the context or query references are null
        `QueryCancelledException` - if the query was cancelled
        `RepositoryException` - if there was a problem executing the query

    - #### createQueryContext

          QueryContext createQueryContext(ExecutionContext context,
                                        RepositoryCache repositoryCache,
                                        Set<String> workspaceNames,
                                        Map<String,NodeCache> overriddenNodeCachesByWorkspaceName,
                                        Schemata schemata,
                                        RepositoryIndexes indexDefns,
                                        NodeTypes nodeTypes,
                                        BufferManager bufferManager,
                                        PlanHints hints,
                                        Map<String,Object> variables)

      Create a new context for query execution.
      Parameters:
        `context` - the context in which the query is being executed; may not be null
        `repositoryCache` - the repository cache that should be used to load results; may be null if no results are to be loaded
        `workspaceNames` - the name of each workspace to be queried, or an empty set if all the workspaces should be queried; may not be null
        `overriddenNodeCachesByWorkspaceName` - the NodeCache instances that should be used to load results, which will be used instead of the RepositoryCache's NodeCache for a given workspace name; may be null or empty
        `schemata` - the schemata
        `indexDefns` - the definitions for the currently-defined indexes; never null
        `nodeTypes` - the snapshot of node types; may not be null
        `bufferManager` - the buffer manager; may not be null
        `hints` - the hints, or null if there are no hints
        `variables` - the mapping of variables and values, or null if there are no such variables
      Returns:
        the context; never null
      Throws:
        `IllegalArgumentException` - if the context, workspace name, or schemata are null

    - #### shutdown

          void shutdown()

      Signal that the engine is no longer needed and should clean up and/or close any resources.

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.