com.metamatrix.common.config.model
Class ConfigurationObjectEditorHelper

java.lang.Object
  extended by com.metamatrix.common.config.model.ConfigurationObjectEditorHelper

public class ConfigurationObjectEditorHelper
extends java.lang.Object

The ConfigurationObjectEditorHelper provides methods that do not deal with actions. This is new for the implementation of using configuration models


Field Summary
static int ADD
          The command to signify addition of an attribute.
static int REMOVE
          The command to signify removal of an attribute.
static boolean set
           
static int SET
          The command to signify setting of an attribute.
 
Constructor Summary
ConfigurationObjectEditorHelper()
           
 
Method Summary
static Configuration addAuthenticationProviderComponent(Configuration t, AuthenticationProvider provider)
           
static Configuration addComponentDefn(Configuration t, ComponentDefn defn)
           
static Configuration addConfigurationComponentDefn(Configuration t, ComponentDefn defn)
           
static Configuration addConfigurationDeployedComponent(Configuration t, DeployedComponent deployedComponent)
           
static Configuration addConfigurationHostComponent(Configuration t, Host host)
           
static Configuration addDeployedComponent(Configuration t, DeployedComponent deployComponent)
           
static Configuration addHostComponent(Configuration t, Host host)
           
static ComponentObject addProperty(ComponentObject t, java.lang.String name, java.lang.String value)
           
static ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc, ServiceComponentDefnID serviceComponentDefnID)
          Adds an existing ServiceComponentDefn to indicated PSC.
static ProductType addServiceComponentType(ProductType productType, ComponentType serviceComponentType)
          Adds the service type represented by the indicated ComponentType to the list of legal service types of the indicated ProductType.
static Host createHost(Configuration config, java.lang.String hostName)
           
static Configuration delete(ComponentObjectID targetID, Configuration configuration)
           
static java.util.Properties getEditableProperties(ComponentObject t)
           
static ComponentObject modifyProperties(ComponentObject t, java.util.Properties props, int command)
           
static ComponentObject removeProperty(ComponentObject t, java.lang.String name)
           
static ProductType removeServiceComponentType(ProductType productType, ComponentType serviceComponentType)
          Removes the service type represented by the indicated ComponentType from the list of legal service types of the indicated ProductType.
static ProductServiceConfig resetServices(ProductServiceConfig psc)
           
static ComponentObject setCreationChangedHistory(ComponentObject defn, java.lang.String createdBy, java.lang.String creationDate)
           
static ComponentType setCreationChangedHistory(ComponentType type, java.lang.String createdBy, java.lang.String creationDate)
           
static void setEnabled(ServiceComponentDefnID serviceComponentDefnID, ProductServiceConfig psc, boolean enabled)
          This is a lighterweight version of the other setEnabled method.
static ComponentObject setLastChangedHistory(ComponentObject defn, java.lang.String lastChangedBy, java.lang.String lastChangedDate)
           
static ComponentType setLastChangedHistory(ComponentType type, java.lang.String lastChangedBy, java.lang.String lastChangedDate)
           
protected static ComponentType setParentComponentTypeID(ComponentType t, ComponentTypeID parentID)
           
static ComponentObject setProperty(ComponentObject t, java.lang.String name, java.lang.String value)
           
static void setRoutingUUID(ServiceComponentDefn serviceComponentDefn, java.lang.String newRoutingUUID)
          Sets this ServiceComponentDefn's String routing UUID.
protected static java.lang.Object verifyTargetClass(java.lang.Object target, java.lang.Class requiredClass)
          Subclass helper method that simply verifies that the specified target is either an instance of the specified class (or interface).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET

public static final int SET
The command to signify setting of an attribute.

See Also:
Constant Field Values

ADD

public static final int ADD
The command to signify addition of an attribute.

See Also:
Constant Field Values

REMOVE

public static final int REMOVE
The command to signify removal of an attribute.

See Also:
Constant Field Values

set

public static boolean set
Constructor Detail

ConfigurationObjectEditorHelper

public ConfigurationObjectEditorHelper()
Method Detail

createHost

public static Host createHost(Configuration config,
                              java.lang.String hostName)
                       throws ConfigurationException
Throws:
ConfigurationException

setLastChangedHistory

public static ComponentType setLastChangedHistory(ComponentType type,
                                                  java.lang.String lastChangedBy,
                                                  java.lang.String lastChangedDate)

setCreationChangedHistory

public static ComponentType setCreationChangedHistory(ComponentType type,
                                                      java.lang.String createdBy,
                                                      java.lang.String creationDate)

setLastChangedHistory

public static ComponentObject setLastChangedHistory(ComponentObject defn,
                                                    java.lang.String lastChangedBy,
                                                    java.lang.String lastChangedDate)

setCreationChangedHistory

public static ComponentObject setCreationChangedHistory(ComponentObject defn,
                                                        java.lang.String createdBy,
                                                        java.lang.String creationDate)

setRoutingUUID

public static void setRoutingUUID(ServiceComponentDefn serviceComponentDefn,
                                  java.lang.String newRoutingUUID)
Sets this ServiceComponentDefn's String routing UUID. This method will modify the ServiceComponentDefn parameter, and also create the action to set the routing UUID at the remote server.

Parameters:
serviceComponentDefn - ServiceComponentDefn to have it's routing UUID modified - this instance will be locally modified, and an action will also be created for execution as a transaction later on
newRoutingUUID - new String routing UUID for the indicated ServiceComponentDefn

setEnabled

public static void setEnabled(ServiceComponentDefnID serviceComponentDefnID,
                              ProductServiceConfig psc,
                              boolean enabled)
This is a lighterweight version of the other setEnabled method. It simply modifies the ServiceComponentDefn parameter and creates the necessary change object. It cannot update the Configuration of the ServiceComponentDefn, nor can it automatically delete any DeployedComponents of the ServiceComponentDefn parameter, if the ServiceComponentDefn is being disabled. This method is only needed by the JDBC spi and maybe the import/export tool.


addHostComponent

public static Configuration addHostComponent(Configuration t,
                                             Host host)

addServiceComponentDefn

public static ProductServiceConfig addServiceComponentDefn(ProductServiceConfig psc,
                                                           ServiceComponentDefnID serviceComponentDefnID)
Adds an existing ServiceComponentDefn to indicated PSC. The ServiceComponentDefn will be removed from any PSC it previously belonged to.

Parameters:
psc - ProductServiceConfig to have service comp defn added to
serviceComponentDefnID - will be added to the indicated ProductServiceConfiguration (and removed from any PSC it previously belonged to).

addComponentDefn

public static Configuration addComponentDefn(Configuration t,
                                             ComponentDefn defn)

addDeployedComponent

public static Configuration addDeployedComponent(Configuration t,
                                                 DeployedComponent deployComponent)

addProperty

public static ComponentObject addProperty(ComponentObject t,
                                          java.lang.String name,
                                          java.lang.String value)

setProperty

public static ComponentObject setProperty(ComponentObject t,
                                          java.lang.String name,
                                          java.lang.String value)

resetServices

public static ProductServiceConfig resetServices(ProductServiceConfig psc)

removeProperty

public static ComponentObject removeProperty(ComponentObject t,
                                             java.lang.String name)

modifyProperties

public static ComponentObject modifyProperties(ComponentObject t,
                                               java.util.Properties props,
                                               int command)

delete

public static Configuration delete(ComponentObjectID targetID,
                                   Configuration configuration)
                            throws ConfigurationException
Throws:
ConfigurationException

addServiceComponentType

public static ProductType addServiceComponentType(ProductType productType,
                                                  ComponentType serviceComponentType)
Adds the service type represented by the indicated ComponentType to the list of legal service types of the indicated ProductType.

Parameters:
productType - ProductType to have a new service type added to
serviceComponentType - ComponentType to be added to the ProductType

setParentComponentTypeID

protected static ComponentType setParentComponentTypeID(ComponentType t,
                                                        ComponentTypeID parentID)

removeServiceComponentType

public static ProductType removeServiceComponentType(ProductType productType,
                                                     ComponentType serviceComponentType)
Removes the service type represented by the indicated ComponentType from the list of legal service types of the indicated ProductType.

Parameters:
productType - ProductType to have the service type taken from
serviceComponentType - ComponentType to be taken from the ProductType

addConfigurationComponentDefn

public static Configuration addConfigurationComponentDefn(Configuration t,
                                                          ComponentDefn defn)

addConfigurationDeployedComponent

public static Configuration addConfigurationDeployedComponent(Configuration t,
                                                              DeployedComponent deployedComponent)

addConfigurationHostComponent

public static Configuration addConfigurationHostComponent(Configuration t,
                                                          Host host)

addAuthenticationProviderComponent

public static Configuration addAuthenticationProviderComponent(Configuration t,
                                                               AuthenticationProvider provider)

getEditableProperties

public static java.util.Properties getEditableProperties(ComponentObject t)

verifyTargetClass

protected static java.lang.Object verifyTargetClass(java.lang.Object target,
                                                    java.lang.Class requiredClass)
                                             throws java.lang.IllegalArgumentException
Subclass helper method that simply verifies that the specified target is either an instance of the specified class (or interface).

Parameters:
target - the target or target identifier.
requiredClass - the class/interface that the target must be an instance of.
Returns:
the target object (for convenience)
Throws:
java.lang.IllegalArgumentException - if either the target is not an instance of the specified class.


Copyright © 2009. All Rights Reserved.