Package org.rhq.core.domain.configuration

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


    public void testConfigToMapComplexMapWithBadSetupStrict() throws Exception {

        Configuration config = new Configuration();
        PropertyMap propertyMap = new PropertyMap("aMap");
        config.put(propertyMap);
        PropertyList propertyList = new PropertyList("aList");
        propertyList.add(new PropertySimple("string", "Hello"));
        propertyList.add(new PropertySimple("string", "World"));
        propertyMap.put(propertyList);

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

View Full Code Here


    public void testConfigToMapComplexMapWithBadSetupLenient() throws Exception {

        Configuration config = new Configuration();
        PropertyMap propertyMap = new PropertyMap("aMap");
        config.put(propertyMap);
        PropertyList propertyList = new PropertyList("aList");
        propertyList.add(new PropertySimple("string", "Hello"));
        propertyList.add(new PropertySimple("string", "World"));
        propertyMap.put(propertyList);

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

View Full Code Here

    private void checkAlertsValidity(ControlResults results) {
        List<AlertNotification> allCliNotifications = getAllCliNotifications(null);

        Configuration resConfig = results.getComplexResults();

        PropertyList missingUsersList = new PropertyList(PROP_MISSING_USERS);
        resConfig.put(missingUsersList);

        List<AlertNotification> invalidNotifs = getCliNotificationsWithInvalidUser(allCliNotifications);
        convertNotificationsToInvalidAlertDefResults(missingUsersList, invalidNotifs);

        PropertyList missingScriptsList = new PropertyList(PROP_MISSING_SCRIPTS);
        resConfig.put(missingScriptsList);

        invalidNotifs = getCliNotificationsWithInvalidPackage(allCliNotifications);
        convertNotificationsToInvalidAlertDefResults(missingScriptsList, invalidNotifs);

        //ok, now we have to obtain the resource paths. doing it out of the above loop reduces the number
        //of server roundtrips

        List<Property> allMissing = new ArrayList<Property>();
        allMissing.addAll(missingUsersList.getList());
        allMissing.addAll(missingScriptsList.getList());

        if (allMissing.size() > 0) {
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();

            List<DisambiguationReport<Property>> disambiguated = resourceManager.disambiguate(allMissing,
View Full Code Here

            } else if (propertyInstance instanceof ListPropertyInstanceDescriptor) {
                def = convert((ConfigurationProperty) propertyInstance);
                def.setConfigurationDefinition(configurationDefinition);

                ListPropertyInstanceDescriptor listInstance = (ListPropertyInstanceDescriptor) propertyInstance;
                PropertyList listProp = new PropertyList(listInstance.getName());

                PropertyDefinition memberDefinition = ((PropertyDefinitionList) def).getMemberDefinition();

                if (listInstance.getValues() != null) {
                    for (JAXBElement<?> val : listInstance.getValues().getComplexValue()) {
                        ComplexValueDescriptor valDesc = (ComplexValueDescriptor) val.getValue();
                        Property child = convert(memberDefinition, valDesc);
                        listProp.add(child);
                    }
                }

                prop = listProp;
            } else if (propertyInstance instanceof MapPropertyInstanceDescriptor) {
View Full Code Here

            } else if (value instanceof ComplexValueListDescriptor) {
                ComplexValueListDescriptor listValue = (ComplexValueListDescriptor) value;

                PropertyDefinitionList listDefinition = (PropertyDefinitionList) definition;

                PropertyList list = new PropertyList(value.getPropertyName());

                for (JAXBElement<?> val : listValue.getComplexValue()) {
                    Property child = convert(listDefinition.getMemberDefinition(),
                        (ComplexValueDescriptor) val.getValue());

                    list.add(child);
                }
                ret = list;
            } else if (value instanceof ComplexValueMapDescriptor) {
                ComplexValueMapDescriptor mapValue = (ComplexValueMapDescriptor) value;
View Full Code Here

                if (jobDef != null) {
                    jobs.add(jobDef);
                } else {
                    // this might be a list-o-maps containing a list of user-define jobs
                    if (prop instanceof PropertyList) {
                        PropertyList listOfJobs = (PropertyList) prop;
                        for (Property listItem : listOfJobs.getList()) {
                            jobDef = getScheduledJob(listItem);
                            if (jobDef != null) {
                                jobs.add(jobDef);
                            }
                        }
View Full Code Here

            calculateGroupPropertyMap((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

            mergePropertyMap((PropertyDefinitionMap) propertyDefinition, nestedSourceParentPropertyMaps,
                groupPropertyMap);
        } else if (propertyDefinition instanceof PropertyDefinitionList) {
            PropertyDefinitionList propertyDefinitionList = (PropertyDefinitionList) propertyDefinition;
            PropertyDefinition listMemberPropertyDefinition = propertyDefinitionList.getMemberDefinition();
            PropertyList groupPropertyList = groupParentPropertyMap.getList(propertyDefinition.getName());
            if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) listMemberPropertyDefinition;
                // TODO: How do we merge Lists of Maps? Not trivial...
            }
        }
View Full Code Here

        } finally {
            Thread.currentThread().setContextClassLoader(originalCL);
        }

        OperationResult info = new OperationResult();
        PropertyList list = new PropertyList("plugins");
        info.getComplexResults().put(list);

        for (String plugin : deploymentOrder) {
            PropertyMap map = new PropertyMap("plugin");
            map.put(new PropertySimple("name", plugin));
            map.put(new PropertySimple("dependencies", dependencies.get(plugin)));
            list.add(map);
        }

        return info;
    }
View Full Code Here

            Thread.currentThread().setContextClassLoader(originalCL);
        }

        OperationResult info = new OperationResult();
        PropertySimple numClassLoaders = new PropertySimple("numberOfClassLoaders", String.valueOf(classloaders.size()));
        PropertyList list = new PropertyList("classloaders");
        info.getComplexResults().put(numClassLoaders);
        info.getComplexResults().put(list);

        for (Map.Entry<String, ClassLoader> entry : classloaders.entrySet()) {
            String pluginName = entry.getKey();
            ClassLoader classloader = entry.getValue();
            PropertyMap map = new PropertyMap("classloader");
            map.put(new PropertySimple("pluginName", pluginName));
            map.put(new PropertySimple("classloaderInfo", classloader));
            list.add(map);
        }

        return info;
    }
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.