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

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


        PropertyDefinitionSimple updateSchedules =
            new PropertyDefinitionSimple(UPDATE_SCHEDULES_PROPERTY,
                "Whether to update the schedules of this metric on existing resources", true,
                PropertySimpleType.BOOLEAN);

        PropertyDefinitionMap metricUpdateOverride =
            new PropertyDefinitionMap(METRIC_UPDATE_OVERRIDE_PROPERTY, null, true, metricName, resourceTypeName,
                resourceTypePlugin, updateSchedules);
        PropertyDefinitionList metricUpdateOverrides =
            new PropertyDefinitionList(METRIC_UPDATE_OVERRIDES_PROPERTY, "Per metric settings", false,
                metricUpdateOverride);
View Full Code Here


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
        definition.put(new PropertyDefinitionSimple("Answer",null,false,PropertySimpleType.INTEGER));
        definition.put(new PropertyDefinitionList("list",null,true,
                new PropertyDefinitionMap("list",null,true,
                    new PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));
        definition.put(new PropertyDefinitionSimple("aString",null,false,PropertySimpleType.INTEGER));


        List<String> errors = ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
View Full Code Here

        assert properties.size()==2 : "Expected 2 props, got " + properties.size();


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
        definition.put(new PropertyDefinitionMap("list",null,true,
                new PropertyDefinitionMap("list",null,true,
                    new PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));


        List<String> errors = ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
View Full Code Here

        assert properties.size()==2 : "Expected 2 props, got " + properties.size();


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionSimple("Hello",null,true,PropertySimpleType.STRING));
        definition.put(new PropertyDefinitionMap("list",null,true,
                new PropertyDefinitionList("list",null,true,
                    new PropertyDefinitionSimple("list",null,true,PropertySimpleType.STRING))));


        List<String> errors = ConfigurationHelper.checkConfigurationWrtDefinition(config,definition);
View Full Code Here

        propertyMap.put(new PropertySimple("aString","Frobnitz"));


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionMap("aMap",null,false,
            new PropertyDefinitionList("aList",null,false,
                new PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
            new PropertyDefinitionSimple("aString",null,false,PropertySimpleType.STRING)));

        Map<String,Object> map = ConfigurationHelper.configurationToMap(config,definition, true);
View Full Code Here

        propertyMap.put(new PropertySimple("aString","Frobnitz"));


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionMap("aMap",null,false,
            new PropertyDefinitionList("aBla",null,false,
                new PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
            new PropertyDefinitionSimple("aFoo",null,false,PropertySimpleType.STRING)));

        try {
View Full Code Here

        propertyMap.put(new PropertySimple("aString","Frobnitz"));


        ConfigurationDefinition definition = new ConfigurationDefinition("bla",null);
        definition.put(new PropertyDefinitionMap("aMap",null,false,
            new PropertyDefinitionList("aBla",null,false,
                new PropertyDefinitionSimple("string",null,false,PropertySimpleType.STRING)),
            new PropertyDefinitionSimple("aFoo",null,false,PropertySimpleType.STRING)));

        Map<String,Object> map = ConfigurationHelper.configurationToMap(config,definition, false);
View Full Code Here

        propDefEnums.add(new PropertyDefinitionEnumeration("blue", "blue"));
        propDefEnums.add(new PropertyDefinitionEnumeration("purple", "purple"));
        simplePropDef.setEnumeratedValues(propDefEnums, false);
        propertyDefinitions.put(simplePropDef.getName(), simplePropDef);

        PropertyDefinitionMap mapPropDef = new PropertyDefinitionMap("MapOfSimples", "a map of simples", false);
        mapPropDef.put(createStringPropDef1());
        mapPropDef.put(createStringPropDef2());
        mapPropDef.put(createIntegerPropDef());
        mapPropDef.setDisplayName(mapPropDef.getName());
        propertyDefinitions.put(mapPropDef.getName(), mapPropDef);

        PropertyDefinitionMap openMapPropDef = new PropertyDefinitionMap("OpenMapOfSimples", "an open map of simples",
            false);
        openMapPropDef.setDisplayName(openMapPropDef.getName());
        propertyDefinitions.put(openMapPropDef.getName(), openMapPropDef);

        PropertyDefinitionMap readOnlyOpenMapPropDef = new PropertyDefinitionMap("ReadOnlyOpenMapOfSimples",
            "a read-only open map of simples", false);
        readOnlyOpenMapPropDef.setDisplayName(readOnlyOpenMapPropDef.getName());
        readOnlyOpenMapPropDef.setReadOnly(true);
        propertyDefinitions.put(readOnlyOpenMapPropDef.getName(), readOnlyOpenMapPropDef);

        PropertyDefinitionList listOfSimplesPropDef = new PropertyDefinitionList("ListOfStrings",
            "another list of Strings", true, new PropertyDefinitionSimple("note", "a note", false,
                PropertySimpleType.STRING));
        listOfSimplesPropDef.setDisplayName(listOfSimplesPropDef.getName());
        propertyDefinitions.put(listOfSimplesPropDef.getName(), listOfSimplesPropDef);

        PropertyDefinitionMap mapInListPropDef = new PropertyDefinitionMap("MapOfSimplesInList", "a map of simples in a list", false);
        mapInListPropDef.put(createStringPropDef1());
        mapInListPropDef.put(createStringPropDef2());
        mapInListPropDef.put(createIntegerPropDef());
        mapInListPropDef.setDisplayName(mapInListPropDef.getName());

        PropertyDefinitionList listPropDef = new PropertyDefinitionList("ListOfMaps", "a list of maps", true,
            mapInListPropDef);
        listPropDef.setDisplayName(listPropDef.getName());
        propertyDefinitions.put(listPropDef.getName(), listPropDef);

        PropertyDefinitionMap mapInReadOnlyListPropDef = new PropertyDefinitionMap("MapOfSimplesInReadOnlyList", "a map of simples in a list", false);
        mapInReadOnlyListPropDef.put(createStringPropDef1());
        mapInReadOnlyListPropDef.put(createStringPropDef2());
        mapInReadOnlyListPropDef.put(createIntegerPropDef());
        mapInReadOnlyListPropDef.setDisplayName(mapInReadOnlyListPropDef.getName());

        PropertyDefinitionList readOnlyListPropDef = new PropertyDefinitionList("ReadOnlyListOfMaps",
            "a read-only list of maps", true, mapInReadOnlyListPropDef);
        readOnlyListPropDef.setDisplayName(readOnlyListPropDef.getName());
        readOnlyListPropDef.setReadOnly(true);
View Full Code Here

    }

    public void testListOfMapsPropertyConversion() throws Exception {
        ConfigurationDefinition def = new ConfigurationDefinition("null", null);
        PropertyDefinitionList listDef =
            new PropertyDefinitionList("list", "list descr", true, new PropertyDefinitionMap("map", "map descr", true,
                new PropertyDefinitionSimple("prop1", "prop1 descr", true, PropertySimpleType.BOOLEAN),
                new PropertyDefinitionSimple("prop2", "prop2 descr", false, PropertySimpleType.PASSWORD)));
        def.put(listDef);

        Configuration config = new Configuration();
View Full Code Here

        assertNotNull(prop, "Could not find the expected property");

        assertEquals(propDef.getClass(), PropertyDefinitionMap.class, "Unexpected type of the property definition");
        assertEquals(prop.getClass(), PropertyMap.class, "Unexpecetd type of the property");

        PropertyDefinitionMap mapDef = (PropertyDefinitionMap) propDef;
        PropertyMap mapProp = (PropertyMap) prop;

        assertEquals(mapDef.getMap().size(), 2, "Unexpected number of map member definitions");
        assertEquals(mapProp.getMap().size(), 2, "Unexpected number of map members");

        PropertyDefinition m1Def = mapDef.get("m1");
        PropertyDefinition m2Def = mapDef.get("m2");
        Property m1Prop = mapProp.get("m1");
        Property m2Prop = mapProp.get("m2");

        assertEquals(m1Def.getClass(), PropertyDefinitionSimple.class);
        assertEquals(m2Def.getClass(), PropertyDefinitionSimple.class);
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.