Package org.rhq.core.domain.configuration

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


*/
public abstract class AbstractPropertyListAdapter implements PropertyAdapter<PropertyList, PropertyDefinitionList>
{
    public PropertyList convertToProperty(MetaValue metaValue, PropertyDefinitionList propDefList)
    {
        PropertyList propList = new PropertyList(propDefList.getName());
        populatePropertyFromMetaValue(propList, metaValue, propDefList);
        return propList;
    }
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");
View Full Code Here

  public Object getResult() {
    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

      detail.setPluginConfiguration(configuration);
     
       // 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$
View Full Code Here

    ManagedProperty property = mcVdb.getProperty("models");
    CollectionValueSupport valueSupport = (CollectionValueSupport) property
        .getValue();
    MetaValue[] metaValues = valueSupport.getElements();

    PropertyList sourceModelsList = new PropertyList("singleSourceModels");
    configuration.put(sourceModelsList);

    PropertyList multiSourceModelsList = new PropertyList(
        "multiSourceModels");
    configuration.put(multiSourceModelsList);

    PropertyList logicalModelsList = new PropertyList("logicalModels");
    configuration.put(logicalModelsList);

    PropertyList errorList = new PropertyList("errorList");
    configuration.put(errorList);

    for (MetaValue value : metaValues) {
      GenericValueSupport genValueSupport = (GenericValueSupport) value;
      ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
          .getValue();

      Boolean isSource = Boolean.TRUE;
      try {
        isSource = ProfileServiceUtil.booleanValue(managedObject
            .getProperty("source").getValue());
      } catch (Exception e) {
        LOG.error(e.getMessage());
      }

      Boolean supportMultiSource = Boolean.TRUE;
      try {
        supportMultiSource = ProfileServiceUtil
            .booleanValue(managedObject.getProperty(
                "supportsMultiSourceBindings").getValue());
      } catch (Exception e) {
        LOG.error(e.getMessage());
      }

      String modelName = managedObject.getName();
      ManagedProperty connectorBinding = managedObject
          .getProperty("sourceMappings");
      Collection<Map<String, String>> sourceList = new ArrayList<Map<String, String>>();

      getSourceMappingValue(connectorBinding.getValue(), sourceList);

      String visibility = ((SimpleValueSupport) managedObject
          .getProperty("visible").getValue()).getValue().toString();
      String type = ((EnumValueSupport) managedObject.getProperty(
          "modelType").getValue()).getValue().toString();

      // Get any model errors/warnings
      MetaValue errors = managedObject.getProperty("errors").getValue();
      if (errors != null) {
        CollectionValueSupport errorValueSupport = (CollectionValueSupport) errors;
        MetaValue[] errorArray = errorValueSupport.getElements();

        for (MetaValue error : errorArray) {
          GenericValueSupport errorGenValueSupport = (GenericValueSupport) error;

          ManagedObject errorMo = (ManagedObject) errorGenValueSupport
              .getValue();
          String severity = ((SimpleValue) errorMo.getProperty(
              "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) {
View Full Code Here

    }
    CollectionValueSupport valueSupport = (CollectionValueSupport) property
        .getValue();
    MetaValue[] metaValues = valueSupport.getElements();

    PropertyList translatorsList = new PropertyList("translators");
    configuration.put(translatorsList);

    for (MetaValue value : metaValues) {
      GenericValueSupport genValueSupport = (GenericValueSupport) value;
      ManagedObjectImpl managedObject = (ManagedObjectImpl) genValueSupport
          .getValue();

      String translatorName = ProfileServiceUtil.getSimpleValue(
          managedObject, "name", String.class);
      String translatorType = ProfileServiceUtil.getSimpleValue(
          managedObject, "type", String.class);
      ManagedProperty properties = managedObject.getProperty("property");

      if (properties != null) {
        CollectionValueSupport props = (CollectionValueSupport) properties
            .getValue();
        for (MetaValue propertyMetaData : props) {
          String propertyName = ProfileServiceUtil
              .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
          // first row,
          // so we will blank them out here.
          translatorName = "";
          translatorType = "";
          translatorsList.add(translatorMap);
        }
      }
    }
  }
View Full Code Here

  public Object getResult() {
    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("userMap"); //$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;
  }
View Full Code Here

        configuration.put(new PropertySimple("anyAuthenticated", //$NON-NLS-1$
            anyAuthenticated));
        configuration
            .put(new PropertySimple("description", description)); //$NON-NLS-1$

        PropertyList mappedRoleNameList = new PropertyList(
            "mappedRoleNameList"); //$NON-NLS-1$
        configuration.put(mappedRoleNameList);
        ManagedProperty mappedRoleNames = managedObject
            .getProperty("mappedRoleNames"); //$NON-NLS-1$
        if (mappedRoleNames != null) {
          CollectionValueSupport props = (CollectionValueSupport) mappedRoleNames
              .getValue();
          for (MetaValue mappedRoleName : props.getElements()) {
            PropertyMap mappedRoleNameMap = null;

            try {
              mappedRoleNameMap = new PropertyMap(
                  "map", //$NON-NLS-1$
                  new PropertySimple(
                      "name", (ProfileServiceUtil.stringValue(mappedRoleName)))); //$NON-NLS-1$
            } catch (Exception e) {
              final String msg = "Exception in loadResourceConfiguration(): " + e.getMessage(); //$NON-NLS-1$
              LOG.error(msg, e);
            }
            mappedRoleNameList.add(mappedRoleNameMap);
          }
        }
      }
    }
View Full Code Here

        configuration.put(new PropertySimple("anyAuthenticated",
            anyAuthenticated));
        configuration
            .put(new PropertySimple("description", description));

        PropertyList mappedRoleNameList = new PropertyList(
            "mappedRoleNameList");
        configuration.put(mappedRoleNameList);
        ManagedProperty mappedRoleNames = managedObject
            .getProperty("mappedRoleNames");
        if (mappedRoleNames != null) {
          CollectionValueSupport props = (CollectionValueSupport)mappedRoleNames.getValue();
          for (MetaValue mappedRoleName : props.getElements()) {
            mappedRoleNameList.add(new PropertySimple("name", ProfileServiceUtil.stringValue(mappedRoleName)));
          }

        }
        // Add to return values
        discoveredResources.add(detail);
View Full Code Here

    }

    private void initIncludes(DriftDescriptor descriptor, DriftDefinitionTemplate template) {
        if (descriptor.getIncludes() != null && descriptor.getIncludes().getInclude().size() > 0) {
            Configuration config = template.getConfiguration();
            PropertyList includes = new PropertyList(DriftConfigurationDefinition.PROP_INCLUDES);

            for (DriftFilterDescriptor include : descriptor.getIncludes().getInclude()) {
                PropertyMap includeMap = new PropertyMap(DriftConfigurationDefinition.PROP_INCLUDES_INCLUDE);
                includeMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATH, include.getPath()));
                includeMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATTERN, include.getPattern()));

                includes.add(includeMap);
            }
            config.put(includes);
        }
    }
View Full Code Here

TOP

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

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.