com.sun.xml.internal.ws.policy.spi.AssertionCreationException Java Examples
The following examples show how to use
com.sun.xml.internal.ws.policy.spi.AssertionCreationException.
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: PolicyModelTranslator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertion(final AssertionData data, final Collection<PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) throws AssertionCreationException { final String assertionNamespace = data.getName().getNamespaceURI(); final PolicyAssertionCreator domainSpecificPAC = assertionCreators.get(assertionNamespace); if (domainSpecificPAC == null) { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } else { return domainSpecificPAC.createAssertion(data, assertionParameters, nestedAlternative, defaultCreator); } }
Example #2
Source File: PolicyModelTranslator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertionParameter(final ModelNode parameterNode) throws AssertionCreationException, PolicyException { if (parameterNode.getType() != ModelNode.Type.ASSERTION_PARAMETER_NODE) { throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0065_INCONSISTENCY_IN_POLICY_SOURCE_MODEL(parameterNode.getType()))); } List<PolicyAssertion> childParameters = null; if (parameterNode.hasChildren()) { childParameters = new ArrayList<PolicyAssertion>(parameterNode.childrenSize()); for (ModelNode childParameterNode : parameterNode) { childParameters.add(createPolicyAssertionParameter(childParameterNode)); } } return createPolicyAssertion(parameterNode.getNodeData(), childParameters, null /* parameters do not have any nested alternatives */); }
Example #3
Source File: PolicyModelTranslator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private List<PolicyAssertion> normalizeRawAssertion(final RawAssertion assertion) throws AssertionCreationException, PolicyException { List<PolicyAssertion> parameters; if (assertion.parameters.isEmpty()) { parameters = null; } else { parameters = new ArrayList<PolicyAssertion>(assertion.parameters.size()); for (ModelNode parameterNode : assertion.parameters) { parameters.add(createPolicyAssertionParameter(parameterNode)); } } final List<AssertionSet> nestedAlternatives = new LinkedList<AssertionSet>(); if (assertion.nestedAlternatives != null && !assertion.nestedAlternatives.isEmpty()) { final Queue<RawAlternative> nestedAlternativeQueue = new LinkedList<RawAlternative>(assertion.nestedAlternatives); RawAlternative rawAlternative; while((rawAlternative = nestedAlternativeQueue.poll()) != null) { nestedAlternatives.addAll(normalizeRawAlternative(rawAlternative)); } // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations } final List<PolicyAssertion> assertionOptions = new LinkedList<PolicyAssertion>(); final boolean nestedAlternativesAvailable = !nestedAlternatives.isEmpty(); if (nestedAlternativesAvailable) { for (AssertionSet nestedAlternative : nestedAlternatives) { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, nestedAlternative)); } } else { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, null)); } return assertionOptions; }
Example #4
Source File: ManagementAssertion.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Create a new ManagementAssertion instance. * * @param name The fully qualified name of the server or client assertion. Must * not be null. * @param data The assertion data. Must not be null. * @param assertionParameters Parameters of the assertion. May be null. * @throws AssertionCreationException Thrown if the creation of the assertion failed. */ protected ManagementAssertion(final QName name, AssertionData data, Collection<PolicyAssertion> assertionParameters) throws AssertionCreationException { super(data, assertionParameters); if (!name.equals(data.getName())) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1002_EXPECTED_MANAGEMENT_ASSERTION(name))); } if (isManagementEnabled() && !data.containsAttribute(ID_ATTRIBUTE_QNAME)) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1003_MANAGEMENT_ASSERTION_MISSING_ID(name))); } }
Example #5
Source File: ManagementAssertion.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Create a new ManagementAssertion instance. * * @param name The fully qualified name of the server or client assertion. Must * not be null. * @param data The assertion data. Must not be null. * @param assertionParameters Parameters of the assertion. May be null. * @throws AssertionCreationException Thrown if the creation of the assertion failed. */ protected ManagementAssertion(final QName name, AssertionData data, Collection<PolicyAssertion> assertionParameters) throws AssertionCreationException { super(data, assertionParameters); if (!name.equals(data.getName())) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1002_EXPECTED_MANAGEMENT_ASSERTION(name))); } if (isManagementEnabled() && !data.containsAttribute(ID_ATTRIBUTE_QNAME)) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1003_MANAGEMENT_ASSERTION_MISSING_ID(name))); } }
Example #6
Source File: ManagementAssertionCreator.java From hottub with GNU General Public License v2.0 | 5 votes |
public PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException { final QName name = data.getName(); if (ManagedServiceAssertion.MANAGED_SERVICE_QNAME.equals(name)) { return new ManagedServiceAssertion(data, assertionParameters); } else if (ManagedClientAssertion.MANAGED_CLIENT_QNAME.equals(name)) { return new ManagedClientAssertion(data, assertionParameters); } else { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } }
Example #7
Source File: PolicyModelTranslator.java From hottub with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertion(final AssertionData data, final Collection<PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) throws AssertionCreationException { final String assertionNamespace = data.getName().getNamespaceURI(); final PolicyAssertionCreator domainSpecificPAC = assertionCreators.get(assertionNamespace); if (domainSpecificPAC == null) { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } else { return domainSpecificPAC.createAssertion(data, assertionParameters, nestedAlternative, defaultCreator); } }
Example #8
Source File: PolicyModelTranslator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException { final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>(); final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>(); if (!alternative.nestedAssertions.isEmpty()) { final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions); RawAssertion rawAssertion; while((rawAssertion = nestedAssertionsQueue.poll()) != null) { final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion); // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations if (normalized.size() == 1) { normalizedContentBase.addAll(normalized); } else { normalizedContentOptions.add(normalized); } } } final List<AssertionSet> options = new LinkedList<AssertionSet>(); if (normalizedContentOptions.isEmpty()) { // we do not have any options to combine => returning this assertion options.add(AssertionSet.createAssertionSet(normalizedContentBase)); } else { // we have some options to combine => creating assertion options based on content combinations final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true); for (Collection<PolicyAssertion> contentOption : contentCombinations) { options.add(AssertionSet.createAssertionSet(contentOption)); } } return options; }
Example #9
Source File: ManagementAssertionCreator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException { final QName name = data.getName(); if (ManagedServiceAssertion.MANAGED_SERVICE_QNAME.equals(name)) { return new ManagedServiceAssertion(data, assertionParameters); } else if (ManagedClientAssertion.MANAGED_CLIENT_QNAME.equals(name)) { return new ManagedClientAssertion(data, assertionParameters); } else { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } }
Example #10
Source File: ManagementAssertion.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Create a new ManagementAssertion instance. * * @param name The fully qualified name of the server or client assertion. Must * not be null. * @param data The assertion data. Must not be null. * @param assertionParameters Parameters of the assertion. May be null. * @throws AssertionCreationException Thrown if the creation of the assertion failed. */ protected ManagementAssertion(final QName name, AssertionData data, Collection<PolicyAssertion> assertionParameters) throws AssertionCreationException { super(data, assertionParameters); if (!name.equals(data.getName())) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1002_EXPECTED_MANAGEMENT_ASSERTION(name))); } if (isManagementEnabled() && !data.containsAttribute(ID_ATTRIBUTE_QNAME)) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1003_MANAGEMENT_ASSERTION_MISSING_ID(name))); } }
Example #11
Source File: PolicyModelTranslator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException { final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>(); final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>(); if (!alternative.nestedAssertions.isEmpty()) { final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions); RawAssertion rawAssertion; while((rawAssertion = nestedAssertionsQueue.poll()) != null) { final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion); // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations if (normalized.size() == 1) { normalizedContentBase.addAll(normalized); } else { normalizedContentOptions.add(normalized); } } } final List<AssertionSet> options = new LinkedList<AssertionSet>(); if (normalizedContentOptions.isEmpty()) { // we do not have any options to combine => returning this assertion options.add(AssertionSet.createAssertionSet(normalizedContentBase)); } else { // we have some options to combine => creating assertion options based on content combinations final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true); for (Collection<PolicyAssertion> contentOption : contentCombinations) { options.add(AssertionSet.createAssertionSet(contentOption)); } } return options; }
Example #12
Source File: PolicyModelTranslator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private List<PolicyAssertion> normalizeRawAssertion(final RawAssertion assertion) throws AssertionCreationException, PolicyException { List<PolicyAssertion> parameters; if (assertion.parameters.isEmpty()) { parameters = null; } else { parameters = new ArrayList<PolicyAssertion>(assertion.parameters.size()); for (ModelNode parameterNode : assertion.parameters) { parameters.add(createPolicyAssertionParameter(parameterNode)); } } final List<AssertionSet> nestedAlternatives = new LinkedList<AssertionSet>(); if (assertion.nestedAlternatives != null && !assertion.nestedAlternatives.isEmpty()) { final Queue<RawAlternative> nestedAlternativeQueue = new LinkedList<RawAlternative>(assertion.nestedAlternatives); RawAlternative rawAlternative; while((rawAlternative = nestedAlternativeQueue.poll()) != null) { nestedAlternatives.addAll(normalizeRawAlternative(rawAlternative)); } // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations } final List<PolicyAssertion> assertionOptions = new LinkedList<PolicyAssertion>(); final boolean nestedAlternativesAvailable = !nestedAlternatives.isEmpty(); if (nestedAlternativesAvailable) { for (AssertionSet nestedAlternative : nestedAlternatives) { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, nestedAlternative)); } } else { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, null)); } return assertionOptions; }
Example #13
Source File: PolicyModelTranslator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertionParameter(final ModelNode parameterNode) throws AssertionCreationException, PolicyException { if (parameterNode.getType() != ModelNode.Type.ASSERTION_PARAMETER_NODE) { throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0065_INCONSISTENCY_IN_POLICY_SOURCE_MODEL(parameterNode.getType()))); } List<PolicyAssertion> childParameters = null; if (parameterNode.hasChildren()) { childParameters = new ArrayList<PolicyAssertion>(parameterNode.childrenSize()); for (ModelNode childParameterNode : parameterNode) { childParameters.add(createPolicyAssertionParameter(childParameterNode)); } } return createPolicyAssertion(parameterNode.getNodeData(), childParameters, null /* parameters do not have any nested alternatives */); }
Example #14
Source File: PolicyModelTranslator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertion(final AssertionData data, final Collection<PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) throws AssertionCreationException { final String assertionNamespace = data.getName().getNamespaceURI(); final PolicyAssertionCreator domainSpecificPAC = assertionCreators.get(assertionNamespace); if (domainSpecificPAC == null) { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } else { return domainSpecificPAC.createAssertion(data, assertionParameters, nestedAlternative, defaultCreator); } }
Example #15
Source File: ManagementAssertionCreator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException { final QName name = data.getName(); if (ManagedServiceAssertion.MANAGED_SERVICE_QNAME.equals(name)) { return new ManagedServiceAssertion(data, assertionParameters); } else if (ManagedClientAssertion.MANAGED_CLIENT_QNAME.equals(name)) { return new ManagedClientAssertion(data, assertionParameters); } else { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } }
Example #16
Source File: PolicyModelTranslator.java From hottub with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertionParameter(final ModelNode parameterNode) throws AssertionCreationException, PolicyException { if (parameterNode.getType() != ModelNode.Type.ASSERTION_PARAMETER_NODE) { throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0065_INCONSISTENCY_IN_POLICY_SOURCE_MODEL(parameterNode.getType()))); } List<PolicyAssertion> childParameters = null; if (parameterNode.hasChildren()) { childParameters = new ArrayList<PolicyAssertion>(parameterNode.childrenSize()); for (ModelNode childParameterNode : parameterNode) { childParameters.add(createPolicyAssertionParameter(childParameterNode)); } } return createPolicyAssertion(parameterNode.getNodeData(), childParameters, null /* parameters do not have any nested alternatives */); }
Example #17
Source File: PolicyModelTranslator.java From hottub with GNU General Public License v2.0 | 5 votes |
private List<PolicyAssertion> normalizeRawAssertion(final RawAssertion assertion) throws AssertionCreationException, PolicyException { List<PolicyAssertion> parameters; if (assertion.parameters.isEmpty()) { parameters = null; } else { parameters = new ArrayList<PolicyAssertion>(assertion.parameters.size()); for (ModelNode parameterNode : assertion.parameters) { parameters.add(createPolicyAssertionParameter(parameterNode)); } } final List<AssertionSet> nestedAlternatives = new LinkedList<AssertionSet>(); if (assertion.nestedAlternatives != null && !assertion.nestedAlternatives.isEmpty()) { final Queue<RawAlternative> nestedAlternativeQueue = new LinkedList<RawAlternative>(assertion.nestedAlternatives); RawAlternative rawAlternative; while((rawAlternative = nestedAlternativeQueue.poll()) != null) { nestedAlternatives.addAll(normalizeRawAlternative(rawAlternative)); } // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations } final List<PolicyAssertion> assertionOptions = new LinkedList<PolicyAssertion>(); final boolean nestedAlternativesAvailable = !nestedAlternatives.isEmpty(); if (nestedAlternativesAvailable) { for (AssertionSet nestedAlternative : nestedAlternatives) { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, nestedAlternative)); } } else { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, null)); } return assertionOptions; }
Example #18
Source File: PolicyModelTranslator.java From hottub with GNU General Public License v2.0 | 5 votes |
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException { final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>(); final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>(); if (!alternative.nestedAssertions.isEmpty()) { final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions); RawAssertion rawAssertion; while((rawAssertion = nestedAssertionsQueue.poll()) != null) { final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion); // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations if (normalized.size() == 1) { normalizedContentBase.addAll(normalized); } else { normalizedContentOptions.add(normalized); } } } final List<AssertionSet> options = new LinkedList<AssertionSet>(); if (normalizedContentOptions.isEmpty()) { // we do not have any options to combine => returning this assertion options.add(AssertionSet.createAssertionSet(normalizedContentBase)); } else { // we have some options to combine => creating assertion options based on content combinations final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true); for (Collection<PolicyAssertion> contentOption : contentCombinations) { options.add(AssertionSet.createAssertionSet(contentOption)); } } return options; }
Example #19
Source File: ManagementAssertion.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Create a new ManagementAssertion instance. * * @param name The fully qualified name of the server or client assertion. Must * not be null. * @param data The assertion data. Must not be null. * @param assertionParameters Parameters of the assertion. May be null. * @throws AssertionCreationException Thrown if the creation of the assertion failed. */ protected ManagementAssertion(final QName name, AssertionData data, Collection<PolicyAssertion> assertionParameters) throws AssertionCreationException { super(data, assertionParameters); if (!name.equals(data.getName())) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1002_EXPECTED_MANAGEMENT_ASSERTION(name))); } if (isManagementEnabled() && !data.containsAttribute(ID_ATTRIBUTE_QNAME)) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1003_MANAGEMENT_ASSERTION_MISSING_ID(name))); } }
Example #20
Source File: ManagementAssertionCreator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException { final QName name = data.getName(); if (ManagedServiceAssertion.MANAGED_SERVICE_QNAME.equals(name)) { return new ManagedServiceAssertion(data, assertionParameters); } else if (ManagedClientAssertion.MANAGED_CLIENT_QNAME.equals(name)) { return new ManagedClientAssertion(data, assertionParameters); } else { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } }
Example #21
Source File: PolicyModelTranslator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertion(final AssertionData data, final Collection<PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) throws AssertionCreationException { final String assertionNamespace = data.getName().getNamespaceURI(); final PolicyAssertionCreator domainSpecificPAC = assertionCreators.get(assertionNamespace); if (domainSpecificPAC == null) { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } else { return domainSpecificPAC.createAssertion(data, assertionParameters, nestedAlternative, defaultCreator); } }
Example #22
Source File: PolicyModelTranslator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertionParameter(final ModelNode parameterNode) throws AssertionCreationException, PolicyException { if (parameterNode.getType() != ModelNode.Type.ASSERTION_PARAMETER_NODE) { throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0065_INCONSISTENCY_IN_POLICY_SOURCE_MODEL(parameterNode.getType()))); } List<PolicyAssertion> childParameters = null; if (parameterNode.hasChildren()) { childParameters = new ArrayList<PolicyAssertion>(parameterNode.childrenSize()); for (ModelNode childParameterNode : parameterNode) { childParameters.add(createPolicyAssertionParameter(childParameterNode)); } } return createPolicyAssertion(parameterNode.getNodeData(), childParameters, null /* parameters do not have any nested alternatives */); }
Example #23
Source File: PolicyModelTranslator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private List<PolicyAssertion> normalizeRawAssertion(final RawAssertion assertion) throws AssertionCreationException, PolicyException { List<PolicyAssertion> parameters; if (assertion.parameters.isEmpty()) { parameters = null; } else { parameters = new ArrayList<PolicyAssertion>(assertion.parameters.size()); for (ModelNode parameterNode : assertion.parameters) { parameters.add(createPolicyAssertionParameter(parameterNode)); } } final List<AssertionSet> nestedAlternatives = new LinkedList<AssertionSet>(); if (assertion.nestedAlternatives != null && !assertion.nestedAlternatives.isEmpty()) { final Queue<RawAlternative> nestedAlternativeQueue = new LinkedList<RawAlternative>(assertion.nestedAlternatives); RawAlternative rawAlternative; while((rawAlternative = nestedAlternativeQueue.poll()) != null) { nestedAlternatives.addAll(normalizeRawAlternative(rawAlternative)); } // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations } final List<PolicyAssertion> assertionOptions = new LinkedList<PolicyAssertion>(); final boolean nestedAlternativesAvailable = !nestedAlternatives.isEmpty(); if (nestedAlternativesAvailable) { for (AssertionSet nestedAlternative : nestedAlternatives) { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, nestedAlternative)); } } else { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, null)); } return assertionOptions; }
Example #24
Source File: PolicyModelTranslator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException { final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>(); final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>(); if (!alternative.nestedAssertions.isEmpty()) { final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions); RawAssertion rawAssertion; while((rawAssertion = nestedAssertionsQueue.poll()) != null) { final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion); // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations if (normalized.size() == 1) { normalizedContentBase.addAll(normalized); } else { normalizedContentOptions.add(normalized); } } } final List<AssertionSet> options = new LinkedList<AssertionSet>(); if (normalizedContentOptions.isEmpty()) { // we do not have any options to combine => returning this assertion options.add(AssertionSet.createAssertionSet(normalizedContentBase)); } else { // we have some options to combine => creating assertion options based on content combinations final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true); for (Collection<PolicyAssertion> contentOption : contentCombinations) { options.add(AssertionSet.createAssertionSet(contentOption)); } } return options; }
Example #25
Source File: ManagementAssertion.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Create a new ManagementAssertion instance. * * @param name The fully qualified name of the server or client assertion. Must * not be null. * @param data The assertion data. Must not be null. * @param assertionParameters Parameters of the assertion. May be null. * @throws AssertionCreationException Thrown if the creation of the assertion failed. */ protected ManagementAssertion(final QName name, AssertionData data, Collection<PolicyAssertion> assertionParameters) throws AssertionCreationException { super(data, assertionParameters); if (!name.equals(data.getName())) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1002_EXPECTED_MANAGEMENT_ASSERTION(name))); } if (isManagementEnabled() && !data.containsAttribute(ID_ATTRIBUTE_QNAME)) { throw LOGGER.logSevereException(new AssertionCreationException(data, ManagementMessages.WSM_1003_MANAGEMENT_ASSERTION_MISSING_ID(name))); } }
Example #26
Source File: ManagementAssertionCreator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException { final QName name = data.getName(); if (ManagedServiceAssertion.MANAGED_SERVICE_QNAME.equals(name)) { return new ManagedServiceAssertion(data, assertionParameters); } else if (ManagedClientAssertion.MANAGED_CLIENT_QNAME.equals(name)) { return new ManagedClientAssertion(data, assertionParameters); } else { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } }
Example #27
Source File: PolicyModelTranslator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertion(final AssertionData data, final Collection<PolicyAssertion> assertionParameters, final AssertionSet nestedAlternative) throws AssertionCreationException { final String assertionNamespace = data.getName().getNamespaceURI(); final PolicyAssertionCreator domainSpecificPAC = assertionCreators.get(assertionNamespace); if (domainSpecificPAC == null) { return defaultCreator.createAssertion(data, assertionParameters, nestedAlternative, null); } else { return domainSpecificPAC.createAssertion(data, assertionParameters, nestedAlternative, defaultCreator); } }
Example #28
Source File: PolicyModelTranslator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private PolicyAssertion createPolicyAssertionParameter(final ModelNode parameterNode) throws AssertionCreationException, PolicyException { if (parameterNode.getType() != ModelNode.Type.ASSERTION_PARAMETER_NODE) { throw LOGGER.logSevereException(new PolicyException(LocalizationMessages.WSP_0065_INCONSISTENCY_IN_POLICY_SOURCE_MODEL(parameterNode.getType()))); } List<PolicyAssertion> childParameters = null; if (parameterNode.hasChildren()) { childParameters = new ArrayList<PolicyAssertion>(parameterNode.childrenSize()); for (ModelNode childParameterNode : parameterNode) { childParameters.add(createPolicyAssertionParameter(childParameterNode)); } } return createPolicyAssertion(parameterNode.getNodeData(), childParameters, null /* parameters do not have any nested alternatives */); }
Example #29
Source File: PolicyModelTranslator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private List<PolicyAssertion> normalizeRawAssertion(final RawAssertion assertion) throws AssertionCreationException, PolicyException { List<PolicyAssertion> parameters; if (assertion.parameters.isEmpty()) { parameters = null; } else { parameters = new ArrayList<PolicyAssertion>(assertion.parameters.size()); for (ModelNode parameterNode : assertion.parameters) { parameters.add(createPolicyAssertionParameter(parameterNode)); } } final List<AssertionSet> nestedAlternatives = new LinkedList<AssertionSet>(); if (assertion.nestedAlternatives != null && !assertion.nestedAlternatives.isEmpty()) { final Queue<RawAlternative> nestedAlternativeQueue = new LinkedList<RawAlternative>(assertion.nestedAlternatives); RawAlternative rawAlternative; while((rawAlternative = nestedAlternativeQueue.poll()) != null) { nestedAlternatives.addAll(normalizeRawAlternative(rawAlternative)); } // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations } final List<PolicyAssertion> assertionOptions = new LinkedList<PolicyAssertion>(); final boolean nestedAlternativesAvailable = !nestedAlternatives.isEmpty(); if (nestedAlternativesAvailable) { for (AssertionSet nestedAlternative : nestedAlternatives) { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, nestedAlternative)); } } else { assertionOptions.add(createPolicyAssertion(assertion.originalNode.getNodeData(), parameters, null)); } return assertionOptions; }
Example #30
Source File: PolicyModelTranslator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private List<AssertionSet> normalizeRawAlternative(final RawAlternative alternative) throws AssertionCreationException, PolicyException { final List<PolicyAssertion> normalizedContentBase = new LinkedList<PolicyAssertion>(); final Collection<List<PolicyAssertion>> normalizedContentOptions = new LinkedList<List<PolicyAssertion>>(); if (!alternative.nestedAssertions.isEmpty()) { final Queue<RawAssertion> nestedAssertionsQueue = new LinkedList<RawAssertion>(alternative.nestedAssertions); RawAssertion rawAssertion; while((rawAssertion = nestedAssertionsQueue.poll()) != null) { final List<PolicyAssertion> normalized = normalizeRawAssertion(rawAssertion); // if there is only a single result, we can add it direclty to the content base collection // more elements in the result indicate that we will have to create combinations if (normalized.size() == 1) { normalizedContentBase.addAll(normalized); } else { normalizedContentOptions.add(normalized); } } } final List<AssertionSet> options = new LinkedList<AssertionSet>(); if (normalizedContentOptions.isEmpty()) { // we do not have any options to combine => returning this assertion options.add(AssertionSet.createAssertionSet(normalizedContentBase)); } else { // we have some options to combine => creating assertion options based on content combinations final Collection<Collection<PolicyAssertion>> contentCombinations = PolicyUtils.Collections.combine(normalizedContentBase, normalizedContentOptions, true); for (Collection<PolicyAssertion> contentOption : contentCombinations) { options.add(AssertionSet.createAssertionSet(contentOption)); } } return options; }