|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.platform.service.controller.AbstractService
com.metamatrix.platform.config.service.ConfigurationServiceImpl
public class ConfigurationServiceImpl
Caching only Hosts and ComponentTypes - but these will be updated by a scheduled thread
| Field Summary |
|---|
| Fields inherited from interface com.metamatrix.platform.config.api.service.ConfigurationServiceInterface |
|---|
NAME |
| Fields inherited from interface com.metamatrix.platform.service.api.ServiceInterface |
|---|
WAIT_TO_DIE_TIME |
| Constructor Summary | |
|---|---|
ConfigurationServiceImpl()
|
|
| Method Summary | |
|---|---|
Host |
addHost(java.lang.String hostName,
java.lang.String principalName,
java.util.Properties properties)
Add Host to Configuration Add a new Host to the System (MetaMatrix Cluster) |
VMComponentDefn |
addProcess(java.lang.String processName,
java.lang.String hostName,
java.lang.String principalName,
java.util.Properties properties)
Add Process for the specified Host to Configuration Add a new Virtuial Machine to the System (MetaMatrix Cluster) |
protected void |
addProperty(java.util.Properties source,
java.lang.String sourceName,
java.util.Properties props,
java.lang.String propName)
|
java.util.List |
checkPropertiesDecryptable(java.util.List defns)
Check whether the encrypted properties for the specified ComponentDefns can be decrypted. |
protected void |
closeService()
Close the service to new work if applicable. |
ConnectorBinding |
createConnectorBinding(java.lang.String connectorBindingName,
java.lang.String connectorType,
java.lang.String vmName,
java.lang.String principalName,
java.util.Properties properties)
Deploy a new Connector Binding into Configuration |
ConfigurationObjectEditor |
createEditor()
Returns a ConfigurationObjectEditor to perform editing operations on a configuration type object. |
void |
delete(ComponentObject theObject,
boolean theDeleteDependenciesFlag,
java.lang.String principalName)
Deletes a component object. |
void |
delete(ComponentType componentType,
java.lang.String principalName)
Delete a Component Type |
DeployedComponent |
deployService(VMComponentDefnID theProcessID,
java.lang.String serviceName,
java.lang.String principalName)
Deploys the ServiceComponentDefns contained by the Configuration, onto the specified Host and VM. |
java.util.Set |
executeTransaction(ActionDefinition action,
java.lang.String principalName)
Execute as a single transaction the specified action, and optionally return the set of objects or object IDs that were affected/modified by the action. |
java.util.Set |
executeTransaction(java.util.List actions,
java.lang.String principalName)
Execute as a single transaction the specified actions, and optionally return the set of objects or object IDs that were affected/modified by the action. |
java.util.Collection |
getAllComponentTypeDefinitions(ComponentTypeID typeID)
Returns the all component type definitions for the specified ComponentTypeID. |
java.util.Collection |
getAllComponentTypes(boolean includeDeprecated)
Returns a List of type ComponentType that represents all the ComponentTypes defined. |
ComponentDefn |
getComponentDefn(ConfigurationID configurationID,
ComponentDefnID componentDefnID)
Returns a ComponentDefn for the specified ComponentDefnID. |
ComponentType |
getComponentType(ComponentTypeID id)
Returns a ComponentType for the specified ComponentTypeID |
java.util.Collection |
getComponentTypeDefinitions(ComponentTypeID componentTypeID)
Returns the component type definitions for the specified ComponentTypeID. |
java.util.Collection |
getComponentTypeDefinitions(ConfigurationModelContainer config,
ComponentTypeID componentTypeID)
|
java.util.Collection |
getConfigurationAndDependents(ConfigurationID configID)
Returns a Collection containing the Configuration object for the specified ConfigurationID id, and also any dependant objects needed to fully define this configuration, such as Host objects, ComponentType objects, and ComponentTypeDefn objects. |
ConfigurationModelContainer |
getConfigurationModel(java.lang.String configName)
Returns the ConfigurationModelContainer that contains everything (i.e., ComponentTypes, Shared Resources and
ComponentDefns) that the server needs to start. |
protected XMLConfigurationConnector |
getConnection(java.lang.String principal)
|
Configuration |
getCurrentConfiguration()
Returns the operational Configuration, which should reflect
the desired runtime state of the system. |
ConfigurationID |
getCurrentConfigurationID()
Returns the ID of the operational Configuration, which should reflect
the desired runtime state of the system. |
Host |
getHost(HostID hostID)
Returns a Host for the specified HostID. |
java.util.Collection |
getHosts()
Returns a Collection of currently defined hosts. |
Configuration |
getNextStartupConfiguration()
Returns the next startup Configuration, the Configuration
that the system will next boot up with (once it is entirely shut down). |
ConfigurationID |
getNextStartupConfigurationID()
Returns the ID of the next startup Configuration, which should reflect
the desired runtime state of the system. |
java.util.Collection |
getResources()
Returns a Collection of ResourceDescriptor
for all internal resources defined to the system. |
ConnectorBinding |
importConnectorBinding(java.io.InputStream inputStream,
java.lang.String name,
java.lang.String vmName,
java.lang.String principalName)
Import a connector Binding from InputStream, and deploy it to a PSC. |
ComponentType |
importConnectorType(java.io.InputStream inputStream,
java.lang.String name,
java.lang.String principalName)
the name is nullable, if not specified, then the name in the inputStream (connector type file) will be used |
protected void |
initService(java.util.Properties env)
Perform initialization and commence processing. |
protected void |
killService()
Terminate all processing and reclaim resources. |
java.lang.Object |
modify(ComponentObject theObject,
java.util.Properties theProperties,
java.lang.String principalName)
Modify a Component in Configuration |
void |
saveResources(java.util.Collection resourceDescriptors,
java.lang.String principalName)
Save the resource changes based on each ResourceDescriptor
in the collection. |
void |
setSystemPropertyValue(java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String principalName)
Set System Property in Next Configuration |
void |
updateSystemPropertyValues(java.util.Properties properties,
java.lang.String principalName)
Set System Property in Next Configuration |
protected void |
waitForServiceToClear()
Wait until the service has completed all outstanding work. |
| Methods inherited from class com.metamatrix.platform.service.controller.AbstractService |
|---|
checkState, die, dieNow, getCurrentState, getHostname, getID, getInitException, getInstanceName, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getResourceName, getServiceData, getServiceName, getServiceType, getStartTime, getStateChangeTime, init, isAlive, isClosed, isInitialized, isOpen, processEvent, registerForEvents, setInitException, unregisterForEvents, updateState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.metamatrix.platform.service.api.ServiceInterface |
|---|
checkState, die, dieNow, getCurrentState, getHostname, getID, getInitException, getProcessName, getProperties, getQueueStatistics, getQueueStatistics, getServiceData, getServiceType, getStartTime, getStateChangeTime, init, isAlive, setInitException, updateState |
| Constructor Detail |
|---|
public ConfigurationServiceImpl()
| Method Detail |
|---|
protected void initService(java.util.Properties env)
throws java.lang.Exception
initService in class AbstractServicejava.lang.Exception
protected void closeService()
throws java.lang.Exception
closeService in class AbstractServicejava.lang.Exception
protected void waitForServiceToClear()
throws java.lang.Exception
waitForServiceToClear in class AbstractServicejava.lang.Exceptionprotected void killService()
killService in class AbstractService
public ConfigurationObjectEditor createEditor()
throws ConfigurationException
ConfigurationServiceInterfaceConfigurationObjectEditor to perform editing operations on a configuration type object. The
editing process will create actions for each specific type of editing operation. Those actions are what need to be
submitted to the ConfigurationService for actual updates to occur.
createEditor in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public ConfigurationID getCurrentConfigurationID()
throws ConfigurationException
Configuration, which should reflect
the desired runtime state of the system.
getCurrentConfigurationID in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public ConfigurationID getNextStartupConfigurationID()
throws ConfigurationException
Configuration, which should reflect
the desired runtime state of the system.
getNextStartupConfigurationID in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public Configuration getCurrentConfiguration()
throws ConfigurationException
Configuration, which should reflect
the desired runtime state of the system.
getCurrentConfiguration in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public Configuration getNextStartupConfiguration()
throws ConfigurationException
Configuration, the Configuration
that the system will next boot up with (once it is entirely shut down).
getNextStartupConfiguration in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public ConfigurationModelContainer getConfigurationModel(java.lang.String configName)
throws ConfigurationException
ConfigurationServiceInterfaceConfigurationModelContainer that contains everything (i.e., ComponentTypes, Shared Resources and
ComponentDefns) that the server needs to start.
getConfigurationModel in interface ConfigurationServiceInterfaceconfigName - if the name of the configuration model to obtain
ConfigurationException
public java.util.Collection getConfigurationAndDependents(ConfigurationID configID)
throws ConfigurationException
Returns a Collection containing the Configuration object for the specified ConfigurationID id, and also any dependant objects needed to fully define this configuration, such as Host objects, ComponentType objects, and ComponentTypeDefn objects.
A Configuration instance contains all of the
ComponentDefn objects that "belong" to just that
Configuration model: VM component definitions, service
component definitions, product service configurations, and
deployed components. Objects such as Host objects,
ComponentType objects, ComponentTypeDefn, Resources, and
ConnectorBinding objects describe or support
ComponentDefns, but are not contained by a Configuration. Therefore,
they are included in this Collection for convenience.
The Collection will contain instances of
BaseObject.
Specifically, this Map should contain the objects for:
one configuration object, one or more Host objects, one or more
ComponentType objects, and one or more ComponentTypeDefn objects.
This method is intended to facilitate exporting a configuration to XML.
Here is what the Collection would contain at runtime:
Configuration instance Host instance1 Host instance2 ... ConnectorBinding instance1 ConnectorBinding instance2 ... SharedResource intance1 SharedResource instance ... ComponentType instance1 ComponentType instance2 ... ComponentTypeDefn instance1 ComponentTypeDefn instance2
getConfigurationAndDependents in interface ConfigurationServiceInterfaceconfigID - ID Of a Configuration
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
public ComponentType getComponentType(ComponentTypeID id)
throws ConfigurationException
ConfigurationServiceInterfaceComponentType for the specified ComponentTypeID
getComponentType in interface ConfigurationServiceInterfaceid - is for the requested component type.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
public java.util.Collection getAllComponentTypes(boolean includeDeprecated)
throws ConfigurationException
ConfigurationServiceInterfaceList of type ComponentType that represents all the ComponentTypes defined.
getAllComponentTypes in interface ConfigurationServiceInterfaceincludeDeprecated - true if class names that have been deprecated should be included in the returned list, or false if only
non-deprecated constants should be returned.
ComponentType
ConfigurationException - if an error occurred within or during communication with the Configuration Service.#ComponentType
public java.util.Collection getComponentTypeDefinitions(ComponentTypeID componentTypeID)
throws ConfigurationException
ConfigurationServiceInterfaceComponentTypeID. This does not return the
dependent definitions for service type components.
getComponentTypeDefinitions in interface ConfigurationServiceInterfacecomponentTypeID - is a ComponentTypeID
ConfigurationException - if an error occurred within or during communication with the Configuration Service.getDependentComponentTypeDefinitions(ComponentTypeID)
public java.util.Collection getComponentTypeDefinitions(ConfigurationModelContainer config,
ComponentTypeID componentTypeID)
public java.util.Collection getAllComponentTypeDefinitions(ComponentTypeID typeID)
throws ConfigurationException
ConfigurationServiceInterfaceComponentTypeID. This includes the dependent
definitions for service type components.
getAllComponentTypeDefinitions in interface ConfigurationServiceInterfacetypeID - is a ComponentTypeID
ConfigurationException - if an error occurred within or during communication with the Configuration Service.getDependentComponentTypeDefinitions(ComponentTypeID)
public Host getHost(HostID hostID)
throws ConfigurationException
ConfigurationServiceInterfaceHost for the specified HostID.
getHost in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public java.util.Collection getHosts()
throws ConfigurationException
ConfigurationServiceInterfaceCollection of currently defined hosts. This method does not cache, it re-retrieves the data
every time.
getHosts in interface ConfigurationServiceInterfaceConfigurationException - if an error occurred within or during communication with the Configuration Service.
public ComponentDefn getComponentDefn(ConfigurationID configurationID,
ComponentDefnID componentDefnID)
throws ConfigurationException
ComponentDefn for the specified ComponentDefnID.
getComponentDefn in interface ConfigurationServiceInterfaceconfigurationID - is the configuration for which the component existcomponentDefnID - is the component being requested
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
public java.util.Collection getResources()
throws ConfigurationException
ResourceDescriptor
for all internal resources defined to the system. The internal resources are not managed with
the other configuration related information. They are not dictated based on which configuration
they will operate (i.e., next startup or operational);
getResources in interface ConfigurationServiceInterfaceAuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
public void saveResources(java.util.Collection resourceDescriptors,
java.lang.String principalName)
throws ConfigurationException
ResourceDescriptor
in the collection.
saveResources in interface ConfigurationServiceInterfaceresourceDescriptors - for the resources to be changed *
AuthorizationException - if caller is not authorized to perform this method.
InvalidSessionException - if the callerSessionID is not valid or is expired.
MetaMatrixComponentException - if an error occurred in communicating with a component.
ConfigurationException - if an error occurred within or during communication with the Configuration Service.
public java.util.Set executeTransaction(ActionDefinition action,
java.lang.String principalName)
throws ConfigurationException
executeTransaction in interface ConfigurationServiceInterfaceaction - the definition of the action to be performed on data within
the repository.principalName - of the person executing the transaction
java.lang.IllegalArgumentException - if the action is null
or if the result specification is invalid
ConfigurationException - if an error occurred within or during
communication with the Configuration Service.
public java.util.Set executeTransaction(java.util.List actions,
java.lang.String principalName)
throws ConfigurationException
executeTransaction in interface ConfigurationServiceInterfaceactions - the ordered list of actions that are to be performed on data within
the repository.principalName - of the person executing the transaction
java.lang.IllegalArgumentException - if the action is null
or if the result specification is invalid
ConfigurationException - if an error occurred within or during
communication with the Configuration Service.
protected void addProperty(java.util.Properties source,
java.lang.String sourceName,
java.util.Properties props,
java.lang.String propName)
protected XMLConfigurationConnector getConnection(java.lang.String principal)
throws ConfigurationException
ConfigurationException
public Host addHost(java.lang.String hostName,
java.lang.String principalName,
java.util.Properties properties)
throws ConfigurationException
ConfigurationServiceInterface
addHost in interface ConfigurationServiceInterfacehostName - Host Name of new Host being added to Configuration
ConfigurationExceptioncom.metamatrix.platform.config.api.service.ConfigurationServiceInterface#addHost(java.lang.String,
java.util.Properties)
public VMComponentDefn addProcess(java.lang.String processName,
java.lang.String hostName,
java.lang.String principalName,
java.util.Properties properties)
throws ConfigurationException
ConfigurationServiceInterface
addProcess in interface ConfigurationServiceInterfaceprocessName - Name of the New Process being Added to ConfigurationhostName - Name of the Host that the new Process is being addedprincipalName - User Name of user who is making the changeproperties - name, value need to setup a Host
ConfigurationExceptioncom.metamatrix.platform.config.api.service.ConfigurationServiceInterface#addProcess(java.lang.String,
java.lang.String, java.util.Properties)
public void setSystemPropertyValue(java.lang.String propertyName,
java.lang.String propertyValue,
java.lang.String principalName)
throws ConfigurationException
setSystemPropertyValue in interface ConfigurationServiceInterfacepropertyName - propertyValue - principalName -
ConfigurationException
InvalidSessionException
AuthorizationException
public void updateSystemPropertyValues(java.util.Properties properties,
java.lang.String principalName)
throws ConfigurationException
updateSystemPropertyValues in interface ConfigurationServiceInterfaceproperties - principalName -
ConfigurationException
InvalidSessionException
AuthorizationException
public ConnectorBinding createConnectorBinding(java.lang.String connectorBindingName,
java.lang.String connectorType,
java.lang.String vmName,
java.lang.String principalName,
java.util.Properties properties)
throws ConfigurationException
ConfigurationServiceInterface
createConnectorBinding in interface ConfigurationServiceInterfaceconnectorType - Connector Type for this Connector BindingvmName - Name of the PSC to deploy the Connector Binding to.
If pscName is null, this method does not deploy the Connector Binding to a PSC.principalName - User Name of user who is making the change
ConfigurationExceptionConfigurationServiceInterface.createConnectorBinding(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.util.Properties)
public java.lang.Object modify(ComponentObject theObject,
java.util.Properties theProperties,
java.lang.String principalName)
throws ConfigurationException
ConfigurationServiceInterface
modify in interface ConfigurationServiceInterfaceConfigurationException
public ComponentType importConnectorType(java.io.InputStream inputStream,
java.lang.String name,
java.lang.String principalName)
throws ConfigurationException
importConnectorType in interface ConfigurationServiceInterfacename - Name of the Connector Type to importprincipalName - User Name of user who is making the change
ConfigurationException
public ConnectorBinding importConnectorBinding(java.io.InputStream inputStream,
java.lang.String name,
java.lang.String vmName,
java.lang.String principalName)
throws ConfigurationException
ConfigurationServiceInterface
importConnectorBinding in interface ConfigurationServiceInterfacename - Name of Connector Binding to importvmName - Name of the VM to deploy the Connector Binding to.
If vmName is null, this method does not deploy the Connector Binding .
ConfigurationExceptionConfigurationServiceInterface.importConnectorBinding(java.io.InputStream, java.lang.String, java.lang.String, java.lang.String)
public void delete(ComponentObject theObject,
boolean theDeleteDependenciesFlag,
java.lang.String principalName)
throws ConfigurationException
ConfigurationServiceInterface
delete in interface ConfigurationServiceInterfacetheObject - the object being deletedtheDeleteDependenciesFlag - boolean flag for deleting dependenciesprincipalName - User Name of user who is making the change
ConfigurationExceptioncom.metamatrix.platform.config.api.service.ConfigurationServiceInterface#delete(com.metamatrix.common.config.api.ComponentObject, boolean)
public void delete(ComponentType componentType,
java.lang.String principalName)
throws ConfigurationException
ConfigurationServiceInterface
delete in interface ConfigurationServiceInterfacecomponentType - Component Type Object being deletedprincipalName - User Name who is making the change
ConfigurationExceptionConfigurationServiceInterface.delete(com.metamatrix.common.config.api.ComponentType, java.lang.String)
public DeployedComponent deployService(VMComponentDefnID theProcessID,
java.lang.String serviceName,
java.lang.String principalName)
throws ConfigurationException
deployService in interface ConfigurationServiceInterfacetheHost - host on which the services will be deployedtheProcess - VM on which the services will be deployedserviceName - Name of the ServiceComponentDefnprincipalName - User Name deploying the Services
ConfigurationException
public java.util.List checkPropertiesDecryptable(java.util.List defns)
throws ConfigurationException
checkPropertiesDecryptable in interface ConfigurationServiceInterfacedefns - Listdefns.
For each, true if the properties could be decrypted for that defn.
ConfigurationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||