Package org.rhq.core.domain.configuration

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


            map.put(new PropertySimple(BUNDLE_DEST_DEFINITION_CONNECTION_NAME, connectionString));
            PropertyList list = new PropertyList(BUNDLE_DEST_DEFINITION_REF_LIST_NAME);
            map.put(list);

            for (ConfigRef ref : referencedConfiguration) {
                PropertyMap refMap = new PropertyMap(BUNDLE_DEST_DEFINITION_REF_LIST_MEMBER_NAME);
                refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_TYPE_NAME, ref.getType().name()));
                refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_CONTEXT_NAME, ref.getContext().name()));
                refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_NAME_NAME, ref.getName()));
                refMap.put(new PropertySimple(BUNDLE_DEST_DEF_REF_TARGET_NAME_NAME, ref.getTargetName()));
                list.add(refMap);
            }
        }
View Full Code Here


                    base.put(basePropertySimple);
                } else {
                    basePropertySimple.setStringValue(changesPropertySimple.getStringValue());
                }
            } else if (changesProperty instanceof PropertyMap) {
                PropertyMap changesPropertyMap = (PropertyMap) changesProperty;
                PropertyMap basePropertyMap = (PropertyMap) base.get(changesPropertyName);
                if (basePropertyMap == null) {
                    basePropertyMap = new PropertyMap(changesPropertyName);
                    base.put(basePropertyMap);
                }
                // Recurse...
                merge(basePropertyMap, changesPropertyMap);
            }
View Full Code Here

    private void setDescriptionProperty(String description) {
        configuration.put(new PropertySimple(DriftConfigurationDefinition.PROP_DESCRIPTION, description));
    }

    public BaseDirectory getBasedir() {
        PropertyMap map = configuration.getMap(DriftConfigurationDefinition.PROP_BASEDIR);
        if (map == null) {
            return null;
        }

        String valueContext = map.getSimpleValue(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT, null);
        String valueName = map.getSimpleValue(DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME, null);

        BaseDirValueContext valueContextEnum;

        if (valueContext == null) {
            throw new NullPointerException("valueContext is null");
View Full Code Here

        }

        String valueContext = basedir.getValueContext().name();
        String valueName = basedir.getValueName();

        PropertyMap basedirMap = new PropertyMap(DriftConfigurationDefinition.PROP_BASEDIR);
        basedirMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT, valueContext));
        basedirMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME, StringUtils
            .useForwardSlash(valueName)));

        configuration.put(basedirMap);
    }
View Full Code Here

            // this is going to be our first include filter - make sure we create an initial list and put it in the config
            filtersList = new PropertyList(DriftConfigurationDefinition.PROP_INCLUDES);
            configuration.put(filtersList);
        }

        PropertyMap filterMap = new PropertyMap(DriftConfigurationDefinition.PROP_INCLUDES_INCLUDE);
        filterMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATH, StringUtils.useForwardSlash(filter
            .getPath())));
        filterMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATTERN, filter.getPattern()));
        filtersList.add(filterMap);
    }
View Full Code Here

            // this is going to be our first include filter - make sure we create an initial list and put it in the config
            filtersList = new PropertyList(DriftConfigurationDefinition.PROP_EXCLUDES);
            configuration.put(filtersList);
        }

        PropertyMap filterMap = new PropertyMap(DriftConfigurationDefinition.PROP_EXCLUDES_EXCLUDE);
        filterMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATH, StringUtils.useForwardSlash(filter
            .getPath())));
        filterMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATTERN, filter.getPattern()));
        filtersList.add(filterMap);
    }
View Full Code Here

            return emptyList();
        }

        List<Filter> filters = new ArrayList<Filter>();
        for (Property property : filtersListProperty.getList()) {
            PropertyMap filter = (PropertyMap) property;
            filters.add(new Filter(filter.getSimpleValue(DriftConfigurationDefinition.PROP_PATH, "."), filter
                .getSimpleValue(DriftConfigurationDefinition.PROP_PATTERN, "")));
        }

        return filters;
    }
View Full Code Here

        }

        Map<String, URL> filesMap = new HashMap<String, URL>();

        for (Property property : additionalList.getList()) {
            PropertyMap additionalFileMap = (PropertyMap) property; // must be a map, let it throw exception if not
            String additionalFilesDir = additionalFileMap.getSimpleValue(PROP_ADDITIONAL_FILES_DIRECTORY, "");
            String additionalFilesRegex = additionalFileMap.getSimpleValue(PROP_ADDITIONAL_FILES_REGEX, null);

            // it is possible that the user wanted to just disable one of the additional files
            String additionalFilesEnabled = additionalFileMap.getSimpleValue(PROP_SNAPSHOT_ADDITIONAL_FILES, "true");
            if (!"true".equals(additionalFilesEnabled)) {
                continue;
            }

            File additionalFilesDirFile = new File(additionalFilesDir);
            if (!additionalFilesDirFile.isAbsolute()) {
                additionalFilesDirFile = new File(baseDir, additionalFilesDir);
            }

            String recursive = additionalFileMap.getSimpleValue(PROP_ADDITIONAL_FILES_RECURSIVE, "false");
            RegexFilenameFilter filter = new RegexFilenameFilter(additionalFilesRegex, recursive);
            File[] additionalFiles = additionalFilesDirFile.listFiles(filter);
            if (additionalFiles != null) {
                populateFilesMap(additionalFiles, filesMap, additionalFilesDir, filter);
            } else {
View Full Code Here

        }
    }

    private void deleteOpenMapMemberProperty(AbstractConfigurationComponent configurationComponent) {
        String mapName = FacesContextUtility.getRequiredRequestParameter(RequestParameterNameConstants.MAP_NAME_PARAM);
        PropertyMap propertyMap = configurationComponent.getConfiguration().getMap(mapName);
        if (propertyMap == null) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Configuration does not contain a map named '"
                + mapName + "'.");
            return;
        }

        String memberName = FacesContextUtility
            .getRequiredRequestParameter(RequestParameterNameConstants.MEMBER_NAME_PARAM);
        if (!propertyMap.getMap().containsKey(memberName)) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Map '" + mapName
                + "' does not contain a member property named '" + memberName + "'.");
            return;
        }

        Property memberProperty = propertyMap.getMap().get(memberName);
        String memberComponentId = PropertyIdGeneratorUtility.getIdentifier(memberProperty, null,
            AbstractPropertyBagUIComponentTreeFactory.PANEL_ID_SUFFIX);
        UIComponent mapMemberComponent = configurationComponent.findComponent(memberComponentId);
        if (mapMemberComponent == null) {
            throw new IllegalStateException("JSF component with id '" + memberComponentId + "' not found for map '"
                + mapName + "' member property '" + memberName + "'.");
        }
        FacesComponentUtility.detachComponent(mapMemberComponent);

        // Now delete the property from the actual Configuration.
        propertyMap.getMap().remove(memberName);

        // ...and from member Configurations if this is a group config.
        if (configurationComponent instanceof ConfigurationSetComponent) {
            ConfigurationSetComponent configurationSetComponent = ((ConfigurationSetComponent) configurationComponent);
            configurationSetComponent.getConfigurationSet().applyGroupConfiguration();
View Full Code Here

    private int addNewMap(AbstractConfigurationComponent config) {
        String listName = config.getListName();
        PropertyDefinitionMap mapDefinition = (PropertyDefinitionMap) config.getConfigurationDefinition()
            .getPropertyDefinitionList(listName).getMemberDefinition();
        String mapName = mapDefinition.getName();
        PropertyMap newMap = new PropertyMap(mapName);
        for (PropertyDefinition mapMemberDefinition : mapDefinition.getOrderedPropertyDefinitions()) {
            PropertyDefinitionSimple simpleDefinition = (PropertyDefinitionSimple) mapMemberDefinition;
            newMap.put(new PropertySimple(simpleDefinition.getName(), (simpleDefinition.isRequired()) ? "" : null));
        }

        PropertyList list = config.getConfiguration().getList(listName);
        list.add(newMap);
        return list.getList().size() - 1;
View Full Code Here

TOP

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

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.