Package wt.vc.config

Interface ConfigService

All Known Implementing Classes:
StandardConfigService

@RemoteInterface public interface ConfigService
This service helps obtain Iterated objects from Mastered objects (or a QuerySpec) and a ConfigSpec.
  • Cookie: None
  • Helper: ConfigHelper with several helper methods
  • Service implementation: StandardConfigService with no listeners
  • ServiceEvent: None
  • ServiceException: ConfigException


Supported API: true

Extendable: false
  • Method Details

    • filteredIterationsOf

      QueryResult filteredIterationsOf(Mastered master, ConfigSpec configSpec) throws WTException, PersistenceException
      Returns a QueryResult of Iterated objects that are related to the given Mastered object and are valid for the given ConfigSpec.

      Supported API: true
      Parameters:
      master - The master to get the iterations for.
      configSpec - The ConfigSpec to process this master's iterations against.
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
    • filteredIterationsOf

      QueryResult filteredIterationsOf(QueryResult masters, ConfigSpec configSpec) throws WTException, PersistenceException
      Returns a QueryResult of Iterated objects that are related to the given QueryResult of Mastered objects and are valid for the given ConfigSpec.

      Supported API: true
      Parameters:
      masters - The QueryResult of masters to get the iterations for.
      configSpec - The ConfigSpec to process the resulting iterations against.
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
    • filteredIterationsOf

      <T extends ConfigSpec> QueryResult filteredIterationsOf(Mastered master, List<T> configSpecs) throws WTException, PersistenceException
      Returns a QueryResult of Iterated objects that are related to the given Mastered object and are valid for the given ConfigSpecs.

      Supported API: true
      Type Parameters:
      T - a sub-type of ConfigSpec
      Parameters:
      master - The master to get the iterations for.
      configSpecs - The ConfigSpecs to process this master's iterations against.
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
    • filteredIterationsOf

      <T extends ConfigSpec> QueryResult filteredIterationsOf(QueryResult masters, List<T> configSpecs) throws WTException, PersistenceException
      Returns a QueryResult of Iterated objects that are related to the given QueryResult of Mastered objects and are valid for the given ConfigSpecs.

      Supported API: true
      Type Parameters:
      T - a sub-type of ConfigSpec
      Parameters:
      masters - The QueryResult of masters to get the iterations for.
      configSpecs - The ConfigSpecs to process the resulting iterations against.
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
    • queryIterations

      QueryResult queryIterations(QuerySpec querySpec, ConfigSpec configSpec) throws WTException, PersistenceException
      Returns a QueryResult of Iterated objects that have been selected by the given QuerySpec and are valid for the given ConfigSpec. This API disables in-database config spec processing unless the wt.vc.config.relationalizeQueryIterations property is set to "true" in wt.properties because the in-database config spec queries perform well only when the selection logic is in the sub-select statement created to facilitate the query, and this API doesn't allow the sub-select statement to be manipulated, forcing the logic in the outer-select statement.

      With in-database config spec processing disabled, this API appends the querySpec with logic specified by ConfigSpec.appendSearchCriteria(QuerySpec), queries the data- base with the altered config spec, and then post-processes the result using ConfigSpec.process(QueryResult).

      Supported API: true

      Parameters:
      querySpec - The QuerySpec with an iterated primary class
      configSpec - The ConfigSpec to filter iterations against
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
      See Also:
    • queryIterations

      QueryResult queryIterations(QuerySpec querySpec, ConfigSpec configSpec, QueryIterationsCallback callback) throws WTException, PersistenceException
      A variant of the queryIterations(QuerySpec, ConfigSpec) API that allows for an (optional) callback API which, when called, is passed the appropriate QuerySpec -- the sub-select when using in-database config spec processing, and the outer-select when it is not being used -- to allow for additional criteria to be supplied. In-database config spec processing is always used when the callback is non-null and the configSpec supports it.

      The purpose of the callback is to ensure that the "additional criteria" gets applied to the proper select (sub- or outer-select) statement, a key consideration when using in-database config spec processing. Note that the callback need not concern itself with whether in-database config spec processing is actually being utilized or not. Using this API is preferred over queryIterations(QuerySpec, ConfigSpec), as in-database config spec processing outperforms a "regular" query with post-processing. The following code illustrates proper use (if querying for the "latest" versions of part(s) named "foo"):

       QueryResult qr = ConfigHelper.service.queryIterations(new QuerySpec(WTPart.class), new LatestConfigSpec(), new QueryIterationsCallback() {
          public void appendTo(final QuerySpec qs) throws WTException {
             qs.appendAnd();
             qs.appendWhere(new SearchCondition(WTPart.class, WTPart.NAME, SearchCondition.EQUAL, "foo"));
          }
       });

      As with ConfigSpec.appendSearchCriteria(QuerySpec), the passed-in QuerySpec does not presumptively pass in an "and" condition, making the the responsibility of the callback to handle this.

      Supported API: true

      Parameters:
      querySpec - The QuerySpec with an Iterated primary class
      configSpec - The ConfigSpec to filter iterations against
      callback - The code needed to append to the QuerySpec (see above)
      Returns:
      QueryResult
      Throws:
      WTException
      PersistenceException
    • getConfigSpecFor

      List<ConfigSpec> getConfigSpecFor(NavCriteriaContext context) throws WTException
      Lookup the GetConfigSpecForDelegate2 delegate and use its methods to get a list of ConfigSpecs.



      Supported API: true

      Parameters:
      context - Holds the parameters used to lookup the delegate and used by the delegate to create the list of ConfigSpecs.
      Returns:
      The list of ConfigSpec as returned by the delegate.
      Throws:
      WTException - On error.