org.jbpm.kie.services.impl.query

## Class QueryServiceImpl

- java.lang.Object
- - org.jbpm.kie.services.impl.query.QueryServiceImpl

- All Implemented Interfaces:
    DeploymentEventListener, QueryService
  Direct Known Subclasses:
    QueryServiceCDIImpl, QueryServiceEJBImpl

      public class QueryServiceImpl
      extends Object
      implements QueryService, DeploymentEventListener

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryServiceImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.jbpm.kie.services.impl.query.QueryServiceImpl.DataSourceResolverSQLDataSourceLocator` | `apply(org.dashbuilder.dataprovider.sql.SQLDataSetProvider sqlDataSetProvider)`
    `protected void` | `applyQueryContext(Map<String,Object> params, org.kie.api.runtime.query.QueryContext queryContext)`
    `org.dashbuilder.dataset.def.DataSetDefRegistry` | `getDataSetDefRegistry()`
    `protected Function<String,String>` | `getDataSourceResolver()`
    `List<QueryDefinition>` | `getQueries(org.kie.api.runtime.query.QueryContext queryContext)` Returns list of query definitions registered in the system
    `QueryDefinition` | `getQuery(String uniqueQueryName)` Returns query definition details that is registered under given uniqueQueryName
    `void` | `init()`
    `void` | `onActivate(DeploymentEvent event)`
    `void` | `onDeactivate(DeploymentEvent event)`
    `void` | `onDeploy(DeploymentEvent event)`
    `void` | `onUnDeploy(DeploymentEvent event)`
    `<T> T` | `query(String queryName, QueryResultMapper<T> mapper, org.kie.api.runtime.query.QueryContext queryContext, QueryParam... filterParams)` Performs query on given query definition that had to be previously registered.
    `<T> T` | `query(String queryName, QueryResultMapper<T> mapper, org.kie.api.runtime.query.QueryContext queryContext, QueryParamBuilder<?> paramBuilder)` Performs query on given query definition that had to be previously registered.
    `void` | `registerQuery(QueryDefinition queryDefinition)` Registers new query definition in the system so it can be used for executing queries on top of it.
    `void` | `replaceQuery(QueryDefinition queryDefinition)` Registers or replaces existing query.
    `void` | `setCommandService(TransactionalCommandService commandService)`
    `void` | `setDataSetDefRegistry(org.dashbuilder.dataset.def.DataSetDefRegistry dataSetDefRegistry)`
    `void` | `setDataSetManager(org.dashbuilder.dataset.DataSetManager dataSetManager)`
    `void` | `setDataSourceResolver(Function<String,String> dataSourceResolver)`
    `void` | `setDeploymentRolesManager(DeploymentRolesManager deploymentRolesManager)`
    `void` | `setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)`
    `void` | `setProviderRegistry(org.dashbuilder.dataprovider.DataSetProviderRegistry providerRegistry)`
    `void` | `setUserGroupCallback(org.kie.api.task.UserGroupCallback userGroupCallback)`
    `void` | `unregisterQuery(String uniqueQueryName)` Removes the query definition from the system

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### QueryServiceImpl

          public QueryServiceImpl()

  - ### Method Detail

    - #### setDeploymentRolesManager

          public void setDeploymentRolesManager(DeploymentRolesManager deploymentRolesManager)

    - #### setIdentityProvider

          public void setIdentityProvider(org.kie.internal.identity.IdentityProvider identityProvider)

    - #### setCommandService

          public void setCommandService(TransactionalCommandService commandService)

    - #### setDataSetDefRegistry

          public void setDataSetDefRegistry(org.dashbuilder.dataset.def.DataSetDefRegistry dataSetDefRegistry)

    - #### getDataSetDefRegistry

          public org.dashbuilder.dataset.def.DataSetDefRegistry getDataSetDefRegistry()

    - #### setProviderRegistry

          public void setProviderRegistry(org.dashbuilder.dataprovider.DataSetProviderRegistry providerRegistry)

    - #### setDataSetManager

          public void setDataSetManager(org.dashbuilder.dataset.DataSetManager dataSetManager)

    - #### setUserGroupCallback

          public void setUserGroupCallback(org.kie.api.task.UserGroupCallback userGroupCallback)

    - #### setDataSourceResolver

          public void setDataSourceResolver(Function<String,String> dataSourceResolver)

    - #### getDataSourceResolver

          protected Function<String,String> getDataSourceResolver()

    - #### init

          public void init()

    - #### registerQuery

          public void registerQuery(QueryDefinition queryDefinition)
                             throws QueryAlreadyRegisteredException

      Description copied from interface: `QueryService`
      Registers new query definition in the system so it can be used for executing queries on top of it.
      Specified by:
        `registerQuery` in interface `QueryService`
      Parameters:
        `queryDefinition` - definition of the query to be registered
      Throws:
        `QueryAlreadyRegisteredException` - in case there is already query registered with given name (queryDefinition.getName())

    - #### replaceQuery

          public void replaceQuery(QueryDefinition queryDefinition)

      Description copied from interface: `QueryService`
      Registers or replaces existing query. Similar to what `registerQuery` does, though it won't throw exception in case there is already query registered but simply replace it.
      Specified by:
        `replaceQuery` in interface `QueryService`
      Parameters:
        `queryDefinition` - definition of the query to be registered/replaced

    - #### unregisterQuery

          public void unregisterQuery(String uniqueQueryName)
                               throws QueryNotFoundException

      Description copied from interface: `QueryService`
      Removes the query definition from the system
      Specified by:
        `unregisterQuery` in interface `QueryService`
      Parameters:
        `uniqueQueryName` - unique name that query was registered under
      Throws:
        `QueryNotFoundException` - in case there is no such query registered

    - #### query

          public <T> T query(String queryName,
                             QueryResultMapper<T> mapper,
                             org.kie.api.runtime.query.QueryContext queryContext,
                             QueryParam... filterParams)
                      throws QueryNotFoundException

      Description copied from interface: `QueryService`
      Performs query on given query definition that had to be previously registered. Results will be mapped by given `mapper` and:
      - sorting and paging will be applied based on `queryContext`
      - filtering of results will be done based on `filterParams` if given
      Specified by:
        `query` in interface `QueryService`
      Parameters:
        `queryName` - unique name that query was registered under
        `mapper` - type of the `QueryResultMapper` to map raw data set into list of objects
        `queryContext` - query context carrying paging and sorting details
        `filterParams` - additional filter parameters to narrow down the result
      Returns:
        results mapped to objects from raw data set
      Throws:
        `QueryNotFoundException` - in case there is no such query registered

    - #### query

          public <T> T query(String queryName,
                             QueryResultMapper<T> mapper,
                             org.kie.api.runtime.query.QueryContext queryContext,
                             QueryParamBuilder<?> paramBuilder)
                      throws QueryNotFoundException

      Description copied from interface: `QueryService`
      Performs query on given query definition that had to be previously registered. Results will be mapped by given `mapper` and:
      - sorting and paging will be applied based on `queryContext`
      - filtering of results will be done based on `paramBuilder` which is an implementation of `QueryParamBuilder` for building advanced filters
      Specified by:
        `query` in interface `QueryService`
      Parameters:
        `queryName` - unique name that query was registered under
        `mapper` - type of the `QueryResultMapper` to map raw data set into list of objects
        `queryContext` - query context carrying paging and sorting details
        `paramBuilder` - implementation of `QueryParamBuilder` that allows to build custom filters in advanced way
      Returns:
        results mapped to objects from raw data set
      Throws:
        `QueryNotFoundException` - in case there is no such query registered

    - #### getQuery

          public QueryDefinition getQuery(String uniqueQueryName)
                                   throws QueryNotFoundException

      Description copied from interface: `QueryService`
      Returns query definition details that is registered under given uniqueQueryName
      Specified by:
        `getQuery` in interface `QueryService`
      Parameters:
        `uniqueQueryName` - unique name that query was registered under
      Returns:
        query definition details if found
      Throws:
        `QueryNotFoundException` - in case there is no such query registered

    - #### getQueries

          public List<QueryDefinition> getQueries(org.kie.api.runtime.query.QueryContext queryContext)

      Description copied from interface: `QueryService`
      Returns list of query definitions registered in the system
      Specified by:
        `getQueries` in interface `QueryService`
      Parameters:
        `queryContext` - provides pagnition information for the query
      Returns:
        returns list of found queries

    - #### applyQueryContext

          protected void applyQueryContext(Map<String,Object> params,
                                           org.kie.api.runtime.query.QueryContext queryContext)

    - #### onDeploy

          public void onDeploy(DeploymentEvent event)

      Specified by:
        `onDeploy` in interface `DeploymentEventListener`

    - #### onUnDeploy

          public void onUnDeploy(DeploymentEvent event)

      Specified by:
        `onUnDeploy` in interface `DeploymentEventListener`

    - #### onActivate

          public void onActivate(DeploymentEvent event)

      Specified by:
        `onActivate` in interface `DeploymentEventListener`

    - #### onDeactivate

          public void onDeactivate(DeploymentEvent event)

      Specified by:
        `onDeactivate` in interface `DeploymentEventListener`

    - #### apply

          public org.jbpm.kie.services.impl.query.QueryServiceImpl.DataSourceResolverSQLDataSourceLocator apply(org.dashbuilder.dataprovider.sql.SQLDataSetProvider sqlDataSetProvider)

Copyright © 2001–2020 JBoss by Red Hat. All rights reserved.