wt.configuration
Class StandardConfigurationService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.configuration.StandardConfigurationService
All Implemented Interfaces:
ConfigurationService, Manager, NetFactor, Serializable

public class StandardConfigurationService
extends StandardManager
implements ConfigurationService, Serializable

Use the newStandardConfigurationService static factory method(s), not the StandardConfigurationService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Nested Class Summary
(package private) static interface StandardConfigurationService.PathProcessor
           
(package private)  class StandardConfigurationService.PathQuantityProcessor
           
(package private)  class StandardConfigurationService.RecurseOperation
           
 
Field Summary
private static String ADD_OR_REPLACE_ALREADY_VALIDATED_KEY
           
private static String CLASSNAME
           
private static String DONT_PROCESS_POST_REMOVE_BASELINE_EVENT
           
private static String[] instanceTablesToLock
           
private static Boolean NULL
           
private static String RESOURCE
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardConfigurationService()
           
 
Method Summary
protected  void add(BaselineConfigurationVersion configuration, ConfigurationManageable version)
           
 SerialNumberMapping addMapping(SerialNumberedConfiguredInstanceVersion instance, PathOccurrence path, SerialNumberedInstanceIfc instanceToAllocate)
          Allocate this instanceToAllocate to this instance.
 BaselineConfigurationOverride addOverride(BaselineConfigurationVersion configuration, PathOccurrence path, ConfigurationManageable version)
          Add the version as an override for the given path.
 BaselineConfigurationVersion assignToConfiguration(BaselineConfigurationVersion configuration, ConfigurationManageable version)
          Assigns the given version to the configuration.
 SerialNumberedConfiguredInstanceVersion changeConfiguration(SerialNumberedConfiguredInstanceVersion instance, SerialNumberedBaselineConfigurationVersion configuration)
          Assign a different configuration to this instance.
protected  void cleanupCommittedConfiguration(BaselineConfigurationVersion configuration)
           
protected  void deleteConfigurationsOf(ConfiguredMaster configuration)
           
protected  void deleteInstancesOf(SerialNumbered serialNumbered)
           
 QueryResult getAll(BaselineConfigurationVersion configuration, boolean versionsOnly)
          Get all versions, normal and overrides, assigned to this configuration.
 QueryResult getAllConfigurations(ConfiguredMaster configuredMaster)
          Get all the configurations of this configured master.
 QueryResult getAllInstances(Configuration configuration)
          Return all the instances that are assigned to this configuration.
 QueryResult getAllInstances(ConfigurationManageable version)
          Get all the instances which use a configuration which configures this version.
protected  QueryResult getAllInstances(QueryResult configurations)
           
 QueryResult getAllInstances(SerialNumbered serialNumbered)
          Get all instances of this serial numbered object.
 QueryResult getAllOverrides(BaselineConfigurationVersion configuration, boolean versionsOnly)
          

Supported API: false
protected  void getAndSetConfiguration(QueryResult qr)
           
 String getConceptualClassname()
          Deprecated.  
 QueryResult getConfigurations(ConfiguredVersion configuredVersion)
          Get the configurations of this configured version that configure it.
 QueryResult getConfigurationsAll(ConfigurationManageable version, boolean configurationsOnly)
          Get all the configurations this version is assigned to, as normal or override.
 QueryResult getConfigurationsNormal(ConfigurationManageable version)
          Get the configurations this version is assigned to.
 QueryResult getConfigurationsOverrides(ConfigurationManageable version, boolean configurationsOnly)
          Return the configurations this version is called out as an override in.
 ConfiguredVersion getConfiguredVersion(BaselineConfigurationVersion configuration)
          Get the version of the ConfiguredVersion assigned to this configuration, or null if one was not assigned.
 Persistable getConfiguredVersionOrMaster(BaselineConfigurationVersion configuration)
          Return the version of the ConfiguredVersion, if one is assigned to this configuration.
private  void getIdentityParms(ConfigurationManageable version, Object[] parms, int index)
           
 QueryResult getIncorporatedInstances(ConfigurationManageable version, Timestamp incorporatedSince)
          Get all the incorporated instances which use a configuration which configures this version.
protected  QueryResult getIncorporatedInstances(QueryResult configurations, Timestamp incorporatedSince)
           
 QueryResult getIncorporatedInstances(SerialNumberedBaselineConfigurationVersion configuration, Timestamp incorporatedSince)
          Get all incorporated instances using this configuration.
 QueryResult getIncorporatedInstances(SerialNumberedConfiguredMaster serialNumbered, Timestamp incorporatedSince)
          Get all incorporated instances of this serial numbered object.
 QueryResult getMappedInstances(SerialNumberedConfiguredInstanceVersion serialNumbered, Timestamp incorporated)
          Get all the instances of this serial numbered object that have been incorporated as of the given timestamp.
 SerialNumberedConfiguredInstanceVersion getMappedIntoInstance(SerialNumberedInstanceImpl serialNumbered, Timestamp incorporated)
          Get the instance, incorporated as of the given timestamp, that allocates this instance.
protected  Navigator getNavigator(BaselineConfigurationVersion configuration, ConfigSpec configSpec)
           
 QueryResult getNormal(BaselineConfigurationVersion configuration)
          Get all the versions assigned to this configuration.
 ConfigurationManageable getNormalVersion(BaselineConfigurationVersion configuration, Mastered master)
          Get the version, if any, that is assigned to this configuration.
 QueryResult getNormalVersions(BaselineConfigurationVersion configuration, QueryResult masters)
          Get the versions, if any, that are assigned to this configuration.
 QueryResult getOverrides(BaselineConfigurationVersion configuration, QueryResult pathOccurrences, boolean versionsOnly)
          Get all overrides in this configuration.
 QueryResult getOverrideVersions(BaselineConfigurationVersion configuration, Mastered master, boolean versionsOnly)
          Get all versions of this master, if any, that are assigned as overrides in this configuration.
 QueryResult getOverrideVersions(BaselineConfigurationVersion configuration, QueryResult masters, boolean versionsOnly)
          Get all versions of these masters, if any, that are assigned as overrides in this configuration.
 QueryResult getPlannedInstances(ConfigurationManageable version, Timestamp plannedFor)
          Get all the planned instances which use a configuration which configures this version.
protected  QueryResult getPlannedInstances(QueryResult configurations, Timestamp plannedFor)
           
 QueryResult getPlannedInstances(SerialNumberedBaselineConfigurationVersion configuration, Timestamp plannedFor)
          Get all planned instances using this configuration.
 QueryResult getPlannedInstances(SerialNumberedConfiguredMaster serialNumbered, Timestamp plannedFor)
          Get all planned instances of this serial numbered object.
 QueryResult getUnmappedInstances(SerialNumbered serialNumbered, Timestamp notIncorporatedByContextAsOf)
          Get all the instances that have not been allocated into another instance.
 QueryResult getUnmappedInstances(SerialNumbered serialNumbered, Timestamp notIncorporatedByContextAsOf, QuerySpec instanceSpec)
          Get all the instances that have not been allocated into another instance.
protected  Class getValidClassForRole(Class objectClass, String role)
           
 SerialNumberedInstanceVersion incorporate(SerialNumberedInstanceVersion instance, Timestamp incorporated)
          Incorporate this instance.
protected  void intValidateInstanceForIncorporation(SerialNumberedInstanceVersion instance, Timestamp incorporated)
           
static StandardConfigurationService newStandardConfigurationService()
          Default factory for the class.
protected  void performStartupProcess()
          Dummy method to be overridden by subclasses.
 BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec)
          Populates the configuration, starting at the configured version.
 BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec, ConfigurationManageable version)
          Populates the configuration, starting at the version.
 BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec, Mastered master)
          Populates the configuration, starting at the master.
protected  void potentiallyClearDates(SerialNumberedInstanceVersion version)
           
protected  void potentiallyDeleteOverrides(BaselineConfigurationVersion configuration, WTCollection configurationManageables)
          Delete overrides that reference the same iterations as those replacing existing iterations in the configuration.
protected  void potentiallyMoveOverridesToNormal(BaselineConfigurationVersion configuration, WTCollection configurationManageables)
          If there are overrides for the base iterations being deleted, make one of them a base iteration.
protected  WTCollection preValidateCollectionForAddToConfiguration(BaselineConfigurationVersion configuration, WTCollection baselineables, boolean throwException)
          Returns the sub-collection of valid objects for the configuration (if throwException is false) or throws an exception if there are invalid objects.
 void registerEvents(ManagerService managerService)
          Register events with the passed ManagerService.
protected  void remove(BaselineConfigurationVersion configuration, BaselineMember member)
           
protected  QueryResult removeDupes(QueryResult qr, boolean otherSideOnly)
           
 BaselineConfigurationVersion removeFromConfiguration(BaselineConfigurationVersion configuration, ConfigurationManageable version)
          Removes the given version from the configuration

Supported API: true
 SerialNumberedConfiguredInstanceVersion removeMapping(SerialNumberedConfiguredInstanceVersion instance, SerialNumberMapping mapping)
          Remove the allocation.
 BaselineConfigurationVersion removeOverride(BaselineConfigurationVersion configuration, BaselineConfigurationOverride override)
          Remove the override.
protected  void removeVersionRecursively(BaselineConfigurationVersion configuration, ConfigurationManageable version, ConfigurationDelegate delegate)
           
protected  void replace(BaselineConfigurationVersion configuration, ConfigurationManageable version, BaselineMember member)
           
 SerialNumberMapping replaceMapping(SerialNumberMapping mapping, SerialNumberedInstanceIfc instanceToAllocate)
          Assign a different instance to this allocation.
 BaselineConfigurationOverride replaceVersionForOverride(BaselineConfigurationOverride override, ConfigurationManageable newVersion)
          Assign a different version to this override.
 BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec)
          Repopulate the configuration, starting at the configured version.
 BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec, ConfigurationManageable version)
          Repopulate the configuration, starting at the version.
 BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration, ConfigSpec configSpec, Mastered master)
          Repopulate the configuration, starting at the master.
protected  void setConfiguration(QueryResult qr, Configuration configuration)
           
protected  void setConfiguration(QueryResult qr, Hashtable configurationHash)
           
 SerialNumberedInstanceVersion setPlannedIncorporation(SerialNumberedInstanceVersion instance, Timestamp plannedIncorporation)
          Set the planned incorporation for this instance.
 BaselineConfigurationVersion storeNewConfiguration(BaselineConfigurationVersion configuration, ConfiguredMaster configurationFor)
          Stores the configuration.
 BaselineConfigurationVersion storeNewConfiguration(BaselineConfigurationVersion configuration, ConfiguredVersion configurationFor)
          Stores the configuration and adds the version (configurationFor) to it.
protected  void validateAddToConfiguration(BaselineConfigurationVersion configuration, ConfigurationManageable version)
           
protected  void validateAddToConfiguration(BaselineConfigurationVersion configuration, WTCollection configurationManageables)
           
protected  void validateConfigurationForModificationOrDeletion(Configuration version, boolean forModification)
           
protected  void validateConfigurationManageableForModificationOrDeletion(WTCollection configurationManageables)
          Do not allow a configuration manageable object to be modified if it's an override in a configuration.
protected  void validateConfigurationsForModificationOrDeletion(WTCollection configurations, boolean forModification)
          Do not allow a configuration to be modified if it's associated to an incorporated instance.
 void validateInstanceForIncorporation(SerialNumberedInstanceVersion instance, Timestamp incorporated)
          Validate this instance for incorporation.
protected  boolean validateInstanceForModification(SerialNumberedInstanceImpl instance, boolean throwException)
           
protected  void validateInstanceForModificationOrDeletion(SerialNumberedInstanceVersion version)
           
protected  void validateInstanceIfcForDeletion(SerialNumberedInstanceIfc instance)
           
protected  boolean validatePath(BaselineConfigurationVersion configuration, PathOccurrence path, StandardConfigurationService.PathProcessor processor, boolean throwException)
           
protected  boolean validateTypeForAddToConfiguration(BaselineConfigurationVersion configuration, Baselineable version, boolean throwException)
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

ADD_OR_REPLACE_ALREADY_VALIDATED_KEY

private static final String ADD_OR_REPLACE_ALREADY_VALIDATED_KEY
See Also:
Constant Field Values

DONT_PROCESS_POST_REMOVE_BASELINE_EVENT

private static final String DONT_PROCESS_POST_REMOVE_BASELINE_EVENT
See Also:
Constant Field Values

NULL

private static final Boolean NULL

instanceTablesToLock

private static String[] instanceTablesToLock
Constructor Detail

StandardConfigurationService

public StandardConfigurationService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

registerEvents

public void registerEvents(ManagerService managerService)
Register events with the passed ManagerService. The default method does nothing, subclasses should provide an overriding implementation.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
managerService - the ManagerService with which to register events.

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Dummy method to be overridden by subclasses. Subclasses should override this method and provide startup processing.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

newStandardConfigurationService

public static StandardConfigurationService newStandardConfigurationService()
                                                                    throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardConfigurationService
Throws:
WTException

storeNewConfiguration

public BaselineConfigurationVersion storeNewConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfiguredMaster configurationFor)
                                                   throws WTException
Stores the configuration. This API addresses the restriction that only one configuration master should exist for a given configured object. If one exists, it will use it. Otherwise, it'll create one.

Supported API: true

Specified by:
storeNewConfiguration in interface ConfigurationService
Parameters:
configuration -
configurationFor -
Returns:
BaselineConfigurationVersion
Throws:
WTException

storeNewConfiguration

public BaselineConfigurationVersion storeNewConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfiguredVersion configurationFor)
                                                   throws WTException
Stores the configuration and adds the version (configurationFor) to it. This API addresses the restriction that only one configuration master should exist for a given configured object. If one exists, it will use it. Otherwise, it'll create one.

Supported API: true

Specified by:
storeNewConfiguration in interface ConfigurationService
Parameters:
configuration -
configurationFor -
Returns:
BaselineConfigurationVersion
Throws:
WTException

assignToConfiguration

public BaselineConfigurationVersion assignToConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfigurationManageable version)
                                                   throws WTException
Assigns the given version to the configuration.

Supported API: true

Specified by:
assignToConfiguration in interface ConfigurationService
Parameters:
configuration -
version -
Returns:
BaselineConfigurationVersion
Throws:
WTException

removeFromConfiguration

public BaselineConfigurationVersion removeFromConfiguration(BaselineConfigurationVersion configuration,
                                                            ConfigurationManageable version)
                                                     throws WTException
Removes the given version from the configuration

Supported API: true

Specified by:
removeFromConfiguration in interface ConfigurationService
Parameters:
configuration -
version -
Returns:
BaselineConfigurationVersion
Throws:
WTException

populateConfiguration

public BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfigSpec configSpec)
                                                   throws WTException
Populates the configuration, starting at the configured version. Note that populate does not replace versions already in the configuration.

Supported API: true

Specified by:
populateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
Returns:
BaselineConfigurationVersion
Throws:
WTException

repopulateConfiguration

public BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration,
                                                            ConfigSpec configSpec)
                                                     throws WTException
Repopulate the configuration, starting at the configured version. The versions selected by the config spec will be added, replacing any versions already in the configuration.

Supported API: true

Specified by:
repopulateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
Returns:
BaselineConfigurationVersion
Throws:
WTException

populateConfiguration

public BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfigSpec configSpec,
                                                          Mastered master)
                                                   throws WTException
Populates the configuration, starting at the master. Note that populate does not replace versions already in the configuration.

Supported API: true

Specified by:
populateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
master -
Returns:
BaselineConfigurationVersion
Throws:
WTException

repopulateConfiguration

public BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration,
                                                            ConfigSpec configSpec,
                                                            Mastered master)
                                                     throws WTException
Repopulate the configuration, starting at the master. The versions selected by the config spec will be added, replacing any versions already in the configuration.

Supported API: true

Specified by:
repopulateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
master -
Returns:
BaselineConfigurationVersion
Throws:
WTException

populateConfiguration

public BaselineConfigurationVersion populateConfiguration(BaselineConfigurationVersion configuration,
                                                          ConfigSpec configSpec,
                                                          ConfigurationManageable version)
                                                   throws WTException
Populates the configuration, starting at the version. Note that while populate does not generally replace versions already in the configuration, the version passed in is assumed to be the version the caller wants in the configuration, and will replace another version already in the configuration.

Supported API: true

Specified by:
populateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
version -
Returns:
BaselineConfigurationVersion
Throws:
WTException

repopulateConfiguration

public BaselineConfigurationVersion repopulateConfiguration(BaselineConfigurationVersion configuration,
                                                            ConfigSpec configSpec,
                                                            ConfigurationManageable version)
                                                     throws WTException
Repopulate the configuration, starting at the version. The versions selected by the config spec will be added, replacing any versions already in the configuration. Note that the version passed in is added to the configuration, even if the config spec would not have selected it.

Supported API: true

Specified by:
repopulateConfiguration in interface ConfigurationService
Parameters:
configuration -
configSpec -
version -
Returns:
BaselineConfigurationVersion
Throws:
WTException

addOverride

public BaselineConfigurationOverride addOverride(BaselineConfigurationVersion configuration,
                                                 PathOccurrence path,
                                                 ConfigurationManageable version)
                                          throws WTException
Add the version as an override for the given path.

Supported API: true

Specified by:
addOverride in interface ConfigurationService
Parameters:
configuration -
path -
version -
Returns:
BaselineConfigurationOverride
Throws:
WTException

removeOverride

public BaselineConfigurationVersion removeOverride(BaselineConfigurationVersion configuration,
                                                   BaselineConfigurationOverride override)
                                            throws WTException
Remove the override.

Supported API: true

Specified by:
removeOverride in interface ConfigurationService
Parameters:
configuration -
override -
Returns:
BaselineConfigurationVersion
Throws:
WTException

replaceVersionForOverride

public BaselineConfigurationOverride replaceVersionForOverride(BaselineConfigurationOverride override,
                                                               ConfigurationManageable newVersion)
                                                        throws WTException
Assign a different version to this override.

Supported API: true

Specified by:
replaceVersionForOverride in interface ConfigurationService
Parameters:
override -
newVersion -
Returns:
BaselineConfigurationOverride
Throws:
WTException

addMapping

public SerialNumberMapping addMapping(SerialNumberedConfiguredInstanceVersion instance,
                                      PathOccurrence path,
                                      SerialNumberedInstanceIfc instanceToAllocate)
                               throws WTException
Allocate this instanceToAllocate to this instance.

Supported API: true

Specified by:
addMapping in interface ConfigurationService
Parameters:
instance -
path -
instanceToAllocate -
Returns:
SerialNumberMapping
Throws:
WTException

removeMapping

public SerialNumberedConfiguredInstanceVersion removeMapping(SerialNumberedConfiguredInstanceVersion instance,
                                                             SerialNumberMapping mapping)
                                                      throws WTException
Remove the allocation.

Supported API: true

Specified by:
removeMapping in interface ConfigurationService
Parameters:
instance -
mapping -
Returns:
SerialNumberedConfiguredInstanceVersion
Throws:
WTException

replaceMapping

public SerialNumberMapping replaceMapping(SerialNumberMapping mapping,
                                          SerialNumberedInstanceIfc instanceToAllocate)
                                   throws WTException
Assign a different instance to this allocation.

Supported API: true

Specified by:
replaceMapping in interface ConfigurationService
Parameters:
mapping -
instanceToAllocate -
Returns:
SerialNumberMapping
Throws:
WTException

changeConfiguration

public SerialNumberedConfiguredInstanceVersion changeConfiguration(SerialNumberedConfiguredInstanceVersion instance,
                                                                   SerialNumberedBaselineConfigurationVersion configuration)
                                                            throws WTException
Assign a different configuration to this instance.

Supported API: true

Specified by:
changeConfiguration in interface ConfigurationService
Parameters:
instance -
configuration -
Returns:
SerialNumberedConfiguredInstanceVersion
Throws:
WTException

setPlannedIncorporation

public SerialNumberedInstanceVersion setPlannedIncorporation(SerialNumberedInstanceVersion instance,
                                                             Timestamp plannedIncorporation)
                                                      throws WTException
Set the planned incorporation for this instance.

Supported API: true

Specified by:
setPlannedIncorporation in interface ConfigurationService
Parameters:
instance -
plannedIncorporation -
Returns:
SerialNumberedInstanceVersion
Throws:
WTException

validateInstanceForIncorporation

public void validateInstanceForIncorporation(SerialNumberedInstanceVersion instance,
                                             Timestamp incorporated)
                                      throws WTException
Validate this instance for incorporation. This requires that the configuration be complete (all elements called out are configured), that all serial numbered objects called out have instances allocated, that all of these instances have an incorporated version (as of the date specified), and that the incorporation of this instance would not result in an allocated instance being allocated into more than one instance simultaneously.

Supported API: true

Specified by:
validateInstanceForIncorporation in interface ConfigurationService
Parameters:
instance -
incorporated -
Throws:
WTException

incorporate

public SerialNumberedInstanceVersion incorporate(SerialNumberedInstanceVersion instance,
                                                 Timestamp incorporated)
                                          throws WTException
Incorporate this instance. Note, there is currently no mechanism to undo this if the user makes a mistake. The workaround is to create another version of the instance and incorporate it.

Supported API: true

Specified by:
incorporate in interface ConfigurationService
Parameters:
instance -
incorporated -
Returns:
SerialNumberedInstanceVersion
Throws:
WTException

getConfiguredVersion

public ConfiguredVersion getConfiguredVersion(BaselineConfigurationVersion configuration)
                                       throws WTException
Get the version of the ConfiguredVersion assigned to this configuration, or null if one was not assigned.

Supported API: true

Specified by:
getConfiguredVersion in interface ConfigurationService
Parameters:
configuration -
Returns:
ConfiguredVersion
Throws:
WTException

getConfiguredVersionOrMaster

public Persistable getConfiguredVersionOrMaster(BaselineConfigurationVersion configuration)
                                         throws WTException
Return the version of the ConfiguredVersion, if one is assigned to this configuration. Otherwise, return the master.

Supported API: true

Specified by:
getConfiguredVersionOrMaster in interface ConfigurationService
Parameters:
configuration -
Returns:
Persistable
Throws:
WTException

getConfigurationsNormal

public QueryResult getConfigurationsNormal(ConfigurationManageable version)
                                    throws WTException
Get the configurations this version is assigned to. Do not include any it is an override in.

Supported API: true

Specified by:
getConfigurationsNormal in interface ConfigurationService
Parameters:
version -
Returns:
QueryResult
Throws:
WTException

getConfigurationsOverrides

public QueryResult getConfigurationsOverrides(ConfigurationManageable version,
                                              boolean configurationsOnly)
                                       throws WTException
Return the configurations this version is called out as an override in.

Supported API: true

Specified by:
getConfigurationsOverrides in interface ConfigurationService
Parameters:
version -
configurationsOnly -
Returns:
QueryResult
Throws:
WTException

getConfigurationsAll

public QueryResult getConfigurationsAll(ConfigurationManageable version,
                                        boolean configurationsOnly)
                                 throws WTException
Get all the configurations this version is assigned to, as normal or override.

Supported API: true

Specified by:
getConfigurationsAll in interface ConfigurationService
Parameters:
version -
configurationsOnly -
Returns:
QueryResult
Throws:
WTException

getNormal

public QueryResult getNormal(BaselineConfigurationVersion configuration)
                      throws WTException
Get all the versions assigned to this configuration. Do not include any overrides.

Supported API: true

Specified by:
getNormal in interface ConfigurationService
Parameters:
configuration -
Returns:
QueryResult
Throws:
WTException

getOverrides

public QueryResult getOverrides(BaselineConfigurationVersion configuration,
                                QueryResult pathOccurrences,
                                boolean versionsOnly)
                         throws WTException
Get all overrides in this configuration.

Supported API: true

Specified by:
getOverrides in interface ConfigurationService
Parameters:
configuration -
pathOccurrences -
versionsOnly -
Returns:
QueryResult
Throws:
WTException

getAllOverrides

public QueryResult getAllOverrides(BaselineConfigurationVersion configuration,
                                   boolean versionsOnly)
                            throws WTException


Supported API: false

Specified by:
getAllOverrides in interface ConfigurationService
Parameters:
configuration -
versionsOnly -
Returns:
QueryResult
Throws:
WTException

getAll

public QueryResult getAll(BaselineConfigurationVersion configuration,
                          boolean versionsOnly)
                   throws WTException
Get all versions, normal and overrides, assigned to this configuration.

Supported API: true

Specified by:
getAll in interface ConfigurationService
Parameters:
configuration -
versionsOnly -
Returns:
QueryResult
Throws:
WTException

getNormalVersion

public ConfigurationManageable getNormalVersion(BaselineConfigurationVersion configuration,
                                                Mastered master)
                                         throws WTException
Get the version, if any, that is assigned to this configuration. Do not include overrides.

Supported API: true

Specified by:
getNormalVersion in interface ConfigurationService
Parameters:
configuration -
master -
Returns:
ConfigurationManageable
Throws:
WTException

getNormalVersions

public QueryResult getNormalVersions(BaselineConfigurationVersion configuration,
                                     QueryResult masters)
                              throws WTException
Get the versions, if any, that are assigned to this configuration. Do not include overrides.

Supported API: true

Specified by:
getNormalVersions in interface ConfigurationService
Parameters:
configuration -
masters -
Returns:
QueryResult
Throws:
WTException

getOverrideVersions

public QueryResult getOverrideVersions(BaselineConfigurationVersion configuration,
                                       Mastered master,
                                       boolean versionsOnly)
                                throws WTException
Get all versions of this master, if any, that are assigned as overrides in this configuration.

Supported API: true

Specified by:
getOverrideVersions in interface ConfigurationService
Parameters:
configuration -
master -
versionsOnly -
Returns:
QueryResult
Throws:
WTException

getOverrideVersions

public QueryResult getOverrideVersions(BaselineConfigurationVersion configuration,
                                       QueryResult masters,
                                       boolean versionsOnly)
                                throws WTException
Get all versions of these masters, if any, that are assigned as overrides in this configuration.

Supported API: true

Specified by:
getOverrideVersions in interface ConfigurationService
Parameters:
configuration -
masters -
versionsOnly -
Returns:
QueryResult
Throws:
WTException

getAllInstances

public QueryResult getAllInstances(Configuration configuration)
                            throws WTException
Return all the instances that are assigned to this configuration.

Supported API: true

Specified by:
getAllInstances in interface ConfigurationService
Parameters:
configuration -
Returns:
QueryResult
Throws:
WTException

getPlannedInstances

public QueryResult getPlannedInstances(SerialNumberedBaselineConfigurationVersion configuration,
                                       Timestamp plannedFor)
                                throws WTException
Get all planned instances using this configuration.

Supported API: true

Specified by:
getPlannedInstances in interface ConfigurationService
Parameters:
configuration -
plannedFor -
Returns:
QueryResult
Throws:
WTException

getIncorporatedInstances

public QueryResult getIncorporatedInstances(SerialNumberedBaselineConfigurationVersion configuration,
                                            Timestamp incorporatedSince)
                                     throws WTException
Get all incorporated instances using this configuration.

Supported API: true

Specified by:
getIncorporatedInstances in interface ConfigurationService
Parameters:
configuration -
incorporatedSince -
Returns:
QueryResult
Throws:
WTException

getAllInstances

public QueryResult getAllInstances(SerialNumbered serialNumbered)
                            throws WTException
Get all instances of this serial numbered object.

Supported API: true

Specified by:
getAllInstances in interface ConfigurationService
Parameters:
serialNumbered -
Returns:
QueryResult
Throws:
WTException

getPlannedInstances

public QueryResult getPlannedInstances(SerialNumberedConfiguredMaster serialNumbered,
                                       Timestamp plannedFor)
                                throws WTException
Get all planned instances of this serial numbered object.

Supported API: true

Specified by:
getPlannedInstances in interface ConfigurationService
Parameters:
serialNumbered -
plannedFor -
Returns:
QueryResult
Throws:
WTException

getIncorporatedInstances

public QueryResult getIncorporatedInstances(SerialNumberedConfiguredMaster serialNumbered,
                                            Timestamp incorporatedSince)
                                     throws WTException
Get all incorporated instances of this serial numbered object.

Supported API: true

Specified by:
getIncorporatedInstances in interface ConfigurationService
Parameters:
serialNumbered -
incorporatedSince -
Returns:
QueryResult
Throws:
WTException

getAllInstances

public QueryResult getAllInstances(ConfigurationManageable version)
                            throws WTException
Get all the instances which use a configuration which configures this version.

Supported API: true

Specified by:
getAllInstances in interface ConfigurationService
Parameters:
version -
Returns:
QueryResult
Throws:
WTException

getPlannedInstances

public QueryResult getPlannedInstances(ConfigurationManageable version,
                                       Timestamp plannedFor)
                                throws WTException
Get all the planned instances which use a configuration which configures this version.

Supported API: true

Specified by:
getPlannedInstances in interface ConfigurationService
Parameters:
version -
plannedFor -
Returns:
QueryResult
Throws:
WTException

getIncorporatedInstances

public QueryResult getIncorporatedInstances(ConfigurationManageable version,
                                            Timestamp incorporatedSince)
                                     throws WTException
Get all the incorporated instances which use a configuration which configures this version.

Supported API: true

Specified by:
getIncorporatedInstances in interface ConfigurationService
Parameters:
version -
incorporatedSince -
Returns:
QueryResult
Throws:
WTException

getUnmappedInstances

public QueryResult getUnmappedInstances(SerialNumbered serialNumbered,
                                        Timestamp notIncorporatedByContextAsOf)
                                 throws WTException
Get all the instances that have not been allocated into another instance.

Supported API: true

Specified by:
getUnmappedInstances in interface ConfigurationService
Parameters:
serialNumbered -
notIncorporatedByContextAsOf -
Returns:
QueryResult
Throws:
WTException

getUnmappedInstances

public QueryResult getUnmappedInstances(SerialNumbered serialNumbered,
                                        Timestamp notIncorporatedByContextAsOf,
                                        QuerySpec instanceSpec)
                                 throws WTException
Get all the instances that have not been allocated into another instance. Use the query spec as a filter.

Supported API: true

Specified by:
getUnmappedInstances in interface ConfigurationService
Parameters:
serialNumbered -
notIncorporatedByContextAsOf -
instanceSpec -
Returns:
QueryResult
Throws:
WTException

getMappedInstances

public QueryResult getMappedInstances(SerialNumberedConfiguredInstanceVersion serialNumbered,
                                      Timestamp incorporated)
                               throws WTException
Get all the instances of this serial numbered object that have been incorporated as of the given timestamp.

Supported API: true

Specified by:
getMappedInstances in interface ConfigurationService
Parameters:
serialNumbered -
incorporated -
Returns:
QueryResult
Throws:
WTException

getMappedIntoInstance

public SerialNumberedConfiguredInstanceVersion getMappedIntoInstance(SerialNumberedInstanceImpl serialNumbered,
                                                                     Timestamp incorporated)
                                                              throws WTException
Get the instance, incorporated as of the given timestamp, that allocates this instance.

Supported API: true

Specified by:
getMappedIntoInstance in interface ConfigurationService
Parameters:
serialNumbered -
incorporated -
Returns:
SerialNumberedConfiguredInstanceVersion
Throws:
WTException

getConfigurations

public QueryResult getConfigurations(ConfiguredVersion configuredVersion)
                              throws WTException
Get the configurations of this configured version that configure it.

Supported API: true

Specified by:
getConfigurations in interface ConfigurationService
Parameters:
configuredVersion -
Returns:
QueryResult
Throws:
WTException

getAllConfigurations

public QueryResult getAllConfigurations(ConfiguredMaster configuredMaster)
                                 throws WTException
Get all the configurations of this configured master.

Supported API: true

Specified by:
getAllConfigurations in interface ConfigurationService
Parameters:
configuredMaster -
Returns:
QueryResult
Throws:
WTException

removeDupes

protected QueryResult removeDupes(QueryResult qr,
                                  boolean otherSideOnly)

getValidClassForRole

protected Class getValidClassForRole(Class objectClass,
                                     String role)
                              throws WTIntrospectionException
Throws:
WTIntrospectionException

setConfiguration

protected void setConfiguration(QueryResult qr,
                                Configuration configuration)
                         throws WTPropertyVetoException,
                                WTException
Throws:
WTPropertyVetoException
WTException

setConfiguration

protected void setConfiguration(QueryResult qr,
                                Hashtable configurationHash)
                         throws WTPropertyVetoException,
                                WTException
Throws:
WTPropertyVetoException
WTException

getAndSetConfiguration

protected void getAndSetConfiguration(QueryResult qr)
                               throws WTPropertyVetoException,
                                      WTException
Throws:
WTPropertyVetoException
WTException

getAllInstances

protected QueryResult getAllInstances(QueryResult configurations)
                               throws WTException
Throws:
WTException

getPlannedInstances

protected QueryResult getPlannedInstances(QueryResult configurations,
                                          Timestamp plannedFor)
                                   throws WTException
Throws:
WTException

getIncorporatedInstances

protected QueryResult getIncorporatedInstances(QueryResult configurations,
                                               Timestamp incorporatedSince)
                                        throws WTException
Throws:
WTException

validatePath

protected boolean validatePath(BaselineConfigurationVersion configuration,
                               PathOccurrence path,
                               StandardConfigurationService.PathProcessor processor,
                               boolean throwException)
                        throws WTException
Throws:
WTException

getIdentityParms

private void getIdentityParms(ConfigurationManageable version,
                              Object[] parms,
                              int index)

add

protected void add(BaselineConfigurationVersion configuration,
                   ConfigurationManageable version)
            throws WTException
Throws:
WTException

remove

protected void remove(BaselineConfigurationVersion configuration,
                      BaselineMember member)
               throws WTException
Throws:
WTException

replace

protected void replace(BaselineConfigurationVersion configuration,
                       ConfigurationManageable version,
                       BaselineMember member)
                throws WTException
Throws:
WTException

validateTypeForAddToConfiguration

protected boolean validateTypeForAddToConfiguration(BaselineConfigurationVersion configuration,
                                                    Baselineable version,
                                                    boolean throwException)
                                             throws WTException
Throws:
WTException

preValidateCollectionForAddToConfiguration

protected WTCollection preValidateCollectionForAddToConfiguration(BaselineConfigurationVersion configuration,
                                                                  WTCollection baselineables,
                                                                  boolean throwException)
                                                           throws WTException
Returns the sub-collection of valid objects for the configuration (if throwException is false) or throws an exception if there are invalid objects. Note: this check simply checks the objects themselves, using no database hits. Passing this test does not imply the objects can actually be added to the baseline (this requires the further check that the objects are used by objects already assigned to the configuration).

Throws:
WTException

getNavigator

protected Navigator getNavigator(BaselineConfigurationVersion configuration,
                                 ConfigSpec configSpec)
                          throws WTException
Throws:
WTException

validateAddToConfiguration

protected void validateAddToConfiguration(BaselineConfigurationVersion configuration,
                                          ConfigurationManageable version)
                                   throws WTException
Throws:
WTException

validateAddToConfiguration

protected void validateAddToConfiguration(BaselineConfigurationVersion configuration,
                                          WTCollection configurationManageables)
                                   throws WTException
Throws:
WTException

potentiallyDeleteOverrides

protected void potentiallyDeleteOverrides(BaselineConfigurationVersion configuration,
                                          WTCollection configurationManageables)
                                   throws WTException
Delete overrides that reference the same iterations as those replacing existing iterations in the configuration.

Throws:
WTException

potentiallyMoveOverridesToNormal

protected void potentiallyMoveOverridesToNormal(BaselineConfigurationVersion configuration,
                                                WTCollection configurationManageables)
                                         throws WTException
If there are overrides for the base iterations being deleted, make one of them a base iteration.

Throws:
WTException

potentiallyClearDates

protected void potentiallyClearDates(SerialNumberedInstanceVersion version)
                              throws WTException
Throws:
WTException

validateConfigurationForModificationOrDeletion

protected void validateConfigurationForModificationOrDeletion(Configuration version,
                                                              boolean forModification)
                                                       throws WTException
Throws:
WTException

validateInstanceForModificationOrDeletion

protected void validateInstanceForModificationOrDeletion(SerialNumberedInstanceVersion version)
                                                  throws WTException
Throws:
WTException

validateConfigurationsForModificationOrDeletion

protected void validateConfigurationsForModificationOrDeletion(WTCollection configurations,
                                                               boolean forModification)
                                                        throws WTException
Do not allow a configuration to be modified if it's associated to an incorporated instance. Likewise, do not allow a configuration to be deleted if it's associated to an(y) instance.

Throws:
WTException

validateConfigurationManageableForModificationOrDeletion

protected void validateConfigurationManageableForModificationOrDeletion(WTCollection configurationManageables)
                                                                 throws WTException
Do not allow a configuration manageable object to be modified if it's an override in a configuration.

Throws:
WTException

validateInstanceIfcForDeletion

protected void validateInstanceIfcForDeletion(SerialNumberedInstanceIfc instance)
                                       throws WTException
Throws:
WTException

deleteInstancesOf

protected void deleteInstancesOf(SerialNumbered serialNumbered)
                          throws WTException
Throws:
WTException

deleteConfigurationsOf

protected void deleteConfigurationsOf(ConfiguredMaster configuration)
                               throws WTException
Throws:
WTException

removeVersionRecursively

protected void removeVersionRecursively(BaselineConfigurationVersion configuration,
                                        ConfigurationManageable version,
                                        ConfigurationDelegate delegate)
                                 throws WTException,
                                        WTPropertyVetoException
Throws:
WTException
WTPropertyVetoException

cleanupCommittedConfiguration

protected void cleanupCommittedConfiguration(BaselineConfigurationVersion configuration)
                                      throws WTException
Throws:
WTException

validateInstanceForModification

protected boolean validateInstanceForModification(SerialNumberedInstanceImpl instance,
                                                  boolean throwException)
                                           throws WTException
Throws:
WTException

intValidateInstanceForIncorporation

protected void intValidateInstanceForIncorporation(SerialNumberedInstanceVersion instance,
                                                   Timestamp incorporated)
                                            throws WTException
Throws:
WTException