Java Code Examples for javax.xml.soap.SOAPHeaderElement#getMustUnderstand()

The following examples show how to use javax.xml.soap.SOAPHeaderElement#getMustUnderstand() . 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: SAAJMessageHeaders.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 2
Source File: SAAJMessageHeaders.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 3
Source File: SAAJMessageHeaders.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 4
Source File: SAAJMessageHeaders.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 5
Source File: SAAJMessageHeaders.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 6
Source File: SAAJMessageHeaders.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 7
Source File: SAAJMessageHeaders.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 8
Source File: SAAJMessageHeaders.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/** Set the initial understood/not understood state of the headers in this
 * object
 */
private void initHeaderUnderstanding() {
    SOAPHeader soapHeader = ensureSOAPHeader();
    if (soapHeader == null) {
        return;
    }

    Iterator allHeaders = soapHeader.examineAllHeaderElements();
    while(allHeaders.hasNext()) {
        SOAPHeaderElement nextHdrElem = (SOAPHeaderElement) allHeaders.next();
        if (nextHdrElem == null) {
            continue;
        }
        if (nextHdrElem.getMustUnderstand()) {
            notUnderstood(nextHdrElem.getElementQName());
        }
        //only headers explicitly marked as understood should be
        //in the understoodHeaders set, so don't add anything to
        //that set at the beginning
    }

}
 
Example 9
Source File: SAAJMessageHeaders.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 10
Source File: SAAJMessageHeaders.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 11
Source File: SAAJMessageHeaders.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 12
Source File: SAAJMessageHeaders.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 13
Source File: SAAJMessageHeaders.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 14
Source File: SAAJMessageHeaders.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 15
Source File: SAAJMessageHeaders.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}
 
Example 16
Source File: SAAJMessageHeaders.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public Set<QName> getNotUnderstoodHeaders(Set<String> roles,
        Set<QName> knownHeaders, WSBinding binding) {
    Set<QName> notUnderstoodHeaderNames = new HashSet<QName>();
    if (notUnderstoodCount == null) {
        return notUnderstoodHeaderNames;
    }
    for (QName headerName : notUnderstoodCount.keySet()) {
        int count = notUnderstoodCount.get(headerName);
        if (count <= 0) {
            continue;
        }
        SOAPHeaderElement hdrElem = find(headerName);
        if (!hdrElem.getMustUnderstand()) {
            continue;
        }
        SAAJHeader hdr = new SAAJHeader(hdrElem);
        //mustUnderstand attribute is true - but there may be
        //additional criteria
        boolean understood = false;
        if (roles != null) {
            understood = !roles.contains(hdr.getRole(soapVersion));
        }
        if (understood) {
            continue;
        }
        //if it must be understood see if it is understood by the binding
        //or is in knownheaders
        if (binding != null && binding instanceof SOAPBindingImpl) {
            understood = ((SOAPBindingImpl) binding).understandsHeader(headerName);
            if (!understood) {
                if (knownHeaders != null && knownHeaders.contains(headerName)) {
                    understood = true;
                }
            }
        }
        if (!understood) {
            notUnderstoodHeaderNames.add(headerName);
        }
    }
    return notUnderstoodHeaderNames;
}