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

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


        definition.put(propertyDefinition);
        PropertyDefinitionSimple pathProperty = new PropertyDefinitionSimple("path", "File path", true,
            PropertySimpleType.STRING);
        PropertyDefinitionSimple relativeToProperty = new PropertyDefinitionSimple("relative-to", "Relative-To", true,
            PropertySimpleType.STRING);
        PropertyDefinitionMap fileMapDef = new PropertyDefinitionMap("file", "Log file", true, pathProperty,
            relativeToProperty);
        definition.put(fileMapDef);

        ObjectMapper mapper = new ObjectMapper();
        ComplexResult result = mapper.readValue(resultString, ComplexResult.class);
View Full Code Here


                List<PropertyDefinition> definitions = configurationDefinition.getPropertiesInGroup(groupName);
                //  if this is a single map (not list of maps), then unwind
                if (definitions.size() == 1 && definitions.get(0) instanceof PropertyDefinitionMap) {

                    PropertyDefinitionMap definitionMap = (PropertyDefinitionMap) definitions.get(0);
                    String mapName = definitionMap.getName();

                    boolean isAddEnabled = mapName.endsWith("+");

                    if (groupEnabled) {
                        if (isAddEnabled) {
                            // check if this exists already
                            Operation testOp = new ReadResource(address1);
                            Result res = connection.execute(testOp);
                            if (!res.isSuccess()) {
                                // and try to add it
                                Operation add = new Operation("add", address1);
                                res = connection.execute(add);
                                if (!res.isSuccess()) {
                                    // Not much we can do here when the add fails
                                    log.error("Adding of node " + address1 + " failed");
                                }
                            }
                        }

                        definitions = new ArrayList<PropertyDefinition>(definitionMap.getOrderedPropertyDefinitions());
                        PropertyMap map = conf.getMap(mapName);
                        for (PropertyDefinition def : definitions) {
                            createWriteAttribute(cop, address1, def, map.get(def.getName()));
                        }
                    } else {
View Full Code Here

        if (propDef instanceof PropertyDefinitionSimple) {
            PropertyDefinitionSimple propDefSimple = (PropertyDefinitionSimple) propDef;
            updateSimple(parentNode, propDefSimple, parentProp, seq);
        } else if (propDef instanceof PropertyDefinitionMap) {
            PropertyDefinitionMap propDefMap = (PropertyDefinitionMap) propDef;
            updateMap(propDefMap, parentProp, parentNode, seq);
        } else if (propDef instanceof PropertyDefinitionList) {
            PropertyDefinitionList propDefList = (PropertyDefinitionList) propDef;
            updateList(propDefList, parentProp, parentNode, seq);
        } else {
View Full Code Here

                           results.put(name,ps.getStringValue());
                     }
                     // This is added since it isn't supported already.
                     // Should be merged with https://github.com/rhq-project/rhq/pull/128
                     else if (memberDefinition instanceof PropertyDefinitionMap) {
                        PropertyDefinitionMap pdm = (PropertyDefinitionMap) memberDefinition;
                        PropertyMap pm = (PropertyMap) property.get(name);
                        if ((pm==null || pm.getMap().isEmpty()) && !pdm.isRequired())
                           continue;
                        if (pm != null) {
                           Map<String, Object> innerMap = prepareSimplePropertyMap(pm, pdm);
                           results.put(name, innerMap);
                        }
View Full Code Here

        definition.put(new PropertyDefinitionSimple("property4", "", true, PropertySimpleType.LONG_STRING));
        definition.put(new PropertyDefinitionSimple("property5", "", true, PropertySimpleType.PASSWORD));
        definition.put(new PropertyDefinitionSimple("property6", "", true, PropertySimpleType.LONG));
        definition.put(new PropertyDefinitionSimple("property7", "", true, PropertySimpleType.DOUBLE));

        definition.put(new PropertyDefinitionMap("property20", "", true, null));

        definition.put(new PropertyDefinitionList("property30", "", true, null));

        return definition;
    }
View Full Code Here

TOP

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

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.