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.
 boolean checkDecryptable(java.util.List bindings)
          Check whether the encrypted properties for the specified ConnectorBindings can be decrypted.
 void commitImportedObjects(java.util.Collection theImportedObjects)
          Changes the deployed PSC for a given process.
 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.
 void deleteHost(Host theHost, ConfigurationID theConfigId)
           
 void deleteProcess(VMComponentDefn theProcess, ConfigurationID theConfigId)
           
 java.util.Collection getAllCachedComponentTypeDefinitions(ComponentTypeID componentTypeID)
           
 ComponentTypeDefn getComponentTypeDefn(PropertyDefinition propertyDefinition, ComponentObject componentObject)
           
 Configuration getConfig(ConfigurationID theId)
           
 ConfigurationModelContainer getConfigModel(ConfigurationID theId)
           
 java.util.Collection getConfigObjects(ConfigurationID theConfigId)
           
 java.util.Collection getDeployedServices(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()
           
 ConfigurationPropertiedObjectEditor getPropertiedObjectEditor()
           
 PropertiedObject getPropertiedObjectForComponentObject(ComponentObject componentObject)
          Returns a PropertiedObject representation of a ComponentObject
 java.util.Collection getServiceDefinitions(VMComponentDefn theVM, Configuration theConfiguration)
           
 java.util.Collection importObjects(java.lang.String theFileName)
           
 boolean isRefreshNeeded()
           
 void modelChanged(ModelChangedEvent e)
           
 Host modifyHost(Host theHost, java.util.Properties theProperties)
           
 VMComponentDefn modifyProcess(VMComponentDefn theProcess, java.util.Properties theProperties)
           
 void modifyPropertiedObject(ConfigurationPropertiedObjectEditor editor)
           
 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(DeployedComponent thedeployed, boolean theEnableFlag, Configuration theConfig)
           
 void setRefreshNeeded()
          To indicate a refresh is needed.
 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

commitImportedObjects

public void commitImportedObjects(java.util.Collection theImportedObjects)
                           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

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

deleteHost

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

deleteProcess

public void deleteProcess(VMComponentDefn theProcess,
                          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

getDeployedServices

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

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.

getServiceDefinitions

public java.util.Collection getServiceDefinitions(VMComponentDefn theVM,
                                                  Configuration theConfiguration)
                                           throws ExternalException
Throws:
ExternalException

importObjects

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

isRefreshNeeded

public boolean isRefreshNeeded()

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

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(DeployedComponent thedeployed,
                       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.