Package org.rhq.core.domain.configuration

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


        AbstractPropertyMap propertyMap, List<FormItem> fields) {
        boolean odd = true;
        List<PropertyDefinition> sortedPropertyDefinitions = new ArrayList<PropertyDefinition>(propertyDefinitions);
        Collections.sort(sortedPropertyDefinitions, new PropertyDefinitionComparator());
        for (PropertyDefinition propertyDefinition : sortedPropertyDefinitions) {
            Property property = propertyMap.get(propertyDefinition.getName());
            if (property == null) {
                if (propertyDefinition instanceof PropertyDefinitionSimple) {
                    property = new PropertySimple(propertyDefinition.getName(), null);
                    propertyMap.put(property);
                }
View Full Code Here


        List<PropertyDefinition> definitions) {
        PropertyMapListGridRecord[] records = new PropertyMapListGridRecord[propertyList == null ? 0 : propertyList
            .getList().size()];
        List<Property> list = propertyList.getList();
        for (int index = 0, listSize = list.size(); index < listSize; index++) {
            Property row = list.get(index);
            PropertyMap rowMap = (PropertyMap) row;
            PropertyMapListGridRecord record = new PropertyMapListGridRecord(rowMap, index, definitions);
            records[index] = record;
        }
        return records;
View Full Code Here

    private static LinkedHashMap<String, String> buildValueMap(PropertyList propertyList) {
        LinkedHashMap<String, String> memberValueToIndexMap = new LinkedHashMap<String, String>();
        List<Property> memberProperties = propertyList.getList();
        int index = 0;
        for (Iterator<Property> iterator = memberProperties.iterator(); iterator.hasNext();) {
            Property memberProperty = iterator.next();
            PropertySimple memberPropertySimple = (PropertySimple) memberProperty;
            String memberValue = memberPropertySimple.getStringValue();
            if (memberValue == null) {
                Log.error("List " + propertyList + " contains property with null value - removing and skipping...");
                iterator.remove();
View Full Code Here

        }
        return currentPropertyDefinition;
    }

    protected static Property getTopLevelProperty(Property property) {
        Property currentProperty = property;
        while (currentProperty.getConfiguration() == null) {
            if (currentProperty.getParentList() != null) {
                currentProperty = currentProperty.getParentList();
            } else if (currentProperty.getParentMap() != null) {
                currentProperty = currentProperty.getParentMap();
            } else {
                Log.error("Property " + currentProperty + " has no parent.");
                break;
            }
        }
View Full Code Here

        Map<String, Property> map = propertyMap.getMap();
        Map<String,Object> result = new HashMap<String, Object>(map.size());

        Set<String> names = map.keySet();
        for (String name : names ) {
            Property property = map.get(name);
            PropertyDefinition definition = null;
            if (propertyDefinition != null) {
                definition = propertyDefinition.get(name);
            }
View Full Code Here

    }

    private static PropertyList getPropertyList(String propertyName, List<Object> objects) {
        PropertyList propertyList = new PropertyList(propertyName);

        Property target;
        for (Object o : objects) {
            if (o instanceof List) {
                // Not sure if we actually support that at all inside RHQ
                List list = (List) o;
                target = getPropertyList(propertyName,list); // TODO propertyName?
View Full Code Here

    private static PropertyMap getPropertyMap(String propertyName, Map<String, Object> map) {
        PropertyMap propertyMap = new PropertyMap(propertyName);
        Set<String> keys = map.keySet();
        for (String key : keys) {
            Object value = map.get(key);
            Property target;
            if (value instanceof Map) {
                target = getPropertyMap(key, (Map)value);
            } else if (value instanceof List) {
                target = getPropertyList(key, (List)value);
            } else {
View Full Code Here

        // Basic validation is done, now have a look at the properties

        for (PropertyDefinition propDef : definition.getPropertyDefinitions().values()) {
            String name = propDef.getName();
            Property property = configuration.get(name);

            checkProperty(messages, propDef, property);
        }

View Full Code Here

                }
            } else if (property instanceof PropertyMap) {
                PropertyMap propertyMap = (PropertyMap) property;
                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) propertyDefinition;
                for (Map.Entry<String,Property> entry : propertyMap.getMap().entrySet()) {
                    Property prop = entry.getValue();
                    PropertyDefinition definition = propertyDefinitionMap.get(name);
                    checkProperty(messages,definition,prop);
                }
            }
        }
View Full Code Here

        Configuration config = subjectPreferences.get(subjectId);
        if (config == null) {
            return;
        }

        Property property = config.remove(propertyName);
        // it's possible property was already removed, and thus this operation becomes a no-op to the backing store
        if (property != null && property.getId() != 0) {
            try {
                configurationManager.deleteProperties(new int[] { property.getId() });
            } catch (Throwable t) {
                log.error("Could not remove " + property, t);
            }
        }
    }
View Full Code Here

TOP

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

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.