|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.common.connection.BaseTransaction
com.metamatrix.platform.config.spi.xml.XMLConfigurationConnector
public class XMLConfigurationConnector
JDBCConfigurationTransaction is responsible for executing and managing transactions. History: 12/20/00 vhalbert - when adding/updating property values, the values will be trimmed. This is because the use of the value later is incorrect if the user does not trim. Thereforre, it is easier to do this trimming one time and in one location.
and updateProperty()
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.metamatrix.platform.config.spi.ConfigurationTransaction |
---|
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(boolean doAdjust,
java.util.List actions,
java.lang.String principalName)
|
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 componentID,
ConfigurationID configurationID)
Obtain the component definition |
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. |
ConfigurationInfo |
getConfigurationInfo(java.lang.String configurationName)
Obtain the configuration info for the specified configuration and version. |
ConfigurationModelContainer |
getConfigurationModel(java.lang.String configName)
Returns the configuration model that contains everything a server needs to start. |
protected XMLConfigurationReader |
getConfigurationReader()
|
protected XMLConfigurationWriter |
getConfigurationWriter()
|
java.util.Collection |
getConnectionPools(ConfigurationID configurationID)
Deprecated. 5.5.4 |
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) |
DeployedComponent |
getDeployedComponent(DeployedComponentID deployedComponentID)
Obtain the deployed component |
java.util.List |
getDeployedComponents(ConfigurationID configurationID)
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. |
int |
getServerStartupState()
|
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 class com.metamatrix.common.connection.BaseTransaction |
---|
close, finalize, getConnection, getRollbackOnFinalize, isClosed, isEnded, isReadonly, setRollbackOnFinalize |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.metamatrix.common.connection.TransactionInterface |
---|
close, isClosed, isReadonly |
Method Detail |
---|
public Configuration getCurrentConfiguration() throws ConfigurationException
getDesignatedConfiguration(java.lang.String)
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
.
getCurrentConfiguration
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public Configuration getDesignatedConfiguration(java.lang.String designation) throws ConfigurationException
system configurations
, either
the
operational configuration
,
the
next startup configuration
,
or the
startup configuration
. Use
SystemConfigurationNames
to supply the String parameter.
getDesignatedConfiguration
in interface ConfigurationTransaction
designation
- String indicating which of the system configurations
is desired; use one of the SystemConfigurationNames
constants
ConfigurationException
- if an error occurred within or during
communication with the Configuration Service.public Configuration getConfiguration(java.lang.String configurationName) throws ConfigurationException
getConfiguration
in interface ConfigurationTransaction
configurationName
-
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public ConfigurationModelContainer getConfigurationModel(java.lang.String configName) throws ConfigurationException
ConfigurationTransaction
getConfigurationModel
in interface ConfigurationTransaction
ConfigurationException
public ConfigurationInfo getConfigurationInfo(java.lang.String configurationName) throws InvalidNameException, ConfigurationException
configurationName
-
InvalidNameException
- if the configuration does not exist
ConfigurationException
- when an error occurred within or during communication with the Configuration Service.public ConfigurationID getCurrentConfigurationID() throws ConfigurationException
getDesignatedConfigurationID(java.lang.String)
ConfigurationTransaction
getCurrentConfigurationID
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public ConfigurationID getDesignatedConfigurationID(java.lang.String designation) throws ConfigurationException
ConfigurationTransaction
system configurations
, either
the
operational configuration
,
the
next startup configuration
,
or the
startup configuration
. Use
SystemConfigurationNames
to supply the String parameter.
getDesignatedConfigurationID
in interface ConfigurationTransaction
designation
- String indicating which of the system configurations
is desired; use one of the SystemConfigurationNames
constants
ConfigurationException
- if an error occurred within or during
communication with the Configuration Service.public java.util.Map getComponentDefinitions(ConfigurationID configurationID) throws ConfigurationException
getComponentDefinitions
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getConnectionPools(ConfigurationID configurationID) throws ConfigurationException
ConfigurationTransaction
ResourceDescriptor
for all resource pools defined to the system.
getConnectionPools
in interface ConfigurationTransaction
configurationID
- is the configuration from which the component defns are to
be derived
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getResources() throws ConfigurationException
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);
getResources
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getResources(ComponentTypeID componentTypeID) throws ConfigurationException
ResourceDescriptor
that are of the specified resource type.
getResources
in interface ConfigurationTransaction
componentType
- that identifies the type of resources to be returned
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.lang.String getComponentPropertyValue(ComponentObjectID componentObjectID, ComponentTypeID typeID, java.lang.String propertyName) throws ConfigurationException
ConfigurationTransaction
getComponentPropertyValue
in interface ConfigurationTransaction
componentObjectID
- is the component for which the value is to be retrieved fortypeID
- is the type of the component the object representspropertyName
- is the name of the property to obtain
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public ComponentDefn getComponentDefinition(ComponentDefnID componentID, ConfigurationID configurationID) throws ConfigurationException
getComponentDefinition
in interface ConfigurationTransaction
componentID
- contains all the ids for which componet defns to be returnedconfigurationID
- is the configuration from which the component defns are to
be derived; optional, nullalble
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID) throws ConfigurationException
ConfigurationTransaction
ComponentTypeID
specified,
keyed by the ComponentTypeDefnID
getComponentTypeDefinitions
in interface ConfigurationTransaction
componentTypeID
- for the ComponentTypeID that has definitions defined.
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.List getDeployedComponents(ConfigurationID configurationID) throws ConfigurationException
getDeployedComponents
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public DeployedComponent getDeployedComponent(DeployedComponentID deployedComponentID) throws ConfigurationException
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getHosts() throws ConfigurationException
getHosts
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during communication with the Metadata Service.public ComponentType getComponentType(ComponentTypeID id) throws ConfigurationException
ConfigurationTransaction
ComponentType
for the specified ComponentTypeID
getComponentType
in interface ConfigurationTransaction
id
- is for the requested component type.
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getAllComponentTypes(boolean includeDeprecated) throws ConfigurationException
ConfigurationTransaction
Map
of type ComponentType
keyed by ComponentTypeID.
getAllComponentTypes
in interface ConfigurationTransaction
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.
ComponentType
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getProductTypes(boolean includedeprecated) throws ConfigurationException
ConfigurationTransaction
Map
of type ProductType
keyed by ProductTypeID.
getProductTypes
in interface ConfigurationTransaction
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.
ComponentType
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getAllObjectsForConfigurationModel(ConfigurationID configID) throws ConfigurationException
ConfigurationTransaction
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
getAllObjectsForConfigurationModel
in interface ConfigurationTransaction
configID
- ID Of a Configuration
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Collection getMonitoredComponentTypes(boolean includeDeprecated) throws ConfigurationException
ConfigurationTransaction
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.
getMonitoredComponentTypes
in interface ConfigurationTransaction
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.
ComponentType
keyed by ComponentTypeID
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public java.util.Date getServerStartupTime() throws ConfigurationException
getServerStartupTime
in interface ConfigurationTransaction
ConfigurationException
- if an error occurred within or during
communication with the Configuration Service.public int getServerStartupState() throws ConfigurationException
ConfigurationException
public boolean doesConfigurationExist(java.lang.String configurationName) throws ConfigurationException
doesConfigurationExist
in interface ConfigurationTransaction
configurationName
- the identifier of the configuration
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public void commit() throws ManagedConnectionException
BaseTransaction
commit
in interface TransactionInterface
commit
in interface ConfigurationTransaction
commit
in class BaseTransaction
ManagedConnectionException
- if an error occurred within or during communication with the associated connection.public void rollback() throws ManagedConnectionException
BaseTransaction
Calling this method on a read-only transaction is unneccessary (and discouraged, since the implementation does nothing in that case anyway).
rollback
in interface TransactionInterface
rollback
in interface ConfigurationTransaction
rollback
in class BaseTransaction
ManagedConnectionException
- if an error occurred within or during communication with the associated connection.public java.util.Set executeActions(java.util.List actions, java.lang.String principalName) throws InvalidComponentException, ConfigurationException
ConfigurationTransaction
executeActions
in interface ConfigurationTransaction
principalName
- the name of the principal that is requesting the lock
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.
InvalidComponentException
public java.util.Set executeActions(boolean doAdjust, java.util.List actions, java.lang.String principalName) throws InvalidComponentException, ConfigurationException
InvalidComponentException
ConfigurationException
public ConfigurationID overwriteConfiguration(ConfigurationID configToCopy, ConfigurationID configToOverwrite, java.lang.String principalName) throws InvalidConfigurationException, ConfigurationException
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).
overwriteConfiguration
in interface ConfigurationTransaction
configToCopy
- the ConfigurationID of the Configuration to be
copiedconfigToCopy
- 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
InvalidConfigurationException
- if either ConfigurationID is invalid.
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.public void saveResources(java.util.Collection resourceDescriptors, java.lang.String principalName) throws ConfigurationException
ResourceDescriptor
in the collection.
saveResources
in interface ConfigurationTransaction
resourceDescriptors
- for the resources to be changed *
ConfigurationException
- if an error occurred within or during communication with the Configuration Service.protected XMLConfigurationReader getConfigurationReader() throws ConfigurationException
ConfigurationException
protected XMLConfigurationWriter getConfigurationWriter() throws ConfigurationException
ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |