com.sun.xml.internal.ws.policy.subject.WsdlBindingSubject Java Examples

The following examples show how to use com.sun.xml.internal.ws.policy.subject.WsdlBindingSubject. 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: MtomPolicyMapConfigurator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #2
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #3
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #4
Source File: MtomPolicyMapConfigurator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #5
Source File: MtomPolicyMapConfigurator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #6
Source File: MtomPolicyMapConfigurator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #7
Source File: MtomPolicyMapConfigurator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #8
Source File: MtomPolicyMapConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generates an MTOM policy if MTOM is enabled.
 *
 * <ol>
 * <li>If MTOM is enabled
 * <ol>
 * <li>If MTOM policy does not already exist, generate
 * <li>Otherwise do nothing
 * </ol>
 * <li>Otherwise, do nothing (that implies that we do not remove any MTOM policies if MTOM is disabled)
 * </ol>
 *
 */
public Collection<PolicySubject> update(PolicyMap policyMap, SEIModel model, WSBinding wsBinding) throws PolicyException {
    LOGGER.entering(policyMap, model, wsBinding);

    Collection<PolicySubject> subjects = new ArrayList<PolicySubject>();
    if (policyMap != null) {
        final MTOMFeature mtomFeature = wsBinding.getFeature(MTOMFeature.class);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("mtomFeature = " + mtomFeature);
        }
        if ((mtomFeature != null) && mtomFeature.isEnabled()) {
            final QName bindingName = model.getBoundPortTypeName();
            final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
            final Policy mtomPolicy = createMtomPolicy(bindingName);
            final PolicySubject mtomPolicySubject = new PolicySubject(wsdlSubject, mtomPolicy);
            subjects.add(mtomPolicySubject);
            if (LOGGER.isLoggable(Level.FINEST)) {
                LOGGER.fine("Added MTOM policy with ID \"" + mtomPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
            }
        }
    } // endif policy map not null

    LOGGER.exiting(subjects);
    return subjects;
}
 
Example #9
Source File: AddressingPolicyMapConfigurator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #10
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #11
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #12
Source File: AddressingPolicyMapConfigurator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #13
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #14
Source File: PolicyWSDLGeneratorExtension.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #15
Source File: PolicyWSDLGeneratorExtension.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #16
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #17
Source File: AddressingPolicyMapConfigurator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #18
Source File: AddressingPolicyMapConfigurator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #19
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #20
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #21
Source File: AddressingPolicyMapConfigurator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #22
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #23
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #24
Source File: AddressingPolicyMapConfigurator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #25
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #26
Source File: PolicyWSDLGeneratorExtension.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #27
Source File: AddressingPolicyMapConfigurator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}
 
Example #28
Source File: PolicyWSDLGeneratorExtension.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void selectAndProcessBindingSubject(final TypedXmlWriter xmlWriter, final Class clazz, final ScopeType scopeType, final QName bindingName) {
    LOGGER.entering(xmlWriter, clazz, scopeType, bindingName);
    if ((subjects != null) && (bindingName != null)) {
        for (PolicySubject subject : subjects) {
            if (subject.getSubject() instanceof WsdlBindingSubject) {
                final WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) subject.getSubject();
                if (bindingName.equals(wsdlSubject.getName())) {
                    writePolicyOrReferenceIt(subject, xmlWriter);
                }
            }
        }
    }
    selectAndProcessSubject(xmlWriter, clazz, scopeType, bindingName);
    LOGGER.exiting();
}
 
Example #29
Source File: PolicyWSDLGeneratorExtension.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void addBindingOperationFaultExtension(final TypedXmlWriter writer, final JavaMethod method, final CheckedException exception) {
    LOGGER.entering(writer, method, exception);
    if (subjects != null) {
        for (PolicySubject subject : subjects) { // iterate over all subjects in policy map
            if (this.policyMap.isFaultMessageSubject(subject)) {
                final Object concreteSubject = subject.getSubject();
                if (concreteSubject != null) {
                    final String exceptionName = exception == null ? null : exception.getMessageName();
                    if (exceptionName == null) { // no name provided to check
                        writePolicyOrReferenceIt(subject, writer);
                    }
                    if (WSDLBoundFaultContainer.class.isInstance(concreteSubject)) { // is it our class?
                        WSDLBoundFaultContainer faultContainer = (WSDLBoundFaultContainer) concreteSubject;
                        WSDLBoundFault fault = faultContainer.getBoundFault();
                        WSDLBoundOperation operation = faultContainer.getBoundOperation();
                        if (exceptionName.equals(fault.getName()) &&
                                operation.getName().getLocalPart().equals(method.getOperationName())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                    else if (WsdlBindingSubject.class.isInstance(concreteSubject)) {
                        WsdlBindingSubject wsdlSubject = (WsdlBindingSubject) concreteSubject;
                        if ((wsdlSubject.getMessageType() == WsdlBindingSubject.WsdlMessageType.FAULT) &&
                            exception.getOwner().getTargetNamespace().equals(wsdlSubject.getName().getNamespaceURI()) &&
                            exceptionName.equals(wsdlSubject.getName().getLocalPart())) {
                            writePolicyOrReferenceIt(subject, writer);
                        }
                    }
                }
            }
        }
    }
    LOGGER.exiting();
}
 
Example #30
Source File: AddressingPolicyMapConfigurator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void addWsamAddressing(Collection<PolicySubject> subjects, PolicyMap policyMap, SEIModel model, AddressingFeature addressingFeature)
        throws PolicyException {
    final QName bindingName = model.getBoundPortTypeName();
    final WsdlBindingSubject wsdlSubject = WsdlBindingSubject.createBindingSubject(bindingName);
    final Policy addressingPolicy = createWsamAddressingPolicy(bindingName, addressingFeature);
    final PolicySubject addressingPolicySubject = new PolicySubject(wsdlSubject, addressingPolicy);
    subjects.add(addressingPolicySubject);
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Added addressing policy with ID \"" + addressingPolicy.getIdOrName() + "\" to binding element \"" + bindingName + "\"");
    }
}