Package org.rhq.core.domain.configuration.definition

Examples of org.rhq.core.domain.configuration.definition.PropertyDefinition


                    }
                }

                validatePropertyListSize(propertyList, propertyDefinitionList, errorMessages);

                PropertyDefinition listMemberPropertyDefinition = propertyDefinitionList.getMemberDefinition();
                for (Property property : propertyList.getList()) {
                    if (listMemberPropertyDefinition instanceof PropertyDefinitionSimple) {
                        validatePropertySimple(listMemberPropertyDefinition, (PropertySimple) property, null,
                            errorMessages);
                    } else if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
View Full Code Here


            add(parent, (PropertyMap) target);
        }

        for (Map.Entry<String, PropertyDefinition> e : definition.getPropertyDefinitions().entrySet()) {
            String name = e.getKey();
            PropertyDefinition def = e.getValue();

            Property sourceChild = source.get(name);

            // only bother if we have something to adapt from
            if (sourceChild != null) {
View Full Code Here

                target = new PropertyList(definition.getName());
                add(parent, target);
            }

            if (target.getList().isEmpty()) {
                PropertyDefinition memberDef = definition.getMemberDefinition();

                for (Property p : source.getList()) {
                    PropertyType type = conforms(p, memberDef);

                    if (type != null && type != PropertyType.UNKNOWN) {
View Full Code Here

{
    public static PropertyDefinition getPropertyDefinitionForProperty(Property property,
                                                                      ConfigurationDefinition configurationDefinition) {
        LinkedList<Property> propertyHierarchy = getPropertyHierarchy(property);
        Property topLevelProperty = propertyHierarchy.get(0);
        PropertyDefinition propertyDefinition =
                configurationDefinition.getPropertyDefinitions().get(topLevelProperty.getName());
        for (int i = 1; i < propertyHierarchy.size(); i++)
        {
            Property subProperty = propertyHierarchy.get(i);
            if (propertyDefinition instanceof PropertyDefinitionMap) {
View Full Code Here

        StringBuilder stringBuilder = new StringBuilder("#{");
        stringBuilder.append(FacesExpressionUtility.unwrapExpressionString(configurationDefinitionExpressionString));
        LinkedList<PropertyDefinition> propertyDefinitionHierarchy = getPropertyDefinitionHierarchy(propertyDefinition);
        for (PropertyDefinition subPropertyDefinition : propertyDefinitionHierarchy)
        {
            PropertyDefinition parentPropertyDefinition = getParentPropertyDefinition(subPropertyDefinition);
            stringBuilder.append(".");
            if (parentPropertyDefinition == null || parentPropertyDefinition instanceof PropertyDefinitionMap)
            {
                // top-level property or map member property
                stringBuilder.append("propertyDefinitions['").append(subPropertyDefinition.getName()).append("']");
View Full Code Here

    }

    public static LinkedList<PropertyDefinition> getPropertyDefinitionHierarchy(PropertyDefinition propertyDefinition)
    {
        LinkedList<PropertyDefinition> propertyHierarchy = new LinkedList<PropertyDefinition>();
        PropertyDefinition parentPropertyDefinition = propertyDefinition;
        while ((parentPropertyDefinition = getParentPropertyDefinition(parentPropertyDefinition)) != null)
            propertyHierarchy.addFirst(parentPropertyDefinition);
        propertyHierarchy.add(propertyDefinition);
        return propertyHierarchy;
    }
View Full Code Here

        return propertyHierarchy;
    }

    @Nullable
    public static PropertyDefinition getParentPropertyDefinition(PropertyDefinition property) {
        PropertyDefinition parentPropertyDefinition;
        if (property.getParentPropertyListDefinition() != null)
            parentPropertyDefinition = property.getParentPropertyListDefinition();
        else if (property.getParentPropertyMapDefinition() != null)
            parentPropertyDefinition = property.getParentPropertyMapDefinition();
        else
View Full Code Here

        PropertyRenderingUtility.addPropertyDescription(parent, listPropertyDefinition);
        FacesComponentUtility.addVerbatimText(parent, "</td>");

        FacesComponentUtility.addVerbatimText(parent, "</tr>");

        PropertyDefinition listMemberPropertyDefinition = listPropertyDefinition.getMemberDefinition();
        if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
            if (!this.isGroup) {
                addListMemberMapProperties(parent, listProperty, (PropertyDefinitionMap) listMemberPropertyDefinition,
                    rowStyleClass);
            } else {
                addErrorRow(
                    parent,
                    "Viewing/editing of lists of"
                        + " properties is not yet supported for group Configurations."
                        + " To view/edit this property for group members, please go to the Configure>Current tab for each member separately.",
                    rowStyleClass);
            }
        } else {
            addErrorRow(parent, "Viewing/editing of lists of "
                + listMemberPropertyDefinition.getClass().getSimpleName()
                + " properties is not yet supported. Here's the list's toString() value for now: "
                + ((listProperty != null) ? listProperty.getList() : null), rowStyleClass);
        }

        addDebug(parent, false, ".addListProperty()");
View Full Code Here

            targetParentPropertyMap.put(targetPropertyMap);
            buildAggregatePropertyMap((PropertyDefinitionMap) propertyDefinition, nestedSourceParentPropertyMaps,
                targetPropertyMap);
        } else if (propertyDefinition instanceof PropertyDefinitionList) {
            PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList) propertyDefinition;
            PropertyDefinition listMemberPropertyDefinition = propertyDefinitionList.getMemberDefinition();
            PropertyList targetPropertyList = new PropertyList(propertyDefinition.getName());
            targetParentPropertyMap.put(targetPropertyList);
            if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) listMemberPropertyDefinition;
                // TODO: How do we group together Lists of Maps? Not trivial...
View Full Code Here

        assertVersion2(resourceType);
    }

    private void assertVersion1(ResourceType resourceType) {
        PropertyGroupDefinition group;
        PropertyDefinition prop;
        ProcessScan processScan;
        OperationDefinition op;
        MeasurementDefinition metric;
        EventDefinition event;
        DriftDefinitionTemplate drift;
        BaseDirectory driftBasedir;
        ResourceTypeBundleConfiguration bundle;
        BundleDestinationBaseDirectory bundleBasedir;

        assert resourceType.getChildSubCategories() == null;

        assert resourceType.getPluginConfigurationDefinition().getGroupDefinitions().size() == 1;
        group = resourceType.getPluginConfigurationDefinition().getGroupDefinitions().get(0);
        assert group.getName().equals(PC_GROUP);
        assert group.isDefaultHidden() == PC_GROUP_HIDDEN;
        prop = resourceType.getPluginConfigurationDefinition().get(PC_PROP);
        assert prop != null;
        assert prop.getName().equals(PC_PROP);
        assert prop.isRequired() == PC_PROP_REQUIRED;
        assert prop.getPropertyGroupDefinition().getName().equals(PC_GROUP);

        assert resourceType.getProcessScans().size() == 1;
        processScan = resourceType.getProcessScans().iterator().next();
        assert processScan.getName().equals(PROCESS_SCAN_NAME);
        assert processScan.getQuery().equals(PROCESS_SCAN_QUERY);

        assert resourceType.getOperationDefinitions().size() == 1;
        op = resourceType.getOperationDefinitions().iterator().next();
        assert op.getName().equals(OP_NAME);
        assert op.getTimeout().intValue() == OP_TIMEOUT;
        assert op.getDescription().equals(OP_DESC);

        assert resourceType.getMetricDefinitions().size() == 2; // include built-in Availability metric
        metric = resourceType.getMetricDefinitions().iterator().next();
        assert metric.getName().equals(METRIC_PROP);
        assert metric.getDefaultInterval() == METRIC_DEFAULT_INTERVAL;

        assert resourceType.getEventDefinitions().size() == 1;
        event = resourceType.getEventDefinitions().iterator().next();
        assert event.getName().equals(EVENT_NAME);
        assert event.getDescription().equals(EVENT_DESC);

        assert resourceType.getResourceConfigurationDefinition().getGroupDefinitions().size() == 0;
        prop = resourceType.getResourceConfigurationDefinition().get(RC_PROP);
        assert prop != null;
        assert prop.getName().equals(RC_PROP);
        assert prop.isRequired() == RC_PROP_REQUIRED;

        assert resourceType.getDriftDefinitionTemplates().size() == 1;
        drift = resourceType.getDriftDefinitionTemplates().iterator().next();
        assert drift.getTemplateDefinition().getName().equals(DRIFT_DEF_NAME);
        driftBasedir = drift.getTemplateDefinition().getBasedir();
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.PropertyDefinition

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.