Package com.volantis.devrep.device.api.xml.definitions

Examples of com.volantis.devrep.device.api.xml.definitions.Policy


    private void dumpCategory(Category category, StringBuffer buffer) {
        buffer.append("Category:\n");
        buffer.append("  name=" + category.getName() + "\n");
        Iterator policies = category.policies();
        while (policies.hasNext()) {
            Policy policy = (Policy) policies.next();
            dumpPolicy(policy, buffer);
        }
    }
View Full Code Here


    }

    private void extractCategoryPolicyNames(Category category, List names) {
        Iterator policies = category.policies();
        while (policies.hasNext()) {
            Policy policy = (Policy) policies.next();
            names.add(policy.getName());
        }
    }
View Full Code Here

            return descriptor;
        }

        DefaultPolicyDescriptor descriptor = null;

        Policy policy = definitions.getPolicy(policyName);
        if (policy != null) {

            // Create the basic policy descriptor
            descriptor = new DefaultPolicyDescriptor();

            // Set the descriptive name
            String nameProperty =
                    DeviceRepositoryConstants.POLICY_RESOURCE_PREFIX +
                    policyName +
                    DeviceRepositoryConstants.NAME_PROPERTY_SUFFIX;
            String name = createProperties(locale).getProperty(nameProperty);
            if (name == null) {
                descriptor.setPolicyDescriptiveName(policyName);
            } else {
                descriptor.setPolicyDescriptiveName(name);
            }
            descriptor.setLanguage((String) localeToLocaleFound.get(locale));

            // Set the help
            String descriptionProperty =
                    DeviceRepositoryConstants.POLICY_RESOURCE_PREFIX +
                    policyName +
                    DeviceRepositoryConstants.DESCRIPTION_PROPERTY_SUFFIX;
            String help = createProperties(locale).getProperty(descriptionProperty);
            if (help == null) {
                descriptor.setPolicyHelp(policyName);
            } else {
                descriptor.setPolicyHelp(help);
            }

            // Set the category (short) name
            descriptor.setCategory(policy.getCategory().getName());

            // TODO: later: set the category long name/description as well so
            // that the UpdateClient merge report can access it from there
            // rather than using the old JDOM accessor code as it does now.

            // Set the the type
            // Work out the type of the policy.
            final TypeContainer typeContainer = policy.getTypeContainer();
            String typeName = typeContainer.getName();
            Type type = typeContainer.getType();
            if (typeName != null && type == null) {
                // this is a reference to a declared type.
                TypeDeclaration declaration = definitions.getType(typeName);
View Full Code Here

            Iterator categories = categories();
            while (categories.hasNext()) {
                Category category = (Category) categories.next();
                Iterator policies = category.policies();
                while (policies.hasNext()) {
                    Policy policy = (Policy) policies.next();
                    nameToPolicyMap.put(policy.getName(), policy);
                }
            }
        }
        return (Policy) nameToPolicyMap.get(policyName);
    }
View Full Code Here

TOP

Related Classes of com.volantis.devrep.device.api.xml.definitions.Policy

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.