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
           
 
Field Summary
static java.lang.String DEPLOYMENTS_HDR
          The text of all the deployements 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 addDeployedService(DeployedComponent theService, VMComponentDefn theProcess, Host theHost, 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 deleteHost(Host theHost, Configuration theConfig)
          Deletes a host node from the model.
 DefaultTreeNode getUserObjectNode(java.lang.Object theUserObject)
          Gets the requested user object's node.
 void init(Configuration theConfig)
           
 boolean isHeaderNode(DefaultTreeNode theNode)
          Indicates if the given node is a deployments header node or a PSC definitions header node.
 void modifyDeployedProcess(VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Modifies a deployed host node in the model.
 void modifyDeployedService(DeployedComponent theService, VMComponentDefn theProcess, Host theHost, Configuration theConfig)
          Modifies a service definitions node in the model.
 void modifyHost(Host theHost, Configuration theConfig)
          Modifies a host node in the model.
 void modifyServiceDefintion(ServiceComponentDefn theService, 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.

Constructor Detail

ConfigurationTreeModel

public ConfigurationTreeModel()
                       throws ExternalException
Constructs and ConfigurationTreeModel.

Throws:
ExternalException - if problems occur during construction
Method Detail

init

public void init(Configuration theConfig)

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

addDeployedService

public void addDeployedService(DeployedComponent theService,
                               VMComponentDefn theProcess,
                               Host theHost,
                               Configuration theConfig)
Adds a service definition node to the model.

Parameters:
theService - the user object of the deployed service definition node being created
theProcess - the user object of the new node's VMComponentDefn ancestor node
theHost - the users object of the new node's Host 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

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.

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

modifyServiceDefintion

public void modifyServiceDefintion(ServiceComponentDefn theService,
                                   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

modifyDeployedService

public void modifyDeployedService(DeployedComponent theService,
                                  VMComponentDefn theProcess,
                                  Host theHost,
                                  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.