com.metamatrix.common.config.model
Class BasicConfiguration

java.lang.Object
  extended by com.metamatrix.common.namedobject.BasicObject
      extended by com.metamatrix.common.config.model.BasicComponentObject
          extended by com.metamatrix.common.config.model.BasicConfiguration
All Implemented Interfaces:
ComponentObject, Configuration, BaseObject, PropertiedObject, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class BasicConfiguration
extends BasicComponentObject
implements Configuration

Configuration represents a single named set of deployable components (e.g., service and system components), a deployed set of components, global properties, and additional information. Once the configuration is flagged as "Released", it is then available to be deployed. Once it is flagged as "Deployed", it cannot be changed. The configuration must be versioned, and then changes can be made to the new versioned copy.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.metamatrix.common.config.api.Configuration
COMPONENT_TYPE_NAME, CONFIG_COMPONENT_TYPE_ID, NEXT_STARTUP, NEXT_STARTUP_ID
 
Constructor Summary
BasicConfiguration(ConfigurationInfo configInfo, ComponentTypeID typeID)
          Construct a new Configuration using the name and component type;
 
Method Summary
 void addComponentDefn(ComponentDefn component)
          Add a component to list of available components that can be deployed for this configuration.
 void addDeployedComponent(DeployedComponent component)
          Add a Component to the list of deployed components.
 void addHost(Host component)
           
 java.lang.Object clone()
          Return a deep cloned instance of this object.
 boolean doesExist(ComponentDefnID componentID)
           
 java.util.Properties getAllPropertiesForComponent(BaseID componentObjectID)
          Returns the all properites for the specified component object.
 AuthenticationProvider getAuthenticationProvider(ComponentDefnID componentID)
          Returns a AuthenticationProvider for the specified componentID.
 AuthenticationProvider getAuthenticationProvider(java.lang.String name)
          Returns a AuthenticationProvider based on the specified name.
 java.util.Collection getAuthenticationProviders()
          Returns a Collection of type AuthenticationProvider that exist for this configuration.
 ComponentDefn getComponentDefn(ComponentDefnID componentID)
          This method returns a ComponentDefn implementation, given a ComponentDefnID.
 java.util.Collection getComponentDefnIDs(ComponentTypeID componentTypeID)
          Returns a Collection of ComponentDefnID objects that are of the indicated type.
 java.util.Map getComponentDefns()
          return a clone of the Map of ComponentDefns so that no one can add directly to this objects Map of component definitions
 java.util.Collection getComponentObjectDependencies(BaseID componentObjectID)
          Returns a Collection of ProductServiceConfig objects which have ServiceComponentDefns which are deployed to the indicated VM.
 ResourceDescriptor getConnectionPool(ComponentDefnID componentID)
           
 ConnectorBinding getConnectorBinding(ComponentDefnID componentID)
          Returns a ConnectorBinding based on the specified compoentID
 ConnectorBinding getConnectorBinding(java.lang.String name)
          Returns a ConnectorBinding based on the specified name.
 ConnectorBinding getConnectorBindingByRoutingID(java.lang.String routingID)
          Returns a ConnectorBinding based on the specified routing ID..
 java.util.Collection getConnectorBindings()
          Returns a Collection of type ConnectorBinding that exist for this configuration.
 java.util.Properties getDependentPropsForComponent(BaseID componentObjectID)
          Returns only the dependent properites for the specified component object.
 DeployedComponent getDeployedComponent(DeployedComponentID deployedComponentID)
          Returns the deployed component for the specified id
 java.util.Collection getDeployedComponents()
          Returns a Collection of deployed components, keyed by the component id.
 java.util.Collection getDeployedComponents(ComponentDefnID componentID)
          Returns a Collection of deployed components that have been deployed for that specified component definition.
 DeployedComponent getDeployedServiceForVM(ServiceComponentDefnID serviceID, VMComponentDefn vmComponent)
          Returns a deployed Service component that was deployed on the specified VM.
 DeployedComponent getDeployedServiceForVM(ServiceComponentDefnID serviceID, VMComponentDefnID vmID, HostID hostID)
          Returns a deployed Service component that was deployed on the specified VM and Host.
 java.util.Collection getDeployedServicesForVM(VMComponentDefn vm)
          Returns a Collection of DeployedComponents that represent services deployed on the indicated deployed VM
 java.util.Collection getDeployedServicesForVM(VMComponentDefnID vmComponentID)
          This method is technically incorrect, because deployed services should be returned for the deployed vm that they are deployed to, not the vm component definition which may itself be deployed many times.
 Host getHost(ComponentDefnID hostID)
           
 Host getHost(java.lang.String hostName)
          Returns a Host for the specified host name
 java.util.Collection getHostIDs()
          Returns a Collection of type HostID that were deployed for this configuration.
 java.util.Collection getHosts()
          Returns a Collection of type Host that exist for this configuration.
 BaseID getID()
          Get the ID for this metadata object.
 ConfigurationInfo getInfo()
          Returns the ConfigurationInfo that provides basic information about this configuration.
 java.lang.String getName()
          Override this method to obtain the name from the ConfigurationInfo.
 ResourceDescriptor getResourcePool(java.lang.String poolName)
          Returns a ResourceDescriptor for the specified descriptorName
 java.util.Collection getResourcePools()
          Returns a Collection of type ComponentType that represent all the ComponentTypes defined.
 ServiceComponentDefn getServiceComponentDefn(ComponentDefnID componentID)
          Returns a ServiceComponentDefn
 ServiceComponentDefn getServiceComponentDefn(java.lang.String name)
          Returns a ConnectorBinding based on the specified name.
 java.util.Collection getServiceComponentDefns()
          Returns a Collection of type ServiceComponentDefn that represent all the ServiceComponentDefn defined.
 VMComponentDefn getVMComponentDefn(ComponentDefnID componentID)
          Returns a VMComponentDefn
 java.util.Collection getVMComponentDefns()
          Returns a Collection of type VMComponentDefn that represent all the VMComponentDefn defined.
 VMComponentDefn getVMDefn(ComponentDefnID componentID)
           
 VMComponentDefn getVMForHost(java.lang.String hostname, java.lang.String processName)
          Returns a deployed VM component that was deployed on the specified host.
 VMComponentDefn getVMForHost(VMComponentDefnID vmID, HostID hostID)
          Returns a deployed VM component that was deployed on the specified host.
 java.util.Collection getVMsForHost(HostID id)
          Returns a Collection of type DeployeComponent that represent VMs.
 java.util.Collection getVMsForHost(java.lang.String name)
          Returns a Collection of deployed components that are VM's deployed on the specified host name
 boolean isDeployed()
          Returns a boolean true if the configuration is deployed for current use.
 boolean isLocked()
          Returns a boolean true if the configuration is locked for current modifications.
 boolean isNextStartUp()
          Does this config represent the Next Startup config?
 boolean isReleased()
          Returns a boolean true if the configuration is released and ready for deployment.
 void removeComponentObject(ComponentObjectID componentID)
          Remove the component from this list of available components that can be deployed.
 void setComponentDefns(java.util.Map components)
           
 void setConnectors(java.util.Map components)
           
 void setDeployedComponents(java.util.Map components)
           
 void setHosts(java.util.Map newHosts)
           
 
Methods inherited from class com.metamatrix.common.config.model.BasicComponentObject
accept, addProperties, addProperty, getComponentTypeID, getCreatedBy, getCreatedDate, getCreatedDateString, getDescription, getEditableProperties, getLastChangedBy, getLastChangedDate, getLastChangedDateString, getProperties, getProperty, isDependentUpon, removeProperties, removeProperty, setCreatedBy, setCreatedDate, setDescription, setLastChangedBy, setLastChangedDate, setProperties, toString
 
Methods inherited from class com.metamatrix.common.namedobject.BasicObject
compareTo, equals, getFullName, hashCode, setID
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metamatrix.common.config.api.Configuration
getProperties, getProperty
 
Methods inherited from interface com.metamatrix.common.config.api.ComponentObject
accept, getComponentTypeID, getCreatedBy, getCreatedDate, getDescription, getLastChangedBy, getLastChangedDate, isDependentUpon
 
Methods inherited from interface com.metamatrix.common.namedobject.BaseObject
getFullName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

BasicConfiguration

public BasicConfiguration(ConfigurationInfo configInfo,
                          ComponentTypeID typeID)
Construct a new Configuration using the name and component type;

Method Detail

getID

public BaseID getID()
Description copied from class: BasicObject
Get the ID for this metadata object. The ID can never change in an object, so it is an immutable field.

Specified by:
getID in interface BaseObject
Overrides:
getID in class BasicObject
Returns:
the identifier for this metadata object.

getName

public java.lang.String getName()
Override this method to obtain the name from the ConfigurationInfo.

Specified by:
getName in interface ComponentObject
Specified by:
getName in interface Configuration
Specified by:
getName in interface BaseObject
Overrides:
getName in class BasicObject
Returns:
the name
See Also:
getFullName

isNextStartUp

public boolean isNextStartUp()
Does this config represent the Next Startup config?

Returns:
true if it does, false otherwise.

getInfo

public ConfigurationInfo getInfo()
Description copied from interface: Configuration
Returns the ConfigurationInfo that provides basic information about this configuration.

Specified by:
getInfo in interface Configuration
Returns:
ConfigurationInfo

getComponentDefns

public java.util.Map getComponentDefns()
return a clone of the Map of ComponentDefns so that no one can add directly to this objects Map of component definitions

Specified by:
getComponentDefns in interface Configuration
Returns:
Map of component definitions

doesExist

public boolean doesExist(ComponentDefnID componentID)

getComponentDefn

public ComponentDefn getComponentDefn(ComponentDefnID componentID)
Description copied from interface: Configuration
This method returns a ComponentDefn implementation, given a ComponentDefnID. The returned object can be cast to the subclass which corresponds to the subclass of the componentID parameter. For example, if a ServiceComponentDefnID is passed in, then the returned object will be a ServiceComponentDefn.

Specified by:
getComponentDefn in interface Configuration
Parameters:
componentID - ID of the ComponentDefn to retrieve from this configuration object
Returns:
ComponentDefn impl corresponding to the ID

getVMComponentDefn

public VMComponentDefn getVMComponentDefn(ComponentDefnID componentID)
Description copied from interface: Configuration
Returns a VMComponentDefn

Specified by:
getVMComponentDefn in interface Configuration
Returns:
VMComponentDefn

getVMDefn

public VMComponentDefn getVMDefn(ComponentDefnID componentID)

getAuthenticationProvider

public AuthenticationProvider getAuthenticationProvider(java.lang.String name)
Returns a AuthenticationProvider based on the specified name.

Specified by:
getAuthenticationProvider in interface Configuration
Returns:
AuthenticationProvider for that name

getAuthenticationProvider

public AuthenticationProvider getAuthenticationProvider(ComponentDefnID componentID)
Description copied from interface: Configuration
Returns a AuthenticationProvider for the specified componentID.

Specified by:
getAuthenticationProvider in interface Configuration
Returns:

getConnectionPool

public ResourceDescriptor getConnectionPool(ComponentDefnID componentID)

getConnectorBinding

public ConnectorBinding getConnectorBinding(ComponentDefnID componentID)
Description copied from interface: Configuration
Returns a ConnectorBinding based on the specified compoentID

Specified by:
getConnectorBinding in interface Configuration
Returns:
ConnectorBinding for that give component ID

getConnectorBinding

public ConnectorBinding getConnectorBinding(java.lang.String name)
Returns a ConnectorBinding based on the specified name.

Specified by:
getConnectorBinding in interface Configuration
Returns:
ConnectorBinding for that name

getConnectorBindingByRoutingID

public ConnectorBinding getConnectorBindingByRoutingID(java.lang.String routingID)
Returns a ConnectorBinding based on the specified routing ID..

Specified by:
getConnectorBindingByRoutingID in interface Configuration
Returns:
ConnectorBinding for that name

getServiceComponentDefn

public ServiceComponentDefn getServiceComponentDefn(ComponentDefnID componentID)
Description copied from interface: Configuration
Returns a ServiceComponentDefn

Specified by:
getServiceComponentDefn in interface Configuration
Returns:
ServiceComponentDefn

getServiceComponentDefn

public ServiceComponentDefn getServiceComponentDefn(java.lang.String name)
Returns a ConnectorBinding based on the specified name.

Specified by:
getServiceComponentDefn in interface Configuration
Returns:
ConnectorBinding for that name

getComponentDefnIDs

public java.util.Collection getComponentDefnIDs(ComponentTypeID componentTypeID)
Returns a Collection of ComponentDefnID objects that are of the indicated type. Note that the type must be an exact match, no component defns of a sub-type of the indicated type will be returned.

Specified by:
getComponentDefnIDs in interface Configuration
Parameters:
componentTypeID - ComponentTypeID of desired ComponentDefns contained in this Configuration
Returns:
Collection of ComponentDefnID objects - use getComponentDefn(com.metamatrix.common.config.api.ComponentDefnID) method to retrieve the full ComponentDefn object

getDependentPropsForComponent

public java.util.Properties getDependentPropsForComponent(BaseID componentObjectID)
Description copied from interface: Configuration
Returns only the dependent properites for the specified component object. This excludes the properties that are defined at components level. To get the properties defined at this components level, call #getProperties() on the component. The following is the top-down hierarchy as to the order properties are assembled for inheritance: A. VM ComponentDefn - Configuration - VM definition B. Service ComponentDefn - Configuration - Service definition C. VM Deployed Component - Configuration - VM Definition - VM Deployed Component D. Service Deployed Component - VM Deployed Component (and all dependencies) - Service Definition - Service Deployed Component

Specified by:
getDependentPropsForComponent in interface Configuration
Parameters:
componentObjectID - is the component object for which all properties it inherits will be returned
Returns:
Properties that are inherited
See Also:
Configuration.getAllPropertiesForComponent(com.metamatrix.common.namedobject.BaseID)

getAllPropertiesForComponent

public java.util.Properties getAllPropertiesForComponent(BaseID componentObjectID)
Description copied from interface: Configuration
Returns the all properites for the specified component object. This includes the dependent propertie, as well as, the properties defined at its level.

Specified by:
getAllPropertiesForComponent in interface Configuration
Parameters:
componentObjectID - is the id for the component object which all properties will be returned.
Returns:
Properties that are inherited
See Also:
getDependentPropsForComponent

getDeployedComponents

public java.util.Collection getDeployedComponents()
Description copied from interface: Configuration
Returns a Collection of deployed components, keyed by the component id.

Specified by:
getDeployedComponents in interface Configuration
Returns:
Collection of deployed components

getDeployedComponent

public DeployedComponent getDeployedComponent(DeployedComponentID deployedComponentID)
Description copied from interface: Configuration
Returns the deployed component for the specified id

Specified by:
getDeployedComponent in interface Configuration
Parameters:
deployedComponentID - for the deployed component
Returns:
DeployedComponent

getDeployedComponents

public java.util.Collection getDeployedComponents(ComponentDefnID componentID)
Description copied from interface: Configuration
Returns a Collection of deployed components that have been deployed for that specified component definition.

Specified by:
getDeployedComponents in interface Configuration
Parameters:
componentID - is the definition that has been deployed
Returns:
Collection of deployed components

getVMForHost

public VMComponentDefn getVMForHost(VMComponentDefnID vmID,
                                    HostID hostID)
Description copied from interface: Configuration
Returns a deployed VM component that was deployed on the specified host.

Specified by:
getVMForHost in interface Configuration
Parameters:
vmID - identifies the VM definition that was deployed
hostID - is the host the VM was deployed to.
Returns:
DeployedComponent

getDeployedServiceForVM

public DeployedComponent getDeployedServiceForVM(ServiceComponentDefnID serviceID,
                                                 VMComponentDefn vmComponent)
Description copied from interface: Configuration
Returns a deployed Service component that was deployed on the specified VM.

Specified by:
getDeployedServiceForVM in interface Configuration
Parameters:
serviceID - identifies the service definition that was deployed
Returns:
DeployedComponent

getDeployedServiceForVM

public DeployedComponent getDeployedServiceForVM(ServiceComponentDefnID serviceID,
                                                 VMComponentDefnID vmID,
                                                 HostID hostID)
Description copied from interface: Configuration
Returns a deployed Service component that was deployed on the specified VM and Host.

Specified by:
getDeployedServiceForVM in interface Configuration
Parameters:
serviceID - identifies the service definition that was deployed
vmID - is the VM the service was deployed to.
hostID - is the Host the service was deployed to.
Returns:
DeployedComponent

getVMsForHost

public java.util.Collection getVMsForHost(java.lang.String name)
Description copied from interface: Configuration
Returns a Collection of deployed components that are VM's deployed on the specified host name

Specified by:
getVMsForHost in interface Configuration
Parameters:
name - of the Host the vm's were deployed on
Returns:
Collection of deployed components

getVMForHost

public VMComponentDefn getVMForHost(java.lang.String hostname,
                                    java.lang.String processName)
Description copied from interface: Configuration
Returns a deployed VM component that was deployed on the specified host.

Specified by:
getVMForHost in interface Configuration
Returns:
DeployedComponent

getVMsForHost

public java.util.Collection getVMsForHost(HostID id)
Returns a Collection of type DeployeComponent that represent VMs.

Specified by:
getVMsForHost in interface Configuration
Parameters:
id - of the Host the vm's were deployed on
Returns:
Collection of deployed components

getHostIDs

public java.util.Collection getHostIDs()
Returns a Collection of type HostID that were deployed for this configuration.

Specified by:
getHostIDs in interface Configuration
Returns:
Collection of deployed hosts

getConnectorBindings

public java.util.Collection getConnectorBindings()
Description copied from interface: Configuration
Returns a Collection of type ConnectorBinding that exist for this configuration.

Specified by:
getConnectorBindings in interface Configuration
Returns:
Collection of deployed hosts

getAuthenticationProviders

public java.util.Collection getAuthenticationProviders()
Description copied from interface: Configuration
Returns a Collection of type AuthenticationProvider that exist for this configuration.

Specified by:
getAuthenticationProviders in interface Configuration
Returns:
Collection of authentication providers

getHosts

public java.util.Collection getHosts()
Description copied from interface: Configuration
Returns a Collection of type Host that exist for this configuration.

Specified by:
getHosts in interface Configuration
Returns:
Collection of deployed hosts

getHost

public Host getHost(ComponentDefnID hostID)

getHost

public Host getHost(java.lang.String hostName)
Returns a Host for the specified host name

Specified by:
getHost in interface Configuration
Returns:
Host

getDeployedServicesForVM

public java.util.Collection getDeployedServicesForVM(VMComponentDefnID vmComponentID)
This method is technically incorrect, because deployed services should be returned for the deployed vm that they are deployed to, not the vm component definition which may itself be deployed many times.

Specified by:
getDeployedServicesForVM in interface Configuration

getDeployedServicesForVM

public java.util.Collection getDeployedServicesForVM(VMComponentDefn vm)
Description copied from interface: Configuration
Returns a Collection of DeployedComponents that represent services deployed on the indicated deployed VM

Specified by:
getDeployedServicesForVM in interface Configuration
Parameters:
vm - component represents the deployed vm for which the services have been deployed.
Returns:
Collection of DeployedComponent objects representing deployed services

getComponentObjectDependencies

public java.util.Collection getComponentObjectDependencies(BaseID componentObjectID)
Returns a Collection of ProductServiceConfig objects which have ServiceComponentDefns which are deployed to the indicated VM. Note that, physically speaking, only ServiceComponentDefns and VMComponentDefns are "deployed", so this is just a convenience method for organizing deployed services by the PSC that originated them, and to then organize PSCs by the vm in which those services are deployed.

Specified by:
getComponentObjectDependencies in interface Configuration
Parameters:
deployedVM - DeployedComponent representing a deployed VMComponentDefn
Returns:
Collection of ProductServiceConfig objects
Throws:
InvalidArgumentException - if the parameter is null

getResourcePools

public java.util.Collection getResourcePools()
Returns a Collection of type ComponentType that represent all the ComponentTypes defined.

Returns:
Collection of type ComponentType
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
#ComponentType

getServiceComponentDefns

public java.util.Collection getServiceComponentDefns()
Returns a Collection of type ServiceComponentDefn that represent all the ServiceComponentDefn defined.

Specified by:
getServiceComponentDefns in interface Configuration
Returns:
Collection of type ServiceComponentDefn
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
#ProductServiceConfig

getVMComponentDefns

public java.util.Collection getVMComponentDefns()
Returns a Collection of type VMComponentDefn that represent all the VMComponentDefn defined.

Specified by:
getVMComponentDefns in interface Configuration
Returns:
Collection of type VMComponentDefn
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
See Also:
#ProductServiceConfig

getResourcePool

public ResourceDescriptor getResourcePool(java.lang.String poolName)
Returns a ResourceDescriptor for the specified descriptorName

Parameters:
descriptorName - is the name of the resource descriptor to return
Returns:
ResourceDescriptor is the descriptor requested
Throws:
ConfigurationException - if an error occurred within or during communication with the Configuration Service.

isDeployed

public boolean isDeployed()
Description copied from interface: Configuration
Returns a boolean true if the configuration is deployed for current use.

Specified by:
isDeployed in interface Configuration
Returns:
boolean true if the configuration is deployed

isLocked

public boolean isLocked()
Description copied from interface: Configuration
Returns a boolean true if the configuration is locked for current modifications.

Specified by:
isLocked in interface Configuration
Returns:
boolean true if the configuration is currently locked.

isReleased

public boolean isReleased()
Description copied from interface: Configuration
Returns a boolean true if the configuration is released and ready for deployment.

Specified by:
isReleased in interface Configuration
Returns:
boolean true if the configuration is released.

addComponentDefn

public void addComponentDefn(ComponentDefn component)
Add a component to list of available components that can be deployed for this configuration.


addDeployedComponent

public void addDeployedComponent(DeployedComponent component)
Add a Component to the list of deployed components.


addHost

public void addHost(Host component)

removeComponentObject

public void removeComponentObject(ComponentObjectID componentID)
Remove the component from this list of available components that can be deployed.


setDeployedComponents

public void setDeployedComponents(java.util.Map components)

setConnectors

public void setConnectors(java.util.Map components)

setComponentDefns

public void setComponentDefns(java.util.Map components)

setHosts

public void setHosts(java.util.Map newHosts)

clone

public java.lang.Object clone()
Description copied from interface: BaseObject
Return a deep cloned instance of this object. Subclasses must override this method.

Specified by:
clone in interface BaseObject
Overrides:
clone in class BasicObject
Returns:
the object that is the clone of this instance. Defaults cannot be cloned).


Copyright © 2009. All Rights Reserved.