wt.vc.config
Interface ConfigSpec

All Superinterfaces:
Externalizable, Serializable
All Known Subinterfaces:
PersistableConfigSpec, SQLFunctionConfigSpec
All Known Implementing Classes:
AuthoringApplicationConfigSpec, BaselineConfigSpec, BaselineConfigurationConfigSpec, Changeable2ConfigSpec, ConfigSpecProxy, ConfigurationMemberConfigSpec, ConfigurationVisitor, EffConfigSpec, EffConfigSpecGroup, EffectivityConfigSpec, EPMAsStoredConfigSpec, EPMConfigSpecFilter, EPMDocConfigSpec, InUseConfigSpec, IteratedFolderedConfigSpec, LatestConfigSpec, LatestConfigSpecWithoutWorkingCopies, LifeCycleConfigSpec, MultipleLatestConfigSpec, MultipleOwnershipIndependentLatestConfigSpec, OwnershipIndependentLatestConfigSpec, PersistableEffConfigSpec, PromotionNoticeConfigSpec, RemoveConfigurationVisitor, SandboxConfigSpec, SerialNumberedConfiguredInstanceConfigSpec, SharedOnlyConfigSpec, StandardStructService.ProjectTerminalConfigSpec, ViewConfigSpec, WorkspaceConfigSpec, WTDocumentConfigSpec, WTDocumentStandardConfigSpec, WTPartBaselineConfigSpec, WTPartConfigSpec, WTPartEffectivityConfigSpec, WTPartStandardConfigSpec

public interface ConfigSpec
extends Externalizable

Implementations of this interface are used by the ConfigService to convert Mastered objects into Iterated objects based on some existing QuerySpec. Due to the nature of the master to iteration relationship in the database most but not all of the selection work can be done in the database; some of the work must be done after iterations are retrieved from the database.

A ConfigSpec has two key methods: appendSearchCriteria(wt.query.QuerySpec) adds to the database query specification that iterations must meet and process(wt.fc.QueryResult) does post-query filtering required to finally determine the appropriate iteration(s). Because no assumptions are made as to whether or not the iterations to process are "latest" iterations, the query criteria becomes especially important.

ConfigSpec usage:

When creating new ConfigSpecs it is important to document carefully what both key methods do. Usually reuse is achived by delegation rather than inheritance, so it is likely that one or both of the key methods in a ConfigSpec may be reused. In particular if one of the key methods does nothing, then that should be noted.

Supported API: true

Extendable: true

See Also:
"All implementations of ConfigSpec", LatestConfigSpec, MultipleLatestConfigSpec, WTPartConfigSpec, WTPartBaselineConfigSpec, WTPartEffectivityConfigSpec, WTPartStandardConfigSpec

Method Summary
 QuerySpec appendSearchCriteria(QuerySpec querySpec)
          Appends to the supplied QuerySpec additional search criteria to reduce the resulting iterations to only those that will be considered by this ConfigSpec.
 QueryResult process(QueryResult results)
          Process the QueryResult of iterations, returning only those that "match" according to the algorithm.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

appendSearchCriteria

public QuerySpec appendSearchCriteria(QuerySpec querySpec)
                               throws WTException,
                                      QueryException
Appends to the supplied QuerySpec additional search criteria to reduce the resulting iterations to only those that will be considered by this ConfigSpec. Appending additional classes to the QuerySpec is allowed (for join purposes), but those that are marked as selectable will be trimmed by "filteredIterationsOf" prior to it calling the "process" API.

The QueryResult returned should be a copy of the passed in one (taking advantage of side-effects is not encouraged).



Supported API: true

Parameters:
querySpec - A QuerySpec with a target class that is Iterated.
Returns:
QuerySpec
Throws:
WTException
QueryException
See Also:
QuerySpec, SearchCondition

process

public QueryResult process(QueryResult results)
                    throws WTException
Process the QueryResult of iterations, returning only those that "match" according to the algorithm.

The QueryResult returned should be a copy of the passed-in QueryResult (side-effects should be avoided).



Supported API: true

Parameters:
results - QueryResult of iterations to filter. Assumed to be the result of a query that included the additional search conditions applied by appendSearchCriteria. Note that after enumerating through the elements of this QueryResult, it should be reset.
Returns:
QueryResult
Throws:
WTException
See Also:
QueryResult, Iterated