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

The following examples show how to use com.sun.xml.internal.ws.policy.PolicyAssertion#getNestedPolicy() . 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: AddressingPolicyValidator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 2
Source File: AddressingPolicyValidator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 3
Source File: AddressingPolicyValidator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 4
Source File: AddressingPolicyValidator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 5
Source File: AddressingPolicyValidator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 6
Source File: AddressingPolicyValidator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 7
Source File: AddressingPolicyValidator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}
 
Example 8
Source File: AddressingPolicyValidator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Fitness validateServerSide(PolicyAssertion assertion) {
    if (!supportedAssertions.contains(assertion.getName()))
        return Fitness.UNKNOWN;

    //Make sure wsam:Addressing contains only one of the allowed nested assertions.
    if (assertion.getName().equals(W3CAddressingMetadataConstants.WSAM_ADDRESSING_ASSERTION)) {
        NestedPolicy nestedPolicy = assertion.getNestedPolicy();
        if (nestedPolicy != null) {
            boolean requiresAnonymousResponses = false;
            boolean requiresNonAnonymousResponses = false;
            for (PolicyAssertion nestedAsser : nestedPolicy.getAssertionSet()) {
                if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_ANONYMOUS_NESTED_ASSERTION)) {
                    requiresAnonymousResponses = true;
                } else if (nestedAsser.getName().equals(W3CAddressingMetadataConstants.WSAM_NONANONYMOUS_NESTED_ASSERTION)) {
                    requiresNonAnonymousResponses = true;
                } else {
                    LOGGER.warning("Found unsupported assertion:\n" + nestedAsser + "\nnested into assertion:\n" + assertion);
                    return Fitness.UNSUPPORTED;
                }
            }

            if (requiresAnonymousResponses && requiresNonAnonymousResponses) {
                LOGGER.warning("Only one among AnonymousResponses and NonAnonymousResponses can be nested in an Addressing assertion");
                return Fitness.INVALID;
            }
        }
    }

    return Fitness.SUPPORTED;
}