Java Code Examples for com.sun.xml.internal.ws.policy.PolicyAssertion#hasNestedPolicy()

The following examples show how to use com.sun.xml.internal.ws.policy.PolicyAssertion#hasNestedPolicy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PolicyModelGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}
 
Example 2
Source File: NormalizedModelGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 3
Source File: NormalizedModelGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 4
Source File: PolicyModelGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}
 
Example 5
Source File: PolicyModelGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 6
Source File: NormalizedModelGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 7
Source File: NormalizedModelGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 8
Source File: PolicyModelGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}
 
Example 9
Source File: PolicyModelGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 10
Source File: PolicyModelGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 11
Source File: PolicyModelGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 12
Source File: CompactModelGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        ModelNode rootNode = model.getRootNode();
        final int numberOfAssertionSets = policy.getNumberOfAssertionSets();
        if (numberOfAssertionSets > 1) {
            rootNode = rootNode.createChildExactlyOneNode();
        }
        ModelNode alternativeNode = rootNode;
        for (AssertionSet set : policy) {
            if (numberOfAssertionSets > 1) {
                alternativeNode = rootNode.createChildAllNode();
            }
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 13
Source File: PolicyModelGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 14
Source File: CompactModelGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        ModelNode rootNode = model.getRootNode();
        final int numberOfAssertionSets = policy.getNumberOfAssertionSets();
        if (numberOfAssertionSets > 1) {
            rootNode = rootNode.createChildExactlyOneNode();
        }
        ModelNode alternativeNode = rootNode;
        for (AssertionSet set : policy) {
            if (numberOfAssertionSets > 1) {
                alternativeNode = rootNode.createChildAllNode();
            }
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 15
Source File: NormalizedModelGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 16
Source File: PolicyModelGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}
 
Example 17
Source File: PolicyModelGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Add the contents of the assertion set as child node to the given model node.
 *
 * @param node The content of this assertion set are added as child nodes to this node.
 *     May not be null.
 * @param assertions The assertions that are to be added to the node. May not be null.
 */
protected void translate(final ModelNode node, final AssertionSet assertions) {
    for (PolicyAssertion assertion : assertions) {
        final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
        final ModelNode assertionNode = node.createChildAssertionNode(data);
        if (assertion.hasNestedPolicy()) {
            translate(assertionNode, assertion.getNestedPolicy());
        }
        if (assertion.hasParameters()) {
            translate(assertionNode, assertion.getParametersIterator());
        }
    }
}
 
Example 18
Source File: PolicyModelGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}
 
Example 19
Source File: NormalizedModelGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public PolicySourceModel translate(final Policy policy) throws PolicyException {
    LOGGER.entering(policy);

    PolicySourceModel model = null;

    if (policy == null) {
        LOGGER.fine(LocalizationMessages.WSP_0047_POLICY_IS_NULL_RETURNING());
    } else {
        model = this.sourceModelCreator.create(policy);
        final ModelNode rootNode = model.getRootNode();
        final ModelNode exactlyOneNode = rootNode.createChildExactlyOneNode();
        for (AssertionSet set : policy) {
            final ModelNode alternativeNode = exactlyOneNode.createChildAllNode();
            for (PolicyAssertion assertion : set) {
                final AssertionData data = AssertionData.createAssertionData(assertion.getName(), assertion.getValue(), assertion.getAttributes(), assertion.isOptional(), assertion.isIgnorable());
                final ModelNode assertionNode = alternativeNode.createChildAssertionNode(data);
                if (assertion.hasNestedPolicy()) {
                    translate(assertionNode, assertion.getNestedPolicy());
                }
                if (assertion.hasParameters()) {
                    translate(assertionNode, assertion.getParametersIterator());
                }
            }
        }
    }

    LOGGER.exiting(model);
    return model;
}
 
Example 20
Source File: PolicyModelGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Iterates through all contained assertions and adds them to the info model.
 *
 * @param assertionParametersIterator The contained assertions.
 * @param assertionNode The node to which the assertions are added as child nodes
 */
protected void translate(final ModelNode assertionNode, final Iterator<PolicyAssertion> assertionParametersIterator) {
    while (assertionParametersIterator.hasNext()) {
        final PolicyAssertion assertionParameter = assertionParametersIterator.next();
        final AssertionData data = AssertionData.createAssertionParameterData(assertionParameter.getName(), assertionParameter.getValue(), assertionParameter.getAttributes());
        final ModelNode assertionParameterNode = assertionNode.createChildAssertionParameterNode(data);
        if (assertionParameter.hasNestedPolicy()) {
            throw LOGGER.logSevereException(new IllegalStateException(LocalizationMessages.WSP_0005_UNEXPECTED_POLICY_ELEMENT_FOUND_IN_ASSERTION_PARAM(assertionParameter)));
        }
        if (assertionParameter.hasNestedAssertions()) {
            translate(assertionParameterNode, assertionParameter.getNestedAssertionsIterator());
        }
    }
}