com.metamatrix.platform.config.spi
Interface ConfigurationTransaction

All Superinterfaces:
TransactionInterface
All Known Implementing Classes:
XMLConfigurationConnector

public interface ConfigurationTransaction
extends TransactionInterface


Nested Class Summary
static class ConfigurationTransaction.ComponentTypeSearch
           
 
Method Summary
 void commit()
          Make all changes made during this transaction's lifetime and release any data source locks currently held by the associated Connection.
 boolean doesConfigurationExist(java.lang.String configurationName)
          Returns a boolean indicating if the configuration already exist or not.
 java.util.Set executeActions(java.util.List actions, java.lang.String principalName)
          Execute the specified actions.
 java.util.Collection getAllComponentTypes(boolean includeDeprecated)
          Returns a Map of type ComponentType keyed by ComponentTypeID.
 java.util.Collection getAllObjectsForConfigurationModel(ConfigurationID configID)
          Returns a Collection containing the Configuration object for the specified ConfigurationID id, and also any dependant objects needed to fully define this configuration, such as Host objects, ComponentType objects, and ComponentTypeDefn objects.
 ComponentDefn getComponentDefinition(ComponentDefnID componentDefnID, ConfigurationID configurationID)
          Returns a ComponentDefn for the specified ComponentDefnID and ConfigurationID.
 java.util.Map getComponentDefinitions(ConfigurationID configurationID)
          Obtain the list of component definition instances that makeup the configuration.
 java.lang.String getComponentPropertyValue(ComponentObjectID componentObjectID, ComponentTypeID typeID, java.lang.String propertyName)
          Obtain the value for a specific property name
 ComponentType getComponentType(ComponentTypeID id)
          Returns a ComponentType for the specified ComponentTypeID
 java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID)
          Returns a Map of component type definitions for the ComponentTypeID specified, keyed by the ComponentTypeDefnID
 Configuration getConfiguration(java.lang.String configurationName)
          Obtain a configuration that contains all its components and the deployed components.
 ConfigurationModelContainer getConfigurationModel(java.lang.String configName)
          Returns the configuration model that contains everything a server needs to start.
 java.util.Collection getConnectionPools(ConfigurationID configurationID)
          Returns a Collection of ResourceDescriptor for all resource pools defined to the system.
 Configuration getCurrentConfiguration()
          Deprecated. as of v 2.0 beta 1 use getDesignatedConfiguration(java.lang.String)
 ConfigurationID getCurrentConfigurationID()
          Deprecated. as of v 2.0 beta 1 use getDesignatedConfigurationID(java.lang.String)
 java.util.List getDeployedComponents(ConfigurationID configrationID)
          Obtain the list of deployed components that represent the configuration when deployed.
 Configuration getDesignatedConfiguration(java.lang.String designation)
          Returns one of the well-known system configurations, either the operational configuration, the next startup configuration, or the startup configuration.
 ConfigurationID getDesignatedConfigurationID(java.lang.String designation)
          Returns the ID of one of the well-known system configurations, either the operational configuration, the next startup configuration, or the startup configuration.
 java.util.Collection getHosts()
          Obtain the list of registered host
 java.util.Collection getMonitoredComponentTypes(boolean includeDeprecated)
          Returns a Map of type ComponentType keyed by ComponentTypeID that are flagged as being monitored.
 java.util.Collection getProductTypes(boolean includeDeprecated)
          Returns a Map of type ProductType keyed by ProductTypeID.
 java.util.Collection getResources()
          Returns a Collection of ResourceDescriptor for all internal resources defined to the system.
 java.util.Collection getResources(ComponentTypeID componentTypeID)
          Returns a Collection of ResourceDescriptor that are of the specified resource type.
 java.util.Date getServerStartupTime()
          Return the time the server was started.
 ConfigurationID overwriteConfiguration(ConfigurationID configToCopy, ConfigurationID configToOverwrite, java.lang.String principalName)
          Overwrite the specified configuration by copying another configuration over it.
 void rollback()
          Drops all changes made during this transaction's lifetime and release any data source locks currently held by the associated Connection.
 void saveResources(java.util.Collection resourceDescriptors, java.lang.String principalName)
          Save the resource changes based on each ResourceDescriptor in the collection.
 
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface
close, isClosed, isReadonly
 

Method Detail

commit

void commit()
            throws ManagedConnectionException
Make all changes made during this transaction's lifetime and release any data source locks currently held by the associated Connection. A transaction can be committed or rolled back any number of times throughout its lifetime, and throughout its lifetime the transaction is guaranteed to have the same connection.

Specified by:
commit in interface TransactionInterface
Throws:
ManagedConnectionException - if an error occurred within or during communication with the associated connection.

rollback

void rollback()
              throws ManagedConnectionException
Drops all changes made during this transaction's lifetime and release any data source locks currently held by the associated Connection. Once this method is executed, the transaction (after rolling back) becomes invalid, and the connection referenced by this transaction is returned to the pool.

Calling this method on a read-only transaction is unneccessary (and discouraged, since the implementation does nothing in that case anyway).

Specified by:
rollback in interface TransactionInterface
Throws:
ManagedConnectionException - if an error occurred within or during communication with the associated connection.

getCurrentConfiguration

Configuration getCurrentConfiguration()
                                      throws ConfigurationException
Deprecated. as of v 2.0 beta 1 use getDesignatedConfiguration(java.lang.String)

Returns the current deployed Configuration. Note, this configuration may not match the actual configuration the system is currently executing under due to administrative task that can be done to tune the system. Those administrative task do not change the actual Configuration stored in the ConfigurationService.

Returns:
Configuration that is currently in use
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getDesignatedConfiguration

Configuration getDesignatedConfiguration(java.lang.String designation)
                                         throws ConfigurationException
Returns one of the well-known system configurations, either the operational configuration, the next startup configuration, or the startup configuration. Use SystemConfigurationNames to supply the String parameter.

Parameters:
designation - String indicating which of the system configurations is desired; use one of the SystemConfigurationNames constants
Returns:
the desired Configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getConfiguration

Configuration getConfiguration(java.lang.String configurationName)
                               throws ConfigurationException
Obtain a configuration that contains all its components and the deployed components.

Parameters:
configurationName -
Returns:
the serializable Configuration instance
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getConfigurationModel

ConfigurationModelContainer getConfigurationModel(java.lang.String configName)
                                                  throws ConfigurationException
Returns the configuration model that contains everything a server needs to start. param configName is the name of the configuration model to return

Returns:
ConfigurationModelContainer
Throws:
ConfigurationException

getComponentDefinition

ComponentDefn getComponentDefinition(ComponentDefnID componentDefnID,
                                     ConfigurationID configurationID)
                                     throws ConfigurationException
Returns a ComponentDefn for the specified ComponentDefnID and ConfigurationID. If the configuration is null the parent name from the componentID will be used.
The reason for allowing the configurationID to be optionally specified is so that the same componentID can be used to obtain a componentDefn from different configurations. Otherwise, the requestor would have to create a new of componetDefnID for each configuration.

Parameters:
componentDefnID - contains all the ids for which componet defns to be returned
configurationID - is the configuration from which the component defns are to be derived; optional, nullalble
Returns:
Collection of ComponentDefn objects
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getComponentDefinitions

java.util.Map getComponentDefinitions(ConfigurationID configurationID)
                                      throws ConfigurationException
Obtain the list of component definition instances that makeup the configuration.

Returns:
the list of Component instances
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getConnectionPools

java.util.Collection getConnectionPools(ConfigurationID configurationID)
                                        throws ConfigurationException
Returns a Collection of ResourceDescriptor for all resource pools defined to the system.

Parameters:
configurationID - is the configuration from which the component defns are to be derived
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getResources

java.util.Collection getResources()
                                  throws ConfigurationException
Returns a Collection of ResourceDescriptor for all internal resources defined to the system. The internal resources are not managed with the other configuration related information. They are not dictated based on which configuration they will operate (i.e., next startup or operational);

Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getResources

java.util.Collection getResources(ComponentTypeID componentTypeID)
                                  throws ConfigurationException
Returns a Collection of ResourceDescriptor that are of the specified resource type.

Parameters:
componentTypeID - that identifies the type of resources to be returned
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

saveResources

void saveResources(java.util.Collection resourceDescriptors,
                   java.lang.String principalName)
                   throws ConfigurationException
Save the resource changes based on each ResourceDescriptor in the collection.

Parameters:
resourceDescriptors - for the resources to be changed *
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getComponentPropertyValue

java.lang.String getComponentPropertyValue(ComponentObjectID componentObjectID,
                                           ComponentTypeID typeID,
                                           java.lang.String propertyName)
                                           throws ConfigurationException
Obtain the value for a specific property name

Parameters:
componentObjectID - is the component for which the value is to be retrieved for
typeID - is the type of the component the object represents
propertyName - is the name of the property to obtain
Returns:
the property value
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getComponentTypeDefinitions

java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID)
                                                 throws ConfigurationException
Returns a Map of component type definitions for the ComponentTypeID specified, keyed by the ComponentTypeDefnID

Parameters:
componentTypeID - for the ComponentTypeID that has definitions defined.
Returns:
Collection of component type difinitions
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getDeployedComponents

java.util.List getDeployedComponents(ConfigurationID configrationID)
                                     throws ConfigurationException
Obtain the list of deployed components that represent the configuration when deployed.

Returns:
the list of DeployedComponents
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getComponentType

ComponentType getComponentType(ComponentTypeID id)
                               throws ConfigurationException
Returns a ComponentType for the specified ComponentTypeID

Parameters:
id - is for the requested component type.
Returns:
ComponentType based on the id
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getAllComponentTypes

java.util.Collection getAllComponentTypes(boolean includeDeprecated)
                                          throws ConfigurationException
Returns a Map of type ComponentType keyed by ComponentTypeID.

Parameters:
includeDeprecated - true if class names that have been deprecated should be included in the returned list, or false if only non-deprecated constants should be returned.
Returns:
Collection of type ComponentType
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getProductTypes

java.util.Collection getProductTypes(boolean includeDeprecated)
                                     throws ConfigurationException
Returns a Map of type ProductType keyed by ProductTypeID.

Parameters:
includeDeprecated - true if class names that have been deprecated should be included in the returned list, or false if only non-deprecated constants should be returned.
Returns:
Collection of type ComponentType
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getCurrentConfigurationID

ConfigurationID getCurrentConfigurationID()
                                          throws ConfigurationException
Deprecated. as of v 2.0 beta 1 use getDesignatedConfigurationID(java.lang.String)

Returns the current configurationID

Returns:
ConfigurationID for the current configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getDesignatedConfigurationID

ConfigurationID getDesignatedConfigurationID(java.lang.String designation)
                                             throws ConfigurationException
Returns the ID of one of the well-known system configurations, either the operational configuration, the next startup configuration, or the startup configuration. Use SystemConfigurationNames to supply the String parameter.

Parameters:
designation - String indicating which of the system configurations is desired; use one of the SystemConfigurationNames constants
Returns:
the desired Configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getMonitoredComponentTypes

java.util.Collection getMonitoredComponentTypes(boolean includeDeprecated)
                                                throws ConfigurationException
Returns a Map of type ComponentType keyed by ComponentTypeID that are flagged as being monitored. A component of this type is considered to be available for monitoring statistics.

Parameters:
includeDeprecated - true if class names that have been deprecated should be included in the returned list, or false if only non-deprecated constants should be returned.
Returns:
Collection of type ComponentType keyed by ComponentTypeID
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getHosts

java.util.Collection getHosts()
                              throws ConfigurationException
Obtain the list of registered host

Returns:
Collection of Hosts
Throws:
ConfigurationException - if an error occurred within or during communication with the Metadata Service.

getServerStartupTime

java.util.Date getServerStartupTime()
                                    throws ConfigurationException
Return the time the server was started. If the state of the server is not "Started" then a null is returned.

Returns:
Date Time server was started.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getAllObjectsForConfigurationModel

java.util.Collection getAllObjectsForConfigurationModel(ConfigurationID configID)
                                                        throws ConfigurationException

Returns a Collection containing the Configuration object for the specified ConfigurationID id, and also any dependant objects needed to fully define this configuration, such as Host objects, ComponentType objects, and ComponentTypeDefn objects.

A Configuration instance contains all of the ComponentDefn objects that "belong" to just that Configuration model: VM component definitions, service component definitions, product service configurations, and deployed components. Objects such as Host objects, ComponentType objects, ComponentTypeDefn, Resources, and ConnectorBinding objects describe or support ComponentDefns, but are not contained by a Configuration. Therefore, they are included in this Collection for convenience.

The Collection will contain instances of BaseObject. Specifically, this Map should contain the objects for: one configuration object, one or more Host objects, one or more ComponentType objects, and one or more ComponentTypeDefn objects.

This method is intended to facilitate exporting a configuration to XML.

Here is what the Collection would contain at runtime:

 Configuration instance
 Host instance1
 Host instance2
 ...
 ConnectorBinding instance1
 ConnectorBinding instance2
 ...
 SharedResource intance1
 SharedResource instance
 ...
 ComponentType instance1
 ComponentType instance2
 ...
 ComponentTypeDefn instance1
 ComponentTypeDefn instance2
 

Parameters:
configID - ID Of a Configuration
Returns:
Collection of BaseObject instances
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

doesConfigurationExist

boolean doesConfigurationExist(java.lang.String configurationName)
                               throws ConfigurationException
Returns a boolean indicating if the configuration already exist or not.

Parameters:
configurationName - the identifier of the configuration
Returns:
boolean of false if the configuration is found
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

executeActions

java.util.Set executeActions(java.util.List actions,
                             java.lang.String principalName)
                             throws InvalidComponentException,
                                    ConfigurationException
Execute the specified actions.

Parameters:
List - of actions to be performed
principalName - the name of the principal that is requesting the lock
Returns:
the set of BaseID objects denoting which objects were affected by these actions
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
InvalidComponentException

overwriteConfiguration

ConfigurationID overwriteConfiguration(ConfigurationID configToCopy,
                                       ConfigurationID configToOverwrite,
                                       java.lang.String principalName)
                                       throws InvalidConfigurationException,
                                              ConfigurationException
Overwrite the specified configuration by copying another configuration over it. This includes assigning any designations of the configuration to be overwritten to the configuration to be copied. Both configurations must already be in the data source. (This method is needed to implement baselining).

Parameters:
configToCopy - the ConfigurationID of the Configuration to be copied
configToCopy - the ConfigurationID of the Configuration to be deleted - the "configToCopy" will be overwritten in its place.
principalName - the name of the principal that is requesting the modification
Returns:
the new ID of the newly-copied Configuration
Throws:
InvalidConfigurationException - if either ConfigurationID is invalid.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.


Copyright © 2009. All Rights Reserved.