com.metamatrix.platform.config.service
Class ConfigurationServiceImpl

java.lang.Object
  extended by com.metamatrix.platform.service.controller.AbstractService
      extended by com.metamatrix.platform.config.service.ConfigurationServiceImpl
All Implemented Interfaces:
EventObjectListener, ConfigurationServiceInterface, ServiceInterface, java.util.EventListener

public class ConfigurationServiceImpl
extends AbstractService
implements ConfigurationServiceInterface

Caching only Hosts and ComponentTypes - but these will be updated by a scheduled thread


Field Summary
 
Fields inherited from interface com.metamatrix.platform.config.api.service.ConfigurationServiceInterface
NAME
 
Fields inherited from interface com.metamatrix.platform.service.api.ServiceInterface
WAIT_TO_DIE_TIME
 
Constructor Summary
ConfigurationServiceImpl()
           
 
Method Summary
 Host addHost(java.lang.String hostName, java.lang.String principalName, java.util.Properties properties)
          Add Host to Configuration Add a new Host to the System (MetaMatrix Cluster)
 VMComponentDefn addProcess(java.lang.String processName, java.lang.String hostName, java.lang.String principalName, java.util.Properties properties)
          Add Process for the specified Host to Configuration Add a new Virtuial Machine to the System (MetaMatrix Cluster)
protected  void addProperty(java.util.Properties source, java.lang.String sourceName, java.util.Properties props, java.lang.String propName)
           
 void baselineCurrentConfiguration(java.lang.String principalName)
          Baselines the realtime portion of the current (operational) configuration into the next-startup configuration.
 java.util.List checkPropertiesDecryptable(java.util.List defns)
          Check whether the encrypted properties for the specified ComponentDefns can be decrypted.
 boolean checkPropertiesDecryptable(java.util.Properties props, java.lang.String componentTypeIdentifier)
          Check whether the given properties pertaining to the given component (name and type) contain at least one value that the server cannot decrypt with its current keystore.
 void clearHistory()
          Clear the history of all actions without undoing any of them.
protected  void closeService()
          Close the service to new work if applicable.
 ConnectorBinding createConnectorBinding(java.lang.String connectorBindingName, java.lang.String connectorType, java.lang.String pscName, java.lang.String principalName, java.util.Properties properties)
          Deploy a new Connector Binding into Configuration
 ConfigurationObjectEditor createEditor()
          Returns a ConfigurationObjectEditor to perform editing operations on a configuration type object.
 void delete(ComponentObject theObject, boolean theDeleteDependenciesFlag, java.lang.String principalName)
          Deletes a component object.
 void delete(ComponentType componentType, java.lang.String principalName)
          Delete a Component Type
 java.util.Collection deployPSC(Host theHost, VMComponentDefn theProcess, java.lang.String pscName, java.lang.String principalName)
          Deploys the ServiceComponentDefns indicated by the ProductServiceConfig, contained by the Configuration, onto the specified Host and VM.
 java.util.Set executeInsertTransaction(ConfigurationID assignConfigurationID, java.util.List actions, java.lang.String principalName)
          Execute a list of insert actions and for actions on objects of type component object, it will have its configuration id resassigned, and optionally return the set of objects or object IDs that were affected/modified by the action.
 java.util.Set executeTransaction(ActionDefinition action, java.lang.String principalName)
          Execute as a single transaction the specified action, and optionally return the set of objects or object IDs that were affected/modified by the action.
 java.util.Set executeTransaction(java.util.List actions, java.lang.String principalName)
          Execute as a single transaction the specified actions, and optionally return the set of objects or object IDs that were affected/modified by the action.
 java.util.Collection getAllComponentTypeDefinitions(ComponentTypeID typeID)
          Returns the all component type definitions for the specified ComponentTypeID.
 java.util.Collection getAllComponentTypes(boolean includeDeprecated)
          Returns a List of type ComponentType that represents all the ComponentTypes defined.
 java.util.Collection getAllGlobalConfigObjects()
          This method will return a Collection of objects that represent the set of global configuration objects currently represented in the configuration database.
 ComponentDefn getComponentDefn(ConfigurationID configurationID, ComponentDefnID componentDefnID)
          Returns a ComponentDefn for the specified ComponentDefnID.
 java.util.Collection getComponentDefns(java.util.Collection componentDefnIDs, ConfigurationID configurationID)
          Returns a collection of ComponentDefns for the specified collection of ComponentDefnIDs and ConfigurationID.
 ComponentType getComponentType(ComponentTypeID id)
          Returns a ComponentType for the specified ComponentTypeID
 java.util.Map getComponentTypeDefinitions(java.util.Collection componentIDs)
          Returns a Map of component type definitions for each ComponentTypeID that is contained in the passed Collection.
 java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID)
          Returns the component type definitions for the specified ComponentTypeID.
 Configuration getConfiguration(java.lang.String configName)
          Returns the named Configuration.
 java.util.Collection getConfigurationAndDependents(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.
 ConfigurationModelContainer getConfigurationModel(java.lang.String configName)
          Returns the ConfigurationModelContainer that contains everything (i.e., ComponentTypes, Shared Resources and ComponentDefns) that the server needs to start.
 Configuration getCurrentConfiguration()
          Returns the operational Configuration, which should reflect the desired runtime state of the system.
 ConfigurationID getCurrentConfigurationID()
          Returns the ID of the operational Configuration, which should reflect the desired runtime state of the system.
 java.util.Map getDependentComponentTypeDefinitions(java.util.Collection componentIDs)
          Returns a Map of all component type definitions for each ComponentTypeID that is contained in the passed Collection.
 java.util.Collection getDependentComponentTypeDefinitions(ComponentTypeID componentTypeID)
          Returns the component type definitions for the specified ComponentTypeID.
 java.util.List getHistory()
          Get the history of actions executed in transactions by this editor.
 int getHistoryLimit()
          Set the limit on the number of actions in the history.
 int getHistorySize()
          Get the number of actions that are currently in the history.
 Host getHost(HostID hostID)
          Returns a Host for the specified HostID.
 java.util.Collection getHosts()
          Returns a Collection of currently defined hosts.
 java.util.Collection getMonitoredComponentTypes(boolean includeDeprecated)
          Returns a List of type ComponentType .
 Configuration getNextStartupConfiguration()
          Returns the next startup Configuration, the Configuration that the system will next boot up with (once it is entirely shut down).
 ConfigurationID getNextStartupConfigurationID()
          Returns the ID of the next startup Configuration, which should reflect the desired runtime state of the system.
 java.util.Collection getProductReleaseInfos()
          Obtain the List of ReleaseInfo objects which represent the products of the system.
protected  ConfigurationTransaction getReadTransaction()
           
 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.
 Configuration getStartupConfiguration()
          Returns the startup Configuration, the Configuration that the system booted up with.
 ConfigurationID getStartupConfigurationID()
          Returns the ID of the startup Configuration, which should reflect the desired runtime state of the system.
protected  ConfigurationTransaction getWriteTransaction()
           
 ConnectorBinding importConnectorBinding(java.io.InputStream inputStream, java.lang.String name, java.lang.String pscName, java.lang.String principalName)
          Import a connector Binding from InputStream, and deploy it to a PSC.
 ComponentType importConnectorType(java.io.InputStream inputStream, java.lang.String name, java.lang.String principalName)
          Import a Connector Type
 void initializeForTesting(java.util.Properties env)
           
protected  void initService(java.util.Properties env)
          Perform initialization and commence processing.
protected  void killService()
          Terminate all processing and reclaim resources.
 java.lang.Object modify(ComponentObject theObject, java.util.Properties theProperties, java.lang.String principalName)
          Modify a Component in Configuration
protected  java.lang.String printActions(java.util.List actions)
           
 void saveResources(java.util.Collection resourceDescriptors, java.lang.String principalName)
          Save the resource changes based on each ResourceDescriptor in the collection.
 void setHistoryLimit(int maximumHistoryCount)
          Set the limit on the number of actions in the history.
 void setSystemPropertyValue(java.lang.String propertyName, java.lang.String propertyValue, java.lang.String principalName)
          Set System Property in Next Configuration
 java.util.Set undoActionsAsTransaction(int numberOfActions, java.lang.String principalName)
          Undo the specified number of previously-committed transactions.
 void updateSystemPropertyValues(java.util.Properties properties, java.lang.String principalName)
          Set System Property in Next Configuration
protected  void waitForServiceToClear()
          Wait until the service has completed all outstanding work.
 
Methods inherited from class com.metamatrix.platform.service.controller.AbstractService
checkState, die, dieNow, getCurrentState, getDeployedComponentID, getHostname, getID, getInitException, getInstanceName, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getResourceName, getServiceName, getServiceType, getStartTime, getStateChangeTime, init, isAlive, isClosed, isInitialized, isOpen, processEvent, registerForEvents, setInitException, unregisterForEvents, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metamatrix.platform.service.api.ServiceInterface
checkState, die, dieNow, getCurrentState, getHostname, getID, getInitException, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getServiceType, getStartTime, getStateChangeTime, init, isAlive, setInitException, updateState
 

Constructor Detail

ConfigurationServiceImpl

public ConfigurationServiceImpl()
Method Detail

initializeForTesting

public void initializeForTesting(java.util.Properties env)
                          throws java.lang.Exception
Throws:
java.lang.Exception

initService

protected void initService(java.util.Properties env)
                    throws java.lang.Exception
Perform initialization and commence processing. This method is called only once.

Specified by:
initService in class AbstractService
Throws:
java.lang.Exception

closeService

protected void closeService()
                     throws java.lang.Exception
Close the service to new work if applicable. After this method is called the service should no longer accept new work to perform but should continue to process any outstanding work. This method is called by die().

Specified by:
closeService in class AbstractService
Throws:
java.lang.Exception

waitForServiceToClear

protected void waitForServiceToClear()
                              throws java.lang.Exception
Wait until the service has completed all outstanding work. This method is called by die() just before calling dieNow().

Specified by:
waitForServiceToClear in class AbstractService
Throws:
java.lang.Exception

killService

protected void killService()
Terminate all processing and reclaim resources. This method is called by dieNow() and is only called once.

Specified by:
killService in class AbstractService

createEditor

public ConfigurationObjectEditor createEditor()
                                       throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a ConfigurationObjectEditor to perform editing operations on a configuration type object. The editing process will create actions for each specific type of editing operation. Those actions are what need to be submitted to the ConfigurationService for actual updates to occur.

Specified by:
createEditor in interface ConfigurationServiceInterface
Returns:
ConfigurationObjectEditor
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getCurrentConfigurationID

public ConfigurationID getCurrentConfigurationID()
                                          throws ConfigurationException
Returns the ID of the operational Configuration, which should reflect the desired runtime state of the system.

Specified by:
getCurrentConfigurationID in interface ConfigurationServiceInterface
Returns:
ID of operational configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getNextStartupConfigurationID

public ConfigurationID getNextStartupConfigurationID()
                                              throws ConfigurationException
Returns the ID of the next startup Configuration, which should reflect the desired runtime state of the system.

Specified by:
getNextStartupConfigurationID in interface ConfigurationServiceInterface
Returns:
ID of next startup configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

baselineCurrentConfiguration

public void baselineCurrentConfiguration(java.lang.String principalName)
                                  throws ConfigurationException
Baselines the realtime portion of the current (operational) configuration into the next-startup configuration.

Specified by:
baselineCurrentConfiguration in interface ConfigurationServiceInterface
Parameters:
principalName - the name of the principal that is requesting the baselining
Throws:
ConfigurationException

getStartupConfigurationID

public ConfigurationID getStartupConfigurationID()
                                          throws ConfigurationException
Returns the ID of the startup Configuration, which should reflect the desired runtime state of the system.

Specified by:
getStartupConfigurationID in interface ConfigurationServiceInterface
Returns:
ID of startup configuration
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getCurrentConfiguration

public Configuration getCurrentConfiguration()
                                      throws ConfigurationException
Returns the operational Configuration, which should reflect the desired runtime state of the system.

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

getNextStartupConfiguration

public Configuration getNextStartupConfiguration()
                                          throws ConfigurationException
Returns the next startup Configuration, the Configuration that the system will next boot up with (once it is entirely shut down).

Specified by:
getNextStartupConfiguration in interface ConfigurationServiceInterface
Returns:
Configuration that the system will next start up with.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getStartupConfiguration

public Configuration getStartupConfiguration()
                                      throws ConfigurationException
Returns the startup Configuration, the Configuration that the system booted up with.

Specified by:
getStartupConfiguration in interface ConfigurationServiceInterface
Returns:
Configuration that the system booted up with.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getConfigurationModel

public ConfigurationModelContainer getConfigurationModel(java.lang.String configName)
                                                  throws InvalidConfigurationException,
                                                         ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns the ConfigurationModelContainer that contains everything (i.e., ComponentTypes, Shared Resources and ComponentDefns) that the server needs to start.

Specified by:
getConfigurationModel in interface ConfigurationServiceInterface
Parameters:
configName - if the name of the configuration model to obtain
Returns:
ConfigurationModelContainer
Throws:
InvalidConfigurationException
ConfigurationException

getConfiguration

public Configuration getConfiguration(java.lang.String configName)
                               throws InvalidConfigurationException,
                                      ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns the named Configuration.

Specified by:
getConfiguration in interface ConfigurationServiceInterface
Parameters:
configName - is the name of the Configuration to obtain
Returns:
Configuration
Throws:
InvalidConfigurationException - if the specified name does not exist
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getConfigurationAndDependents

public java.util.Collection getConfigurationAndDependents(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
 

Specified by:
getConfigurationAndDependents in interface ConfigurationServiceInterface
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.

getAllGlobalConfigObjects

public java.util.Collection getAllGlobalConfigObjects()
                                               throws ConfigurationException

This method will return a Collection of objects that represent the set of global configuration objects currently represented in the configuration database. This method will generally be used when attempting to import a configuration into the database as the 'Next Startup' configuration. This information is important when importing a new configuration so that any global type configuration objects that are to be imported can be resolved against the global objects that currently exist in the database.

 The Collection of objects will contain the following configuration
 object types:

 ComponentTypes
 ProductTypes
 Hosts
 

Specified by:
getAllGlobalConfigObjects in interface ConfigurationServiceInterface
Returns:
a Collection of all of the global configuration objects as they exist in the database.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
InvalidSessionException - if there is not a valid administrative session
AuthorizationException - if the administrator does not have privileges to use this method
MetaMatrixComponentException - if a general remote system problem occurred

getComponentType

public ComponentType getComponentType(ComponentTypeID id)
                               throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a ComponentType for the specified ComponentTypeID

Specified by:
getComponentType in interface ConfigurationServiceInterface
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

public java.util.Collection getAllComponentTypes(boolean includeDeprecated)
                                          throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a List of type ComponentType that represents all the ComponentTypes defined.

Specified by:
getAllComponentTypes in interface ConfigurationServiceInterface
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.
See Also:
#ComponentType

getMonitoredComponentTypes

public java.util.Collection getMonitoredComponentTypes(boolean includeDeprecated)
                                                throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a List of type ComponentType . that are flagged as being monitored. A component of this type is considered to be available for monitoring statistics.

Specified by:
getMonitoredComponentTypes in interface ConfigurationServiceInterface
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.
See Also:
#ComponentType

getComponentTypeDefinitions

public java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID)
                                                 throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns the component type definitions for the specified ComponentTypeID. This does not return the dependent definitions for service type components.

Specified by:
getComponentTypeDefinitions in interface ConfigurationServiceInterface
Parameters:
componentTypeID - is a ComponentTypeID
Returns:
Collection of ComponentTypeDefns
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
ConfigurationServiceInterface.getDependentComponentTypeDefinitions(ComponentTypeID)

getComponentTypeDefinitions

public java.util.Map getComponentTypeDefinitions(java.util.Collection componentIDs)
                                          throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a Map of component type definitions for each ComponentTypeID that is contained in the passed Collection. This does not return the dependent definitions for service type components.

Specified by:
getComponentTypeDefinitions in interface ConfigurationServiceInterface
Parameters:
componentIDs - is a Collection
Returns:
Map of a Map of component type difinitions keyed by ComponentTypeID
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
getDependentComponentTypeDefintions(Collection)

getDependentComponentTypeDefinitions

public java.util.Map getDependentComponentTypeDefinitions(java.util.Collection componentIDs)
                                                   throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a Map of all component type definitions for each ComponentTypeID that is contained in the passed Collection. This only returns the dependent definitions for service type components where the component type is defined as having a super component type.

Specified by:
getDependentComponentTypeDefinitions in interface ConfigurationServiceInterface
Parameters:
componentIDs - is a Collection
Returns:
Map of component type difinitions keyed by ComponentTypeID
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
ConfigurationServiceInterface.getComponentTypeDefinitions(Collection), getDependentComponentTypeDefinitions(ComponentType)

getDependentComponentTypeDefinitions

public java.util.Collection getDependentComponentTypeDefinitions(ComponentTypeID componentTypeID)
                                                          throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns the component type definitions for the specified ComponentTypeID. This only returns the dependent definitions for service type components where the component type is defined as having a super component type.

Specified by:
getDependentComponentTypeDefinitions in interface ConfigurationServiceInterface
Parameters:
componentTypeID - is a ComponentTypeID
Returns:
Collection of ComponentTypeDefns
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
ConfigurationServiceInterface.getComponentTypeDefinitions(ComponentTypeID)

getAllComponentTypeDefinitions

public java.util.Collection getAllComponentTypeDefinitions(ComponentTypeID typeID)
                                                    throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns the all component type definitions for the specified ComponentTypeID. This includes the dependent definitions for service type components.

Specified by:
getAllComponentTypeDefinitions in interface ConfigurationServiceInterface
Parameters:
typeID - is a ComponentTypeID
Returns:
Collection of ComponentTypeDefns
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
ConfigurationServiceInterface.getDependentComponentTypeDefinitions(ComponentTypeID)

getHost

public Host getHost(HostID hostID)
             throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a Host for the specified HostID.

Specified by:
getHost in interface ConfigurationServiceInterface
Returns:
Host
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getHosts

public java.util.Collection getHosts()
                              throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a Collection of currently defined hosts. This method does not cache, it re-retrieves the data every time.

Specified by:
getHosts in interface ConfigurationServiceInterface
Returns:
Collection of type Host
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getComponentDefns

public java.util.Collection getComponentDefns(java.util.Collection componentDefnIDs,
                                              ConfigurationID configurationID)
                                       throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Returns a collection of ComponentDefns for the specified collection of ComponentDefnIDs and ConfigurationID. If the configuration is null the parent name from the componentID will be used.
The reason for adding the option to specify the configurationID is so that the same collection of componentIDs can be used to obtain the componentDefns from the different configurations. Otherwise, the requestor would have to create a new set of componetDefnIDs for each configuration.

Specified by:
getComponentDefns in interface ConfigurationServiceInterface
Parameters:
componentDefnIDs - 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.

getComponentDefn

public ComponentDefn getComponentDefn(ConfigurationID configurationID,
                                      ComponentDefnID componentDefnID)
                               throws ConfigurationException
Returns a ComponentDefn for the specified ComponentDefnID.

Specified by:
getComponentDefn in interface ConfigurationServiceInterface
Parameters:
configurationID - is the configuration for which the component exist
componentDefnID - is the component being requested
Returns:
ComponentDefn
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getResources

public 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);

Specified by:
getResources in interface ConfigurationServiceInterface
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getResources

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

Specified by:
getResources in interface ConfigurationServiceInterface
Parameters:
componentType - that identifies the type of resources to be returned
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

saveResources

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

Specified by:
saveResources in interface ConfigurationServiceInterface
Parameters:
resourceDescriptors - for the resources to be changed *
Throws:
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getProductReleaseInfos

public java.util.Collection getProductReleaseInfos()
                                            throws ConfigurationException
Obtain the List of ReleaseInfo objects which represent the products of the system. Each ReleaseInfo contains the name of the product, as well as release info.

Specified by:
getProductReleaseInfos in interface ConfigurationServiceInterface
Returns:
Collection of ReleaseInfo objects of licensed products.
Throws:
ConfigurationException - if an business error occurred within or during communication with the Configuration Service.

executeTransaction

public java.util.Set executeTransaction(ActionDefinition action,
                                        java.lang.String principalName)
                                 throws ModificationException,
                                        ConfigurationLockException,
                                        ConfigurationException
Execute as a single transaction the specified action, and optionally return the set of objects or object IDs that were affected/modified by the action.

Specified by:
executeTransaction in interface ConfigurationServiceInterface
Parameters:
action - the definition of the action to be performed on data within the repository.
principalName - of the person executing the transaction
Returns:
the set of objects that were affected by this transaction.
Throws:
ModificationException - if the target of the action is invalid, or if the target object is not a supported class of targets.
java.lang.IllegalArgumentException - if the action is null or if the result specification is invalid
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
ConfigurationLockException

executeTransaction

public java.util.Set executeTransaction(java.util.List actions,
                                        java.lang.String principalName)
                                 throws ModificationException,
                                        ConfigurationLockException,
                                        ConfigurationException
Execute as a single transaction the specified actions, and optionally return the set of objects or object IDs that were affected/modified by the action.

Specified by:
executeTransaction in interface ConfigurationServiceInterface
Parameters:
actions - the ordered list of actions that are to be performed on data within the repository.
principalName - of the person executing the transaction
Returns:
the set of objects that were affected by this transaction.
Throws:
ModificationException - if the target of any of the actions is invalid, or if the target object is not a supported class of targets.
java.lang.IllegalArgumentException - if the action is null or if the result specification is invalid
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
ConfigurationLockException

executeInsertTransaction

public java.util.Set executeInsertTransaction(ConfigurationID assignConfigurationID,
                                              java.util.List actions,
                                              java.lang.String principalName)
                                       throws ModificationException,
                                              ConfigurationLockException,
                                              ConfigurationException
Execute a list of insert actions and for actions on objects of type component object, it will have its configuration id resassigned, and optionally return the set of objects or object IDs that were affected/modified by the action.

Specified by:
executeInsertTransaction in interface ConfigurationServiceInterface
Parameters:
assignConfigurationID - the configuration for which any action for a component object will have its configurationID set to this.
actions - the ordered list of actions that are to be performed on data within the repository.
principalName - of the person executing the transaction
Returns:
the set of objects that were affected by this transaction.
Throws:
ModificationException - if the target of any of the actions is invalid, or if the target object is not a supported class of targets.
java.lang.IllegalArgumentException - if the action is null or if the result specification is invalid
ConfigurationException - if an error occurred within or during communication with the Metadata Service.
ConfigurationLockException

undoActionsAsTransaction

public java.util.Set undoActionsAsTransaction(int numberOfActions,
                                              java.lang.String principalName)
                                       throws ConfigurationException
Undo the specified number of previously-committed transactions.

Specified by:
undoActionsAsTransaction in interface ConfigurationServiceInterface
Parameters:
numberOfActions - the number of actions in the history that are to be undone.
principalName - of the person executing the transaction
Returns:
the set of objects that were affected by undoing these actions.
Throws:
java.lang.IllegalArgumentException - if the number is negative.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getHistory

public java.util.List getHistory()
                          throws ConfigurationException
Get the history of actions executed in transactions by this editor. The actions at the front of the list will be those most recently executed.

Specified by:
getHistory in interface ConfigurationServiceInterface
Returns:
the ordered list of actions in the history.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

clearHistory

public void clearHistory()
                  throws ConfigurationException
Clear the history of all actions without undoing any of them.

Specified by:
clearHistory in interface ConfigurationServiceInterface
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getHistorySize

public int getHistorySize()
                   throws ConfigurationException
Get the number of actions that are currently in the history.

Specified by:
getHistorySize in interface ConfigurationServiceInterface
Returns:
the number of actions in the history.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getHistoryLimit

public int getHistoryLimit()
                    throws ConfigurationException
Set the limit on the number of actions in the history. Note that the history may at times be greater than this limit, because when actions are removed from the history, all actions for a transactions are removed at the same time. If doing so would make the history size smaller than the limit, no actions are removed.

Specified by:
getHistoryLimit in interface ConfigurationServiceInterface
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

setHistoryLimit

public void setHistoryLimit(int maximumHistoryCount)
                     throws ConfigurationException
Set the limit on the number of actions in the history. Note that the history may at times be greater than this limit, because when actions are removed from the history, all actions for a transactions are removed at the same time. If doing so would make the history size smaller than the limit, no actions are removed.

Specified by:
setHistoryLimit in interface ConfigurationServiceInterface
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

getServerStartupTime

public 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.

Specified by:
getServerStartupTime in interface ConfigurationServiceInterface
Returns:
Date Time server was started.
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

addProperty

protected void addProperty(java.util.Properties source,
                           java.lang.String sourceName,
                           java.util.Properties props,
                           java.lang.String propName)

printActions

protected java.lang.String printActions(java.util.List actions)

getReadTransaction

protected ConfigurationTransaction getReadTransaction()
                                               throws ManagedConnectionException
Throws:
ManagedConnectionException

getWriteTransaction

protected ConfigurationTransaction getWriteTransaction()
                                                throws ManagedConnectionException
Throws:
ManagedConnectionException

addHost

public Host addHost(java.lang.String hostName,
                    java.lang.String principalName,
                    java.util.Properties properties)
             throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Add Host to Configuration Add a new Host to the System (MetaMatrix Cluster)

Specified by:
addHost in interface ConfigurationServiceInterface
Parameters:
hostName - Host Name of new Host being added to Configuration
Returns:
Host
Throws:
ConfigurationException
Since:
4.3
See Also:
com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#addHost(java.lang.String, java.util.Properties)

addProcess

public VMComponentDefn addProcess(java.lang.String processName,
                                  java.lang.String hostName,
                                  java.lang.String principalName,
                                  java.util.Properties properties)
                           throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Add Process for the specified Host to Configuration Add a new Virtuial Machine to the System (MetaMatrix Cluster)

Specified by:
addProcess in interface ConfigurationServiceInterface
Parameters:
processName - Name of the New Process being Added to Configuration
hostName - Name of the Host that the new Process is being added
principalName - User Name of user who is making the change
properties - name, value need to setup a Host
Returns:
VMComponentDefn
Throws:
ConfigurationException
Since:
4.3
See Also:
com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#addProcess(java.lang.String, java.lang.String, java.util.Properties)

setSystemPropertyValue

public void setSystemPropertyValue(java.lang.String propertyName,
                                   java.lang.String propertyValue,
                                   java.lang.String principalName)
                            throws ConfigurationException
Set System Property in Next Configuration

Specified by:
setSystemPropertyValue in interface ConfigurationServiceInterface
Parameters:
propertyName -
propertyValue -
principalName -
Throws:
ConfigurationException
InvalidSessionException
AuthorizationException
Since:
4.3

updateSystemPropertyValues

public void updateSystemPropertyValues(java.util.Properties properties,
                                       java.lang.String principalName)
                                throws ConfigurationException
Set System Property in Next Configuration

Specified by:
updateSystemPropertyValues in interface ConfigurationServiceInterface
Parameters:
properties -
principalName -
Throws:
ConfigurationException
InvalidSessionException
AuthorizationException
Since:
4.3

createConnectorBinding

public ConnectorBinding createConnectorBinding(java.lang.String connectorBindingName,
                                               java.lang.String connectorType,
                                               java.lang.String pscName,
                                               java.lang.String principalName,
                                               java.util.Properties properties)
                                        throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Deploy a new Connector Binding into Configuration

Specified by:
createConnectorBinding in interface ConfigurationServiceInterface
connectorType - Connector Type for this Connector Binding
pscName - Name of the PSC to deploy the Connector Binding to. If pscName is null, this method does not deploy the Connector Binding to a PSC.
principalName - User Name of user who is making the change
Returns:
ConnectorBinding object
Throws:
ConfigurationException
Since:
4.3
See Also:
ConfigurationServiceInterface.createConnectorBinding(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)

modify

public java.lang.Object modify(ComponentObject theObject,
                               java.util.Properties theProperties,
                               java.lang.String principalName)
                        throws ModificationException,
                               ConfigurationLockException,
                               ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Modify a Component in Configuration

Specified by:
modify in interface ConfigurationServiceInterface
Returns:
Throws:
ModificationException
ConfigurationLockException
ConfigurationException

importConnectorType

public ComponentType importConnectorType(java.io.InputStream inputStream,
                                         java.lang.String name,
                                         java.lang.String principalName)
                                  throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Import a Connector Type

Specified by:
importConnectorType in interface ConfigurationServiceInterface
name - Name of the Connector Type to import
principalName - User Name of user who is making the change
Returns:
ComponentType
Throws:
ConfigurationException

importConnectorBinding

public ConnectorBinding importConnectorBinding(java.io.InputStream inputStream,
                                               java.lang.String name,
                                               java.lang.String pscName,
                                               java.lang.String principalName)
                                        throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Import a connector Binding from InputStream, and deploy it to a PSC.

Specified by:
importConnectorBinding in interface ConfigurationServiceInterface
name - Name of Connector Binding to import
pscName - Name of the PSC to deploy the Connector Binding to. If pscName is null, this method does not deploy the Connector Binding to a PSC.
Returns:
ConnectorBinding
Throws:
ConfigurationException
Since:
4.3
See Also:
ConfigurationServiceInterface.importConnectorBinding(java.io.InputStream, java.lang.String, java.lang.String, java.lang.String)

delete

public void delete(ComponentObject theObject,
                   boolean theDeleteDependenciesFlag,
                   java.lang.String principalName)
            throws ConfigurationException,
                   ModificationException
Description copied from interface: ConfigurationServiceInterface
Deletes a component object.

Specified by:
delete in interface ConfigurationServiceInterface
Parameters:
theObject - the object being deleted
theDeleteDependenciesFlag - boolean flag for deleting dependencies
principalName - User Name of user who is making the change
Throws:
ConfigurationException
ModificationException
Since:
4.3
See Also:
com.metamatrix.platform.config.api.service.ConfigurationServiceInterface#delete(com.metamatrix.common.config.api.ComponentObject, boolean)

delete

public void delete(ComponentType componentType,
                   java.lang.String principalName)
            throws ConfigurationException,
                   ModificationException
Description copied from interface: ConfigurationServiceInterface
Delete a Component Type

Specified by:
delete in interface ConfigurationServiceInterface
Parameters:
componentType - Component Type Object being deleted
principalName - User Name who is making the change
Throws:
ConfigurationException
ModificationException
Since:
4.3
See Also:
ConfigurationServiceInterface.delete(com.metamatrix.common.config.api.ComponentType, java.lang.String)

deployPSC

public java.util.Collection deployPSC(Host theHost,
                                      VMComponentDefn theProcess,
                                      java.lang.String pscName,
                                      java.lang.String principalName)
                               throws ConfigurationException,
                                      ModificationException
Deploys the ServiceComponentDefns indicated by the ProductServiceConfig, contained by the Configuration, onto the specified Host and VM.

Specified by:
deployPSC in interface ConfigurationServiceInterface
Parameters:
theHost - host on which the services will be deployed
theProcess - VM on which the services will be deployed
pscName - Name of the PSC
principalName - User Name deploying the Services
Returns:
Collection of DeployedComponent objects, each representing one of the deployed ServiceComponentDefns
Throws:
ConfigurationException
ModificationException
Since:
4.3

checkPropertiesDecryptable

public java.util.List checkPropertiesDecryptable(java.util.List defns)
                                          throws ConfigurationException
Check whether the encrypted properties for the specified ComponentDefns can be decrypted.

Specified by:
checkPropertiesDecryptable in interface ConfigurationServiceInterface
Parameters:
defns - List
Returns:
List in the same order as the paramater defns. For each, true if the properties could be decrypted for that defn.
Throws:
ConfigurationException
Since:
4.3

checkPropertiesDecryptable

public boolean checkPropertiesDecryptable(java.util.Properties props,
                                          java.lang.String componentTypeIdentifier)
                                   throws ConfigurationException
Description copied from interface: ConfigurationServiceInterface
Check whether the given properties pertaining to the given component (name and type) contain at least one value that the server cannot decrypt with its current keystore.

Specified by:
checkPropertiesDecryptable in interface ConfigurationServiceInterface
Parameters:
props - component properties possibly containing encrypted values.
componentTypeIdentifier - The type identifier of the component to which the properties belong.
Returns:
true if all of the encrypted properties, if any, can be decrypted.
Throws:
ConfigurationException
Since:
4.3
See Also:
ConfigurationServiceInterface.checkPropertiesDecryptable(java.util.Properties, java.lang.String)


Copyright © 2009. All Rights Reserved.