Package org.rhq.core.domain.configuration

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


    }

    private void initExcludes(DriftDescriptor descriptor, DriftDefinitionTemplate template) {
        if (descriptor.getExcludes() != null && descriptor.getExcludes().getExclude().size() > 0) {
            Configuration config = template.getConfiguration();
            PropertyList excludes = new PropertyList(DriftConfigurationDefinition.PROP_EXCLUDES);

            for (DriftFilterDescriptor exclude : descriptor.getExcludes().getExclude()) {
                PropertyMap excludeMap = new PropertyMap(DriftConfigurationDefinition.PROP_EXCLUDES_EXCLUDE);
                excludeMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATH, exclude.getPath()));
                excludeMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATTERN, exclude.getPattern()));

                excludes.add(excludeMap);
            }
            config.put(excludes);
        }
    }
View Full Code Here


    private void addBundleDestinationSpecification(BundleDestinationSpecification def) {
        if (this.bundleConfiguration == null) {
            throw new NullPointerException("bundleConfiguration == null");
        }

        PropertyList propertyList = this.bundleConfiguration.getList(BUNDLE_DEST_LIST_NAME);
        if (propertyList == null) {
            propertyList = new PropertyList(BUNDLE_DEST_LIST_NAME);
            this.bundleConfiguration.put(propertyList);
        }

        PropertyMap map = new PropertyMap(BUNDLE_DEST_LIST_ITEM_NAME);
        def.fillPropertyMap(map);

        propertyList.add(map);
    }
View Full Code Here

    private <T extends BundleDestinationSpecification> Set<T> getBundleDestinationSpecificationsOfType(Class<T> type) {
        if (this.bundleConfiguration == null) {
            return null;
        }

        PropertyList propertyList = this.bundleConfiguration.getList(BUNDLE_DEST_LIST_NAME);
        if (propertyList == null) {
            return null;
        }

        List<Property> list = propertyList.getList();
        if (list.size() == 0) {
            return null;
        }

        Set<T> retVal = new HashSet<T>(list.size());
View Full Code Here

        private static <T extends BundleDestinationSpecification> T from(PropertyMap map, Class<T> expectedClass) {
            String name = map.getSimpleValue(BUNDLE_DEST_NAME_NAME, null);
            String valueContext = map.getSimpleValue(BUNDLE_DEST_BASE_DIR_VALUE_CONTEXT_NAME, null);
            String description = map.getSimpleValue(BUNDLE_DEST_DESCRIPTION_NAME, null);
            String connection = map.getSimpleValue(BUNDLE_DEST_DEFINITION_CONNECTION_NAME, null);
            PropertyList refs = map.getList(BUNDLE_DEST_DEFINITION_REF_LIST_NAME);
            PropertyList acceptProps = map.getList(BUNDLE_DEST_ACCEPTS_LIST_NAME);

            Class<?> determinedClass = Object.class;
            if (valueContext == null) {
                if (connection != null || refs != null) {
                    determinedClass = BundleDestinationDefinition.class;
                }
            } else {
                if (connection == null && refs == null) {
                    determinedClass = BundleDestinationBaseDirectory.class;
                }
            }

            //first convert accepts into a List<String>
            List<String> accepts = new ArrayList<String>();
            if (acceptProps != null) {
                for (Property p : acceptProps.getList()) {
                    PropertySimple bundleType = (PropertySimple) p;
                    accepts.add(bundleType.getStringValue());
                }
            }
View Full Code Here

                PropertySimple descriptionProp = new PropertySimple(BUNDLE_DEST_DESCRIPTION_NAME,
                    getDescription());
                map.put(descriptionProp);
            }

            PropertyList accepts = new PropertyList(BUNDLE_DEST_ACCEPTS_LIST_NAME);
            map.put(accepts);
            for (String acc : acceptedBundleTypes) {
                PropertySimple p = new PropertySimple(BUNDLE_DEST_ACCEPTS_LIST_MEMBER_NAME, acc);
                accepts.add(p);
            }
        }
View Full Code Here

        @Override
        protected void fillPropertyMap(PropertyMap map) {
            super.fillPropertyMap(map);
            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

            }
        }
    }

    public void addInclude(Filter filter) {
        PropertyList filtersList = configuration.getList(DriftConfigurationDefinition.PROP_INCLUDES);
        if (filtersList == null) {
            // 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

            }
        }
    }

    public void addExclude(Filter filter) {
        PropertyList filtersList = configuration.getList(DriftConfigurationDefinition.PROP_EXCLUDES);
        if (filtersList == null) {
            // 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

        filterMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_PATTERN, filter.getPattern()));
        filtersList.add(filterMap);
    }

    private List<Filter> getFilters(String type) {
        PropertyList filtersListProperty = configuration.getList(type);
        if (filtersListProperty == null) {
            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, "")));
        }
View Full Code Here

        if (!"true".equals(config.getSimpleValue(PROP_SNAPSHOT_ADDITIONAL_FILES, "false"))) {
            return null; // any additional files are not to be snapshotted into the report, abort
        }

        String baseDir = config.getSimpleValue(PROP_BASE_DIRECTORY, null);
        PropertyList additionalList = config.getList(PROP_ADDITIONAL_FILES_LIST);
        if (additionalList == null || additionalList.getList() == null) {
            return null; // there are no additional files defined, just skip it
        }

        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
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.