com.metamatrix.console.ui.views.deploy.model
Class ConfigurationTreeModel

java.lang.Object
  extended by com.metamatrix.toolbox.ui.widget.tree.DefaultTreeModel
      extended by com.metamatrix.console.ui.views.deploy.model.ConfigurationTreeModel
All Implemented Interfaces:
ConfigurationChangeListener, TreeConstants, java.util.EventListener, javax.swing.tree.TreeModel

public final class ConfigurationTreeModel
extends DefaultTreeModel
implements ConfigurationChangeListener

The ConfigurationTreeModel is the tree model used for deployments and Product Service Configurations (PSC) configuration objects.

Since:
Golden Gate
Version:
1.0
Author:
Dan Florian

Nested Class Summary
 class ConfigurationTreeModel.HostWrapper
           
 class ConfigurationTreeModel.PscWrapper
          The PscWrapper class wraps a ProductServiceConfig so that PSC definitions and deployed PSCs can be distinguished.
 
Field Summary
static java.lang.String DEPLOYMENTS_HDR
          The text of all the deployements header nodes.
static java.lang.String PSC_DEFS_HDR
          The text of all the PSC definitions header nodes.
 
Fields inherited from class com.metamatrix.toolbox.ui.widget.tree.DefaultTreeModel
MODEL_CHANGED, NODE_ADDED, NODE_CHANGED, NODE_REMOVED, NODES_CHANGED
 
Fields inherited from interface com.metamatrix.toolbox.ui.widget.tree.TreeConstants
NAME_PROPERTY
 
Constructor Summary
ConfigurationTreeModel()
          Constructs and ConfigurationTreeModel.
 
Method Summary
 void addConfigurationTreeModelListener(ConfigurationTreeModelListener theListener)
          Adds the given listener to those being notified.
 void addDeployedHost(Host theHost, Configuration theConfig)
          Adds a host node to the model.
 void addDeployedProcess(VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Adds a process node to the model.
 void addDeployedPsc(ProductServiceConfig thePsc, VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Adds a deployed PSC node to the model.
 void addPscDefn(ProductServiceConfig thePsc, ProductType theProduct, Configuration theConfig)
          Adds a PSC definition node to the model.
 void addServiceDefinition(ServiceComponentDefn theService, ProductServiceConfig thePsc, ProductType theProduct, Configuration theConfig)
          Adds a service definition node to the model.
 void configurationChanged(ConfigurationChangeEvent theEvent)
          Invoked when a ConfigurationChangeEvent occurs.
 boolean contains(DefaultTreeNode theNode)
           
 void deleteDeployedProcess(VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Deletes a process node from the model.
 void deleteDeployedPsc(ProductServiceConfig thePsc, VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Deletes a deployed PSC node from the model.
 void deleteHost(Host theHost, Configuration theConfig)
          Deletes a host node from the model.
 void deletePscDefintion(ProductServiceConfig thePsc, ProductType theProduct, Configuration theConfig)
          Deletes a PSC definition node from the model.
 DefaultTreeNode getDeploymentsHeaderNode(Configuration theConfig)
          Gets the deployments header node for the given configuration.
 DefaultTreeNode getPscDefinitionsHeaderNode(Configuration theConfig)
          Gets the PSC definitions header node for the given configuration.
 DefaultTreeNode getPscNode(ProductServiceConfig thePsc, Configuration theConfig)
          Gets the requested PSC definition node.
 DefaultTreeNode getPscNode(ProductServiceConfig thePsc, VMComponentDefn theProcess)
          Gets the requested deployed PSC node.
 DefaultTreeNode getUserObjectNode(java.lang.Object theUserObject)
          Gets the requested user object's node.
 boolean isDeploymentsHeaderNode(DefaultTreeNode theNode)
          Indicates if the given node is a deployments header node.
 boolean isHeaderNode(DefaultTreeNode theNode)
          Indicates if the given node is a deployments header node or a PSC definitions header node.
 boolean isPscDefinitionsHeaderNode(DefaultTreeNode theNode)
          Indicates if the given node is a PSC definitions header node.
 void modifyDeployedProcess(VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Modifies a deployed host node in the model.
 void modifyHost(Host theHost, Configuration theConfig)
          Modifies a host node in the model.
 void modifyPscDefinition(ProductServiceConfig thePsc, ProductType theProduct, Configuration theConfig)
          Modifies a PSC definitions node in the model.
 void modifyServiceDefintion(ServiceComponentDefn theService, ProductServiceConfig thePsc, ProductType theProduct, Configuration theConfig)
          Modifies a service definitions node in the model.
 void refresh()
          Clears all nodes and all caches.
 void removeConfigurationTreeModelListener(ConfigurationTreeModelListener theListener)
          Removes the given listener from those being notified.
 void removeUserObject(java.lang.Object theUserObject)
          Removes the user object's node and all it's children nodes.
 
Methods inherited from class com.metamatrix.toolbox.ui.widget.tree.DefaultTreeModel
addNode, addTreeModelListener, addVetoedChangeListener, createDefaultTreeView, executeTransaction, fireChildrenChangedEvent, fireEvent, fireEvent, fireEvent, fireModelChangedEvent, fireNodeAddedEvent, fireNodeChangedEvent, fireNodeRemovedEvent, fireVetoedChangeEvent, getChild, getChildCount, getChildIndex, getEditor, getIndexOfChild, getName, getPath, getPath, getRoot, getTransactionSource, getTreeView, initializeDefaultTreeModel, isLeaf, isRootHidden, moveNode, moveNode, removeNode, removeTreeModelListener, removeVetoedChangeListener, setName, setTransactionSource, setTreeView, setTreeWidget, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEPLOYMENTS_HDR

public static final java.lang.String DEPLOYMENTS_HDR
The text of all the deployements header nodes.


PSC_DEFS_HDR

public static final java.lang.String PSC_DEFS_HDR
The text of all the PSC definitions header nodes.

Constructor Detail

ConfigurationTreeModel

public ConfigurationTreeModel()
                       throws ExternalException
Constructs and ConfigurationTreeModel.

Throws:
ExternalException - if problems occur during construction
Method Detail

addConfigurationTreeModelListener

public void addConfigurationTreeModelListener(ConfigurationTreeModelListener theListener)
Adds the given listener to those being notified.

Parameters:
theListener - the listener who wants to be notified

addDeployedHost

public void addDeployedHost(Host theHost,
                            Configuration theConfig)
Adds a host node to the model.

Parameters:
theHost - the user object of the host node being created
theConfig - the user object of the new node's configuration ancestor node

addDeployedProcess

public void addDeployedProcess(VMComponentDefn theProcess,
                               Host theHost,
                               Configuration theConfig)
Adds a process node to the model.

Parameters:
theProcess - the user object of the process node being created
theHost - the user object of the new node's host ancestor node is being added
theConfig - the user object of the new node's configuration ancestor node

addDeployedPsc

public void addDeployedPsc(ProductServiceConfig thePsc,
                           VMComponentDefn theProcess,
                           Host theHost,
                           Configuration theConfig)
Adds a deployed PSC node to the model.

Parameters:
thePsc - the user object of the deployed PSC node being created
theProcess - the user object of the new node's process ancestor node
theHost - the user object of the new node's host ancestor node
theConfig - the user object of the new node's configuration ancestor node

addPscDefn

public void addPscDefn(ProductServiceConfig thePsc,
                       ProductType theProduct,
                       Configuration theConfig)
Adds a PSC definition node to the model.

Parameters:
thePsc - the user object of the PSC definition node being created
theProduct - the user object of the new node's product ancestor node
theConfig - the user object of the new node's configuration ancestor node

addServiceDefinition

public void addServiceDefinition(ServiceComponentDefn theService,
                                 ProductServiceConfig thePsc,
                                 ProductType theProduct,
                                 Configuration theConfig)
Adds a service definition node to the model.

Parameters:
theService - the user object of the service definition node being created
thePsc - the user object of the new node's PSC definition ancestor node
theProduct - the users object of the new node's product ancestor node
theConfig - the user object of the new node's configuration ancestor node

configurationChanged

public void configurationChanged(ConfigurationChangeEvent theEvent)
Invoked when a ConfigurationChangeEvent occurs.

Specified by:
configurationChanged in interface ConfigurationChangeListener
Parameters:
theEvent - the event to process

contains

public boolean contains(DefaultTreeNode theNode)

deleteHost

public void deleteHost(Host theHost,
                       Configuration theConfig)
Deletes a host node from the model.

Parameters:
theHost - the user object of the host node being deleted
theConfig - the user object of the deleted node's configuration ancestor node

deleteDeployedProcess

public void deleteDeployedProcess(VMComponentDefn theProcess,
                                  Host theHost,
                                  Configuration theConfig)
Deletes a process node from the model.

Parameters:
theProcess - the user object of the process node being created
theHost - the user object of the deleted node's host ancestor node
theConfig - the user object of the deleted node's configuration ancestor node

deleteDeployedPsc

public void deleteDeployedPsc(ProductServiceConfig thePsc,
                              VMComponentDefn theProcess,
                              Host theHost,
                              Configuration theConfig)
Deletes a deployed PSC node from the model.

Parameters:
thePsc - the user object of the deployed PSC node being created
theProcess - the user object of the deleted node's process ancestor node
theHost - the user object of the deleted node's host ancestor node
theConfig - the user object of the deleted node's configuration ancestor node

deletePscDefintion

public void deletePscDefintion(ProductServiceConfig thePsc,
                               ProductType theProduct,
                               Configuration theConfig)
Deletes a PSC definition node from the model.

Parameters:
thePsc - the user object of the PSC definition node being deleted
theProduct - the user object of the deleted node's product ancestor node
theConfig - the user object of the deleted node's configuration ancestor node

getDeploymentsHeaderNode

public DefaultTreeNode getDeploymentsHeaderNode(Configuration theConfig)
Gets the deployments header node for the given configuration.

Parameters:
theConfig - the configuration whose header node is being requested
Returns:
the deployments header node

getPscDefinitionsHeaderNode

public DefaultTreeNode getPscDefinitionsHeaderNode(Configuration theConfig)
Gets the PSC definitions header node for the given configuration.

Parameters:
theConfig - the configuration whose header node is being requested
Returns:
the PSC definitions header node

getPscNode

public DefaultTreeNode getPscNode(ProductServiceConfig thePsc,
                                  Configuration theConfig)
Gets the requested PSC definition node.

Parameters:
thePsc - the user object of the PSC definition node
theConfig - the user object of the PSC definition node's configuration ancestor node

getPscNode

public DefaultTreeNode getPscNode(ProductServiceConfig thePsc,
                                  VMComponentDefn theProcess)
Gets the requested deployed PSC node.

Parameters:
thePsc - the user object of the deployed PSC node
theProcess - the user object of the deployed PSC node's process ancestor node

getUserObjectNode

public DefaultTreeNode getUserObjectNode(java.lang.Object theUserObject)
Gets the requested user object's node.

Parameters:
theUserObject - the user object whose node is being requested
Returns:
the requested user object's node

isHeaderNode

public boolean isHeaderNode(DefaultTreeNode theNode)
Indicates if the given node is a deployments header node or a PSC definitions header node.

Parameters:
theNode - the node being checked
Returns:
true if the node is a header node; false otherwise.

isDeploymentsHeaderNode

public boolean isDeploymentsHeaderNode(DefaultTreeNode theNode)
Indicates if the given node is a deployments header node.

Parameters:
theNode - the node being checked
Returns:
true if the node is a deployments header node; false otherwise.

isPscDefinitionsHeaderNode

public boolean isPscDefinitionsHeaderNode(DefaultTreeNode theNode)
Indicates if the given node is a PSC definitions header node.

Parameters:
theNode - the node being checked
Returns:
true if the node is a PSC definitions header node; false otherwise.

modifyDeployedProcess

public void modifyDeployedProcess(VMComponentDefn theProcess,
                                  Host theHost,
                                  Configuration theConfig)
Modifies a deployed host node in the model.

Parameters:
theProcess - the user object of the node being modified
theHost - the user object of the modified node's host ancestor node
theConfig - the user object of the modified node's configuration ancestor node

modifyHost

public void modifyHost(Host theHost,
                       Configuration theConfig)
Modifies a host node in the model.

Parameters:
theHost - the user object of the node being modified
theConfig - the user object of the modified node's configuration ancestor node

modifyPscDefinition

public void modifyPscDefinition(ProductServiceConfig thePsc,
                                ProductType theProduct,
                                Configuration theConfig)
Modifies a PSC definitions node in the model.

Parameters:
thePsc - the user object of the node being modified
theProduct - the user object of the modified node's product ancestor node
theConfig - the user object of the modified node's configuration ancestor node

modifyServiceDefintion

public void modifyServiceDefintion(ServiceComponentDefn theService,
                                   ProductServiceConfig thePsc,
                                   ProductType theProduct,
                                   Configuration theConfig)
Modifies a service definitions node in the model.

Parameters:
theService - the user object of the node being modified
thePsc - the user object of the modified node's PSC definition ancestor node
theProduct - the user object of the modified node's product ancestor node
theConfig - the user object of the modified node's configuration ancestor node

refresh

public void refresh()
Clears all nodes and all caches.


removeConfigurationTreeModelListener

public void removeConfigurationTreeModelListener(ConfigurationTreeModelListener theListener)
Removes the given listener from those being notified.

Parameters:
theListener - the listener being removed

removeUserObject

public void removeUserObject(java.lang.Object theUserObject)
Removes the user object's node and all it's children nodes. All corresponding objects being cached are also removed from the cache.

Parameters:
theUserObject - the user object being removed


Copyright © 2009. All Rights Reserved.