org.rhq.plugins.jbossas5.util
Class ConversionUtils

java.lang.Object
  extended by org.rhq.plugins.jbossas5.util.ConversionUtils

public class ConversionUtils
extends Object

Utility class to convert some basic Profile Service objects to JON objects, and some basic manipulation and data gathering of Profile Service objects.

This should not include converting between Property objects and ManagedProperties. Those conversions should be in the corresponding Adapter classes.

Author:
Ian Springer, Mark Spritzler

Constructor Summary
ConversionUtils()
           
 
Method Summary
static void convertConfigurationToManagedProperties(Map<String,org.jboss.managed.api.ManagedProperty> managedProperties, org.rhq.core.domain.configuration.Configuration configuration, org.rhq.core.domain.resource.ResourceType resourceType, Map<String,org.rhq.core.domain.configuration.PropertySimple> customProps)
           
static org.rhq.core.domain.configuration.Configuration convertManagedObjectToConfiguration(Map<String,org.jboss.managed.api.ManagedProperty> managedProperties, Map<String,org.rhq.core.domain.configuration.PropertySimple> customProps, org.rhq.core.domain.resource.ResourceType resourceType)
           
static void convertManagedOperationResults(org.jboss.managed.api.ManagedOperation operation, org.jboss.metatype.api.values.MetaValue resultMetaValue, org.rhq.core.domain.configuration.Configuration complexResults, org.rhq.core.domain.operation.OperationDefinition operationDefinition)
           
static void convertMetricValuesToMeasurement(org.rhq.core.domain.measurement.MeasurementReport report, org.jboss.managed.api.ManagedProperty metricProperty, org.rhq.core.domain.measurement.MeasurementScheduleRequest request, org.rhq.core.domain.resource.ResourceType resourceType, String deploymentName)
           
static org.jboss.metatype.api.values.MetaValue[] convertOperationsParametersToMetaValues(org.jboss.managed.api.ManagedOperation managedOperation, org.rhq.core.domain.configuration.Configuration parameters, org.rhq.core.domain.operation.OperationDefinition operationDefinition)
          Takes the Configuration parameter object and converts it into a MetaValue array, which can them be passed in with the invoke method to the ProfileService to fire the operation of a resource.
static org.jboss.metatype.api.types.MetaType convertPropertyDefinitionToMetaType(org.rhq.core.domain.configuration.definition.PropertyDefinition propDef)
           
static org.jboss.managed.api.ComponentType getComponentType(org.rhq.core.domain.resource.ResourceType resourceType)
           
static org.jboss.deployers.spi.management.KnownDeploymentTypes getDeploymentType(org.rhq.core.domain.resource.ResourceType resourceType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConversionUtils

public ConversionUtils()
Method Detail

getComponentType

public static org.jboss.managed.api.ComponentType getComponentType(@NotNull
                                                                   org.rhq.core.domain.resource.ResourceType resourceType)

getDeploymentType

public static org.jboss.deployers.spi.management.KnownDeploymentTypes getDeploymentType(@NotNull
                                                                                        org.rhq.core.domain.resource.ResourceType resourceType)

convertManagedObjectToConfiguration

public static org.rhq.core.domain.configuration.Configuration convertManagedObjectToConfiguration(Map<String,org.jboss.managed.api.ManagedProperty> managedProperties,
                                                                                                  Map<String,org.rhq.core.domain.configuration.PropertySimple> customProps,
                                                                                                  org.rhq.core.domain.resource.ResourceType resourceType)

convertConfigurationToManagedProperties

public static void convertConfigurationToManagedProperties(Map<String,org.jboss.managed.api.ManagedProperty> managedProperties,
                                                           org.rhq.core.domain.configuration.Configuration configuration,
                                                           org.rhq.core.domain.resource.ResourceType resourceType,
                                                           Map<String,org.rhq.core.domain.configuration.PropertySimple> customProps)

convertPropertyDefinitionToMetaType

public static org.jboss.metatype.api.types.MetaType convertPropertyDefinitionToMetaType(org.rhq.core.domain.configuration.definition.PropertyDefinition propDef)

convertOperationsParametersToMetaValues

@NotNull
public static org.jboss.metatype.api.values.MetaValue[] convertOperationsParametersToMetaValues(@NotNull
                                                                                                        org.jboss.managed.api.ManagedOperation managedOperation,
                                                                                                        @NotNull
                                                                                                        org.rhq.core.domain.configuration.Configuration parameters,
                                                                                                        @NotNull
                                                                                                        org.rhq.core.domain.operation.OperationDefinition operationDefinition)
Takes the Configuration parameter object and converts it into a MetaValue array, which can them be passed in with the invoke method to the ProfileService to fire the operation of a resource.

Parameters:
managedOperation - Operation that will be fired and stores the parameter types for the operation
parameters - set of Parameter Values that the OperationFacet sent to the Component
operationDefinition - the RHQ operation definition
Returns:
MetaValue[] array of MetaValues representing the parameters; if there are no parameters, an empty array will be returned

convertManagedOperationResults

public static void convertManagedOperationResults(org.jboss.managed.api.ManagedOperation operation,
                                                  org.jboss.metatype.api.values.MetaValue resultMetaValue,
                                                  org.rhq.core.domain.configuration.Configuration complexResults,
                                                  org.rhq.core.domain.operation.OperationDefinition operationDefinition)

convertMetricValuesToMeasurement

public static void convertMetricValuesToMeasurement(org.rhq.core.domain.measurement.MeasurementReport report,
                                                    org.jboss.managed.api.ManagedProperty metricProperty,
                                                    org.rhq.core.domain.measurement.MeasurementScheduleRequest request,
                                                    org.rhq.core.domain.resource.ResourceType resourceType,
                                                    String deploymentName)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.