com.metamatrix.console.models
Class ConfigurationManager

java.lang.Object
  extended by com.metamatrix.console.models.Manager
      extended by com.metamatrix.console.models.ConfigurationManager
All Implemented Interfaces:
ManagerListener, java.util.EventListener

public final class ConfigurationManager
extends Manager
implements ManagerListener

The ConfigurationManager is used as an abstraction layer between the GUI and the ConfigurationAdminAPI.

Since:
Golden Gate
Version:
1.0
Author:
Dan Florian

Field Summary
 
Fields inherited from class com.metamatrix.console.models.Manager
MODEL_CHANGED, MODEL_STALE
 
Constructor Summary
ConfigurationManager(ConnectionInfo connection)
          Constructs a ConfigurationManager.
 
Method Summary
 void addConfigurationChangeListener(ConfigurationChangeListener theListener)
          Adds the given listener to those being notified.
 void changeDeployedPsc(ProductServiceConfig theOldPsc, ProductServiceConfig theNewPsc, VMComponentDefn theProcess, Host theHost, ConfigurationID theConfigId)
          Changes the deployed PSC for a given process.
 boolean checkDecryptable(java.util.List bindings)
          Check whether the encrypted properties for the specified ConnectorBindings can be decrypted.
 void commitImportedObjects(java.util.Collection theImportedObjects)
           
 ProductServiceConfig copyPscDef(java.lang.String thePscDefName, ProductServiceConfig thePscBeingCopied, ConfigurationID theConfigId)
          Creates a PSC definition.
 Host createHost(java.lang.String theHostName)
          Creates a host.
 VMComponentDefn createProcess(java.lang.String theProcessName, java.lang.String portNumber, Host theHost, ConfigurationID theConfigId)
          Creates a process.
 ProductServiceConfig createPscDef(java.lang.String thePscDefName, ProductTypeID thePscProdTypeID, java.util.Collection theServiceIds, ConfigurationID theConfigId)
          Creates a PSC definition.
 void deleteDeployedPsc(ProductServiceConfig thePsc, VMComponentDefn theProcess, Host theHost, ConfigurationID theConfigId)
           
 void deleteHost(Host theHost, ConfigurationID theConfigId)
           
 void deleteProcess(VMComponentDefn theProcess, ConfigurationID theConfigId)
           
 void deletePscDefinition(ProductServiceConfig thePsc, ProductType theProduct, ConfigurationID theConfigId)
           
 void deployPsc(ProductServiceConfig thePsc, VMComponentDefn theProcess, Host theHost, ConfigurationID theConfigId)
           
 java.util.Collection getAllCachedComponentTypeDefinitions(ComponentTypeID componentTypeID)
           
 java.util.Map getAllProductPscs(ConfigurationID theConfigId)
           
 ComponentTypeDefn getComponentTypeDefn(PropertyDefinition propertyDefinition, ComponentObject componentObject)
           
 Configuration getConfig(ConfigurationID theId)
           
 ConfigurationModelContainer getConfigModel(ConfigurationID theId)
           
 java.util.Collection getConfigObjects(ConfigurationID theConfigId)
           
 java.util.Collection getDeployedPscs(VMComponentDefn theProcess)
           
 java.util.Collection getDeployedServices(ProductServiceConfig thePsc, VMComponentDefn theProcess)
           
 ConfigurationObjectEditor getEditor()
           
 Host getHost(java.lang.String hostFullName, ConfigurationID configID)
           
 Host getHost(VMComponentDefn theProcess)
           
 java.util.Collection getHostProcesses(Host theHost, ConfigurationID theConfigId)
           
 java.util.Collection getHosts(ConfigurationID configID)
           
 java.util.ArrayList getListeners()
           
 ProductType getProduct(ProductServiceConfig thePsc)
           
 ProductType getProduct(ProductTypeID theId)
           
 java.util.Collection getProducts()
           
 ConfigurationPropertiedObjectEditor getPropertiedObjectEditor()
           
 PropertiedObject getPropertiedObjectForComponentObject(ComponentObject componentObject)
          Returns a PropertiedObject representation of a ComponentObject
 java.util.Collection getPscDefinitions(ProductType theProduct, Configuration theConfiguration)
           
 java.util.Collection getServiceDefinitions(ProductServiceConfig thePsc, Configuration theConfiguration)
           
 java.util.Collection importObjects(java.lang.String theFileName)
           
 boolean isEditable(ConfigurationID theId)
          Indicates if the configuration can be edited.
 boolean isNextStartUpConfig(ConfigurationID theId)
          Indicates if the given parameter is the identifier of the next startup configuration.
 boolean isRefreshNeeded()
           
 boolean isStartUpConfig(ConfigurationID theId)
          Indicates if the given parameter is the identifier of the startup configuration.
 void modelChanged(ModelChangedEvent e)
           
 Host modifyHost(Host theHost, java.util.Properties theProperties)
           
 VMComponentDefn modifyProcess(VMComponentDefn theProcess, java.util.Properties theProperties)
           
 void modifyPropertiedObject(ConfigurationPropertiedObjectEditor editor)
           
 ProductServiceConfig modifyPsc(ProductServiceConfig thePscDef, java.util.Properties theProperties)
           
 ServiceComponentDefn modifyService(ServiceComponentDefn theService, java.util.Properties theProperties)
           
 void refresh()
          Refresh tells a manager that it's data is stale and it should retrieve real data (rather than cached data) the next time data is requested.
 void refreshImpl()
           
 void removeConfigurationChangeListener(ConfigurationChangeListener theListener)
          Removes the given listener from those being notified.
 void setEnabled(ServiceComponentDefn theService, ProductServiceConfig psc, boolean theEnableFlag, Configuration theConfig)
           
 void setRefreshNeeded()
          To indicate a refresh is needed.
 ProductServiceConfig updatePscDef(ProductServiceConfig thePscDef, java.util.Collection theServiceIds)
          Updates a PSC definition.
 ResourceDescriptor updateResourcePropertyValue(ResourceDescriptor resourceDescriptor, java.lang.String propertyKey, java.lang.String propertyValue)
          Updates the resourceDescriptor with the new propertyValue and returns the updated resourceDescriptor.
 
Methods inherited from class com.metamatrix.console.models.Manager
addManagerListener, fireModelChangedEvent, fireModelChangedEvent, getConnection, getConnection, getEncryptor, getEventListeners, getIsStale, init, removeManagerListener, setIsStale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationManager

public ConfigurationManager(ConnectionInfo connection)
                     throws ExternalException
Constructs a ConfigurationManager.

Throws:
ExternalException - if a problem occurs during construction.
Method Detail

modelChanged

public void modelChanged(ModelChangedEvent e)
Specified by:
modelChanged in interface ManagerListener
Since:
4.3
See Also:
ManagerListener.modelChanged(com.metamatrix.console.models.ModelChangedEvent)

addConfigurationChangeListener

public void addConfigurationChangeListener(ConfigurationChangeListener theListener)
Adds the given listener to those being notified.

Parameters:
theListener - the listener who wants to be notified

changeDeployedPsc

public void changeDeployedPsc(ProductServiceConfig theOldPsc,
                              ProductServiceConfig theNewPsc,
                              VMComponentDefn theProcess,
                              Host theHost,
                              ConfigurationID theConfigId)
                       throws ExternalException
Changes the deployed PSC for a given process.

Parameters:
theOldPsc - the deployed PSC being deleted
theNewPsc - the PSC being deployed
theProcess - the process the PSCs belong to
theConfigId - the ID of the configuration
Throws:
ExternalException

commitImportedObjects

public void commitImportedObjects(java.util.Collection theImportedObjects)
                           throws ExternalException
Throws:
ExternalException

createHost

public Host createHost(java.lang.String theHostName)
                throws ExternalException
Creates a host.

Parameters:
theHostName - the name of the new host
Returns:
the new host or null if host already exists
Throws:
ExternalException - if problem occurs creating the host

createProcess

public VMComponentDefn createProcess(java.lang.String theProcessName,
                                     java.lang.String portNumber,
                                     Host theHost,
                                     ConfigurationID theConfigId)
                              throws ExternalException
Creates a process.

Parameters:
theProcessName - the name of the new process
theHost - the host to add the process to
theConfigId - the ID of the Configuration to add the process to.
Throws:
ExternalException - if problem occurs creating the process

copyPscDef

public ProductServiceConfig copyPscDef(java.lang.String thePscDefName,
                                       ProductServiceConfig thePscBeingCopied,
                                       ConfigurationID theConfigId)
                                throws ExternalException
Creates a PSC definition. New PSC definitions are created by copying an existing definition.

Parameters:
thePscDefName - the name of the new PSC definition
thePscBeingCopied - the PSC being copied
theConfigId - the ID of the Configuration the PSC definition is contained in.
Throws:
ExternalException - if problem occurs creating the PSC definition

updatePscDef

public ProductServiceConfig updatePscDef(ProductServiceConfig thePscDef,
                                         java.util.Collection theServiceIds)
                                  throws ExternalException
Updates a PSC definition. The the service IDs will replace the current services in the psc.

Parameters:
thePscDef - the PSC definition to be updated
theServiceIds - the service IDs to replace current service IDs
Throws:
ExternalException - if problem occurs updating the PSC definition

createPscDef

public ProductServiceConfig createPscDef(java.lang.String thePscDefName,
                                         ProductTypeID thePscProdTypeID,
                                         java.util.Collection theServiceIds,
                                         ConfigurationID theConfigId)
                                  throws ExternalException
Creates a PSC definition. New PSC definitions are created by copying an existing definition.

Parameters:
thePscDefName - the name of the new PSC definition
thePscBeingCopied - the PSC being copied
theConfigId - the ID of the Configuration the PSC definition is contained in.
Throws:
ExternalException - if problem occurs creating the PSC definition

deleteDeployedPsc

public void deleteDeployedPsc(ProductServiceConfig thePsc,
                              VMComponentDefn theProcess,
                              Host theHost,
                              ConfigurationID theConfigId)
                       throws ExternalException
Throws:
ExternalException

deleteHost

public void deleteHost(Host theHost,
                       ConfigurationID theConfigId)
                throws ExternalException
Throws:
ExternalException

deleteProcess

public void deleteProcess(VMComponentDefn theProcess,
                          ConfigurationID theConfigId)
                   throws ExternalException
Throws:
ExternalException

deletePscDefinition

public void deletePscDefinition(ProductServiceConfig thePsc,
                                ProductType theProduct,
                                ConfigurationID theConfigId)
                         throws ExternalException
Throws:
ExternalException

deployPsc

public void deployPsc(ProductServiceConfig thePsc,
                      VMComponentDefn theProcess,
                      Host theHost,
                      ConfigurationID theConfigId)
               throws ExternalException
Throws:
ExternalException

getConfig

public Configuration getConfig(ConfigurationID theId)

getConfigModel

public ConfigurationModelContainer getConfigModel(ConfigurationID theId)

getConfigObjects

public java.util.Collection getConfigObjects(ConfigurationID theConfigId)
                                      throws ExternalException
Throws:
ExternalException

getDeployedPscs

public java.util.Collection getDeployedPscs(VMComponentDefn theProcess)
                                     throws ExternalException
Throws:
ExternalException

getDeployedServices

public java.util.Collection getDeployedServices(ProductServiceConfig thePsc,
                                                VMComponentDefn theProcess)
                                         throws ExternalException
Throws:
ExternalException

getEditor

public ConfigurationObjectEditor getEditor()
                                    throws ExternalException
Throws:
ExternalException

getHosts

public java.util.Collection getHosts(ConfigurationID configID)

getHost

public Host getHost(java.lang.String hostFullName,
                    ConfigurationID configID)

getHost

public Host getHost(VMComponentDefn theProcess)

getHostProcesses

public java.util.Collection getHostProcesses(Host theHost,
                                             ConfigurationID theConfigId)
                                      throws ExternalException
Throws:
ExternalException

getProduct

public ProductType getProduct(ProductTypeID theId)

getProduct

public ProductType getProduct(ProductServiceConfig thePsc)

getAllProductPscs

public java.util.Map getAllProductPscs(ConfigurationID theConfigId)
                                throws ExternalException
Throws:
ExternalException

getProducts

public java.util.Collection getProducts()

getPropertiedObjectEditor

public ConfigurationPropertiedObjectEditor getPropertiedObjectEditor()
                                                              throws ExternalException
Throws:
ExternalException

getPropertiedObjectForComponentObject

public PropertiedObject getPropertiedObjectForComponentObject(ComponentObject componentObject)
Returns a PropertiedObject representation of a ComponentObject

Parameters:
componentObject - ComponentObject for which PropertiedObject representation is sought
Throws:
MetaMatrixRuntimeException - if parameter can not be expressed as a PropertiedObject

updateResourcePropertyValue

public ResourceDescriptor updateResourcePropertyValue(ResourceDescriptor resourceDescriptor,
                                                      java.lang.String propertyKey,
                                                      java.lang.String propertyValue)
                                               throws ConfigurationException,
                                                      InvalidSessionException,
                                                      AuthorizationException,
                                                      MetaMatrixComponentException
Updates the resourceDescriptor with the new propertyValue and returns the updated resourceDescriptor.

Parameters:
resourceDescriptor - is the resource to be updated
propertyKey - is the name of the property to change
propertyValue - is the new value for the propertyKey
Throws:
ConfigurationException - if the propertyKey does not exist as a property on the descriptor.
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.

getPscDefinitions

public java.util.Collection getPscDefinitions(ProductType theProduct,
                                              Configuration theConfiguration)
                                       throws ExternalException
Throws:
ExternalException

getServiceDefinitions

public java.util.Collection getServiceDefinitions(ProductServiceConfig thePsc,
                                                  Configuration theConfiguration)
                                           throws ExternalException
Throws:
ExternalException

importObjects

public java.util.Collection importObjects(java.lang.String theFileName)
                                   throws ExternalException
Throws:
ExternalException

isEditable

public boolean isEditable(ConfigurationID theId)
Indicates if the configuration can be edited.

Parameters:
theId - the configuration identifier whose mode is being requested
Returns:
true if configuration can be edited; false otherwise.

isNextStartUpConfig

public boolean isNextStartUpConfig(ConfigurationID theId)
Indicates if the given parameter is the identifier of the next startup configuration.

Parameters:
theId - the identifier being compared
Returns:
true if equal to the next startup configuration; false otherwise.

isRefreshNeeded

public boolean isRefreshNeeded()

isStartUpConfig

public boolean isStartUpConfig(ConfigurationID theId)
Indicates if the given parameter is the identifier of the startup configuration.

Parameters:
theId - the identifier being compared
Returns:
true if equal to the startup configuration; false otherwise.

modifyHost

public Host modifyHost(Host theHost,
                       java.util.Properties theProperties)
                throws ExternalException
Throws:
ExternalException

modifyProcess

public VMComponentDefn modifyProcess(VMComponentDefn theProcess,
                                     java.util.Properties theProperties)
                              throws ExternalException
Throws:
ExternalException

modifyPropertiedObject

public void modifyPropertiedObject(ConfigurationPropertiedObjectEditor editor)
                            throws ExternalException
Throws:
ExternalException

modifyPsc

public ProductServiceConfig modifyPsc(ProductServiceConfig thePscDef,
                                      java.util.Properties theProperties)
                               throws ExternalException
Throws:
ExternalException

modifyService

public ServiceComponentDefn modifyService(ServiceComponentDefn theService,
                                          java.util.Properties theProperties)
                                   throws ExternalException
Throws:
ExternalException

refresh

public void refresh()
Description copied from class: Manager
Refresh tells a manager that it's data is stale and it should retrieve real data (rather than cached data) the next time data is requested.

Currently this method simply calls setIsStale(false)

Overrides:
refresh in class Manager
See Also:
Manager.setIsStale(boolean)

refreshImpl

public void refreshImpl()
                 throws ExternalException
Throws:
ExternalException

removeConfigurationChangeListener

public void removeConfigurationChangeListener(ConfigurationChangeListener theListener)
Removes the given listener from those being notified.

Parameters:
theListener - the listener being removed

setEnabled

public void setEnabled(ServiceComponentDefn theService,
                       ProductServiceConfig psc,
                       boolean theEnableFlag,
                       Configuration theConfig)
                throws ExternalException
Throws:
ExternalException

setRefreshNeeded

public void setRefreshNeeded()
To indicate a refresh is needed.


getListeners

public java.util.ArrayList getListeners()
Returns:
Returns the listeners.
Since:
4.2.1

checkDecryptable

public boolean checkDecryptable(java.util.List bindings)
                         throws ConfigurationException,
                                AuthorizationException,
                                InvalidSessionException,
                                MetaMatrixComponentException
Check whether the encrypted properties for the specified ConnectorBindings can be decrypted. If not, displays a warning dialog with a list of the failed bindings.

Parameters:
bindings - List
Returns:
true if the bindings' properties can all be decrypted
Throws:
ConfigurationException
AuthorizationException
InvalidSessionException
MetaMatrixComponentException
Since:
4.3

getAllCachedComponentTypeDefinitions

public java.util.Collection getAllCachedComponentTypeDefinitions(ComponentTypeID componentTypeID)
                                                          throws ConfigurationException,
                                                                 InvalidSessionException,
                                                                 AuthorizationException,
                                                                 MetaMatrixComponentException
Throws:
ConfigurationException
InvalidSessionException
AuthorizationException
MetaMatrixComponentException

getComponentTypeDefn

public ComponentTypeDefn getComponentTypeDefn(PropertyDefinition propertyDefinition,
                                              ComponentObject componentObject)
                                       throws ConfigurationException,
                                              InvalidSessionException,
                                              AuthorizationException,
                                              MetaMatrixComponentException
Throws:
ConfigurationException
InvalidSessionException
AuthorizationException
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.