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

Examples of com.volantis.devrep.device.api.xml.policy.PolicyEntry


        dumpPolicySet(policySet, output);

        Iterator i =policySet.entries();
          while (i.hasNext())
          {
             PolicyEntry test = (PolicyEntry)i.next();
             if ("testinherit".equals(test.getName())) {
                 assertNotNull(test.getInherit());
             }   
          }


        String actual = output.toString();
View Full Code Here


    private void dumpPolicySet(PolicySet policySet, StringBuffer buffer) {

        Iterator policyIterator = policySet.entries();
        while (policyIterator.hasNext()) {
            PolicyEntry policyEntry = (PolicyEntry) policyIterator.next();
            dumpPolicyEntry(policyEntry, buffer);
        }
    }
View Full Code Here

    private void addPolicySetToDevice(PolicySet policySet,
                                      DefaultDevice device) {

        Iterator entries = policySet.entries();
        while (entries.hasNext()) {
            PolicyEntry entry = (PolicyEntry) entries.next();
            Iterator fields = entry.fields();
            Iterator values = entry.values();
            if (fields.hasNext()) {
                // it has fields, so this is a structure entry.
                // NOTE: schema says each field can contain multiple values but
                // this is not used so is not implemented.
                while (fields.hasNext()) {
                    PolicyField field = (PolicyField) fields.next();
                    String name = entry.getName() + "." + field.getName();
                    device.setPolicyValue(name, field.getValue());
                }
            } else if (values.hasNext()) {
                // it has values, so it is a simple entry which may have
                // multiple values.
                String value = (String) values.next();
                StringBuffer buffer = new StringBuffer(value);
                while (values.hasNext()) {
                    value = (String) values.next();
                    buffer.append(",");
                    buffer.append(value);
                }
                device.setPolicyValue(entry.getName(), buffer.toString());
            } else {
                // no values at all, for backwards compatibility with the
                // old JDOM accessor we add it with no value. Not sure if we
                // really should?
                device.setPolicyValue(entry.getName(), "");
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.volantis.devrep.device.api.xml.policy.PolicyEntry

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.