com.metamatrix.common.config.model
Class BasicDeployedComponent

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.BasicDeployedComponent
All Implemented Interfaces:
ComponentObject, DeployedComponent, BaseObject, PropertiedObject, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable

public class BasicDeployedComponent
extends BasicComponentObject
implements DeployedComponent, java.io.Serializable

DeployedComponent represents a Component that is declared deployed to a specified machine. The componentID represents the component that has been deployed. It can either be a VM component or a Service Component. If its a VM component, the vmComponentID will be null, because a deployed VM cannot be deployed within another VM. The DeployedComponent does not utilize a ComponentType, therefore, it is set to null;

As you will notice, there is no reference held to a Configuration. This is done so that a DeployedComponent can be serialized independently from having to also serialize the whole configuration of objects.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.metamatrix.common.config.api.DeployedComponent
SERVICE_UID_FOR_DEPLOYED_VM
 
Constructor Summary
BasicDeployedComponent(BasicDeployedComponent deployedComponent)
           
BasicDeployedComponent(DeployedComponentID deployedId, ConfigurationID configId, HostID hostId, VMComponentDefnID vmId, ComponentTypeID deployedTypeID)
          Constructor takes a ComponentID, HostID, and Collection of system components to declare a component as being deployed.
BasicDeployedComponent(DeployedComponentID deployedId, ConfigurationID configId, HostID hostId, VMComponentDefnID vmId, ServiceComponentDefnID serviceId, ComponentTypeID deployedTypeID)
           
 
Method Summary
 java.lang.Object clone()
          Return a deep cloned instance of this object.
 ConfigurationID getConfigurationID()
          Returns the ConfigurationID indicating the configuration under which this deployed component belongs.
 ComponentDefn getDeployedComponentDefn(Configuration configuration)
          Returns the ComponentDefn that is deployed.
 ComponentDefnID getDeployedComponentDefnID()
          Returns the ComponentDefnID for the component that is deployed.
 HostID getHostID()
          Returns the HostID for the Host that this component is deployed on.
 ServiceComponentDefnID getServiceComponentDefnID()
          Returns the ComponentID for the service component that is deployed.
 VMComponentDefnID getVMComponentDefnID()
          Returns the ComponentID for the VM that this component is deployed on, or if this object represents the deployed VM itself.
 boolean isDependentUpon(BaseID componentObjectId)
          Returns true if this object is dependent upon the specified ComponentObjectID
 boolean isDeployedConnector()
          Indicates whether this object represents a deployed connector.
 boolean isDeployedService()
          Indicates whether this object represents a deployed service component definition (returns true) or a deployed vm component definition (returns false).
 boolean isEnabled()
          Indicates if the deployed component is enabled for starting.
 void setIsEnabled(boolean enable)
           
 java.lang.String toString()
          Returns a string representing the name of the object.
 
Methods inherited from class com.metamatrix.common.config.model.BasicComponentObject
accept, addProperties, addProperty, getComponentTypeID, getCreatedBy, getCreatedDate, getCreatedDateString, getDescription, getEditableProperties, getLastChangedBy, getLastChangedDate, getLastChangedDateString, getProperties, getProperty, removeProperties, removeProperty, setCreatedBy, setCreatedDate, setDescription, setLastChangedBy, setLastChangedDate, setProperties
 
Methods inherited from class com.metamatrix.common.namedobject.BasicObject
compareTo, equals, getFullName, getID, getName, 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.DeployedComponent
accept
 
Methods inherited from interface com.metamatrix.common.config.api.ComponentObject
getComponentTypeID, getCreatedBy, getCreatedDate, getDescription, getLastChangedBy, getLastChangedDate, getName, getProperties, getProperty
 
Methods inherited from interface com.metamatrix.common.namedobject.BaseObject
getFullName, getID
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

BasicDeployedComponent

public BasicDeployedComponent(DeployedComponentID deployedId,
                              ConfigurationID configId,
                              HostID hostId,
                              VMComponentDefnID vmId,
                              ComponentTypeID deployedTypeID)
Constructor takes a ComponentID, HostID, and Collection of system components to declare a component as being deployed.

Parameters:
deployedID - is the DeployedComponentID
configID - is the ConfigurationID
hostID - is the HostID
vmComponentID - is the VMComponentDefnID
serviceComponentID - is the ServiceComponentID (null if this is a deployed VM)

BasicDeployedComponent

public BasicDeployedComponent(DeployedComponentID deployedId,
                              ConfigurationID configId,
                              HostID hostId,
                              VMComponentDefnID vmId,
                              ServiceComponentDefnID serviceId,
                              ComponentTypeID deployedTypeID)

BasicDeployedComponent

public BasicDeployedComponent(BasicDeployedComponent deployedComponent)
Method Detail

isEnabled

public boolean isEnabled()
Description copied from interface: DeployedComponent
Indicates if the deployed component is enabled for starting.

Specified by:
isEnabled in interface DeployedComponent
Returns:
true if the deployed component is enabled for starting

setIsEnabled

public void setIsEnabled(boolean enable)

isDeployedService

public boolean isDeployedService()
Indicates whether this object represents a deployed service component definition (returns true) or a deployed vm component definition (returns false).

Specified by:
isDeployedService in interface DeployedComponent
Returns:
true if this is a deployed service, false if it is a deployed vm

isDeployedConnector

public boolean isDeployedConnector()
Indicates whether this object represents a deployed connector. If isDeployedService() returns false, this will always return false.

Specified by:
isDeployedConnector in interface DeployedComponent
Returns:
true if this is a deployed connector.

getServiceComponentDefnID

public ServiceComponentDefnID getServiceComponentDefnID()
Description copied from interface: DeployedComponent
Returns the ComponentID for the service component that is deployed. Null will be returned if this DeployedComponent represents either a a deployed VM.

Specified by:
getServiceComponentDefnID in interface DeployedComponent
Returns:
the component id, null when this is a deployed VM

getConfigurationID

public ConfigurationID getConfigurationID()
Description copied from interface: DeployedComponent
Returns the ConfigurationID indicating the configuration under which this deployed component belongs.

Specified by:
getConfigurationID in interface DeployedComponent
Returns:
the configuration id

getVMComponentDefnID

public VMComponentDefnID getVMComponentDefnID()
Description copied from interface: DeployedComponent
Returns the ComponentID for the VM that this component is deployed on, or if this object represents the deployed VM itself.

Specified by:
getVMComponentDefnID in interface DeployedComponent
Returns:
the vm id

getHostID

public HostID getHostID()
Description copied from interface: DeployedComponent
Returns the HostID for the Host that this component is deployed on.

Specified by:
getHostID in interface DeployedComponent
Returns:
the host id

getDeployedComponentDefnID

public ComponentDefnID getDeployedComponentDefnID()
Description copied from interface: DeployedComponent
Returns the ComponentDefnID for the component that is deployed. This can either be a ServiceComponentDefnId or a VMComponentDefnID.

Specified by:
getDeployedComponentDefnID in interface DeployedComponent
Returns:
ComponentDefnID that is represented as the deployed component

getDeployedComponentDefn

public ComponentDefn getDeployedComponentDefn(Configuration configuration)
Description copied from interface: DeployedComponent
Returns the ComponentDefn that is deployed.

Specified by:
getDeployedComponentDefn in interface DeployedComponent

isDependentUpon

public boolean isDependentUpon(BaseID componentObjectId)
Description copied from interface: ComponentObject
Returns true if this object is dependent upon the specified ComponentObjectID

Specified by:
isDependentUpon in interface ComponentObject
Overrides:
isDependentUpon in class BasicComponentObject
Parameters:
componentObjectId - is the id to check for dependencies for
Returns:
boolean true if this object is dependent

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

toString

public java.lang.String toString()
Returns a string representing the name of the object. This has been overriden for GUI display purposes - the Console only wants to display the "name" (not the "fullname") of a component object.Me

Overrides:
toString in class BasicComponentObject
Returns:
the string representation of this instance.


Copyright © 2009. All Rights Reserved.