Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.PropertyMap


*/
public abstract class AbstractPropertyMapAdapter implements PropertyAdapter<PropertyMap, PropertyDefinitionMap>
{
    public PropertyMap convertToProperty(MetaValue metaValue, PropertyDefinitionMap propDefMap)
    {
        PropertyMap propMap = new PropertyMap(propDefMap.getName());
        populatePropertyFromMetaValue(propMap, metaValue, propDefMap);
        return propMap;
    }
View Full Code Here


*/
public class PropertyMapToTableValueAdapter extends AbstractPropertyMapAdapter implements PropertyAdapter<PropertyMap, PropertyDefinitionMap>
{
    public PropertyMap convertToProperty(MetaValue metaValue, PropertyDefinitionMap propertyDefinition)
    {
        PropertyMap property = new PropertyMap();
        populatePropertyFromMetaValue(property, metaValue, propertyDefinition);
        return property;
    }
View Full Code Here

    String translatorName = ProfileServiceUtil.getSimpleValuetranslator, "name", String.class);
    String description = ProfileServiceUtil.getSimpleValuetranslator, "description", String.class);

    Configuration c = resourceConfiguration;
    PropertyList list = new PropertyList("translatorList");
    PropertyMap propMap = null;
    c.put(list);

    // First get translator specific properties
    ManagedProperty translatorProps = translator.getProperty("property");
    try {
View Full Code Here

    MapCompositeValueSupport unwrappedvalueMap = null;
    if (metaType.isComposite()) {
      unwrappedvalueMap = (MapCompositeValueSupport) pValue;

      for (String key : unwrappedvalueMap.getMetaType().keySet()) {
        map = new PropertyMap("property");
        map.put(new PropertySimple("name", key));
        map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalueMap.get(key))));
        map.put(new PropertySimple("description", "Custom property"));
        list.add(map);
      }
View Full Code Here

    return result;
  }
 
  private void setComplexResult() {
    PropertyList list = new PropertyList(LISTNAME); //$NON-NLS-1$
    PropertyMap pm;
    Iterator resultIter = ((List)content).iterator();
    while (resultIter.hasNext()) {
      Map reportRowMap = (Map) resultIter.next();
      Iterator reportRowKeySetIter = reportRowMap.keySet().iterator();
      pm = new PropertyMap(MAPNAME); //$NON-NLS-1$     

      while (reportRowKeySetIter.hasNext()) {
        String key = (String) reportRowKeySetIter.next();
        pm.put(new PropertySimple(key, reportRowMap.get(key)==null?"":reportRowMap.get(key))); //$NON-NLS-1$
      }
      list.add(pm);
    }
    result = list;
    operationResult.getComplexResults().put(list);
View Full Code Here

     
       // Add to return values
      // First get translator specific properties
      ManagedProperty translatorProps = translator.getProperty("property");//$NON-NLS-1$
      PropertyList list = new PropertyList("translatorList");//$NON-NLS-1$
      PropertyMap propMap = null;
      getTranslatorValues(translatorProps.getValue(), propMap, list);

      // Now get common properties
      configuration.put(new PropertySimple("name", translatorName));//$NON-NLS-1$
      configuration.put(new PropertySimple("type",ProfileServiceUtil.getSimpleValue(translator,"type", String.class)));//$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

    MapCompositeValueSupport unwrappedvalue = null;
    if (metaType.isComposite()) {
      unwrappedvalue = (MapCompositeValueSupport)pValue;

      for (String key : unwrappedvalue.getMetaType().keySet()) {
        map = new PropertyMap("properties");//$NON-NLS-1$
        map.put(new PropertySimple("name", key));//$NON-NLS-1$
        map.put(new PropertySimple("value", ProfileServiceUtil.stringValue((MetaValue)unwrappedvalue.get(key))));//$NON-NLS-1$
        list.add(map);
      }
    } else {
View Full Code Here

      List<Property> singleSourceModelsPropertyList = resourceConfiguration
          .getList("singleSourceModels").getList();
      ArrayList<List<Property>> sourceMappingList = new ArrayList<List<Property>>();
      sourceMappingList.add(singleSourceModelsPropertyList);
      sourceMappingList.add(multiSourceModelsPropertyList);
      PropertyMap model = null;
      Iterator<List<Property>> sourceMappingListIterator = sourceMappingList
          .iterator();
      while (sourceMappingListIterator.hasNext()) {
        List<Property> sourceList = sourceMappingListIterator.next();
        for (int i = 0; i < sourceList.size(); i++) {
          model = (PropertyMap) sourceList.get(i);
          String sourceName = ((PropertySimple) model
              .get("sourceName")).getStringValue(); //$NON-NLS-1$
          if (sourceName.equals("See below"))
            continue; // This is a multisource model which we will
                  // handle separately
          String modelName = ((PropertySimple) model.get("name")) //$NON-NLS-1$
              .getStringValue();
          String dsName = ((PropertySimple) model.get("jndiName")) //$NON-NLS-1$
              .getStringValue();

          ManagedObject managedModel = null;
          if (models != null && models.length != 0) {
            for (GenericValue genValue : models) {
View Full Code Here

              "severity").getValue()).getValue().toString();
          String message = ((SimpleValue) errorMo
              .getProperty("value").getValue()).getValue()
              .toString();

          PropertyMap errorMap = new PropertyMap("errorMap",
              new PropertySimple("severity", severity),
              new PropertySimple("message", message));
          errorList.add(errorMap);
        }
      }

      for (Map<String, String> sourceMap : sourceList) {

        if (isSource) {
          String sourceName = (String) sourceMap.get("name");
          String jndiName = (String) sourceMap.get("jndiName");
          String translatorName = (String) sourceMap
              .get("translatorName");
          PropertyMap multiSourceModel = null;

          PropertyMap model = null;
          if (supportMultiSource) {
            // TODO need to loop through multisource models
            multiSourceModel = new PropertyMap("map",
                new PropertySimple("name", modelName),
                new PropertySimple("sourceName", sourceName),
                new PropertySimple("jndiName", jndiName),
                new PropertySimple("translatorName",
                    translatorName));

            multiSourceModelsList.add(multiSourceModel);

            model = new PropertyMap("map", new PropertySimple(
                "name", modelName), new PropertySimple(
                "sourceName", "See below"), new PropertySimple(
                "jndiName", "See below"), new PropertySimple(
                "translatorName", "See below"),
                new PropertySimple("visibility", visibility),
                new PropertySimple("supportsMultiSource", true));
            sourceModelsList.add(model);
          } else {
            model = new PropertyMap("map", new PropertySimple(
                "name", modelName), new PropertySimple(
                "sourceName", sourceName), new PropertySimple(
                "jndiName", jndiName), new PropertySimple(
                "translatorName", translatorName),
                new PropertySimple("visibility", visibility),
                new PropertySimple("supportsMultiSource",
                    supportMultiSource));
            sourceModelsList.add(model);
          }
        } else {
          PropertyMap model = new PropertyMap("map",
              new PropertySimple("name", modelName),
              new PropertySimple("type", type),
              new PropertySimple("visibility", visibility));

          logicalModelsList.add(model);
View Full Code Here

              .stringValue(((CompositeValueSupport) propertyMetaData)
                  .get("name"));
          String propertyValue = ProfileServiceUtil
              .stringValue(((CompositeValueSupport) propertyMetaData)
                  .get("value"));
          PropertyMap translatorMap = null;

          translatorMap = new PropertyMap("translatorMap",
              new PropertySimple("name", translatorName),
              new PropertySimple("type", translatorType),
              new PropertySimple("propertyName", propertyName),
              new PropertySimple("propertyValue", propertyValue));
          // Only want translator name and value to show up for the
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.PropertyMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.