|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.ws.message.AbstractHeaderImpl
com.sun.xml.ws.message.stream.StreamHeader
public abstract class StreamHeader
Header
whose physical data representation is an XMLStreamBuffer.
Nested Class Summary | |
---|---|
protected static class |
StreamHeader.Attribute
Keep the information about an attribute on the header element. |
Field Summary | |
---|---|
protected boolean |
_isMustUnderstand
|
protected boolean |
_isRelay
|
protected java.lang.String |
_localName
|
protected com.sun.xml.stream.buffer.XMLStreamBuffer |
_mark
|
protected java.lang.String |
_namespaceURI
|
protected java.lang.String |
_role
Role or actor value. |
Fields inherited from class com.sun.xml.ws.message.AbstractHeaderImpl |
---|
EMPTY_ATTS |
Constructor Summary | |
---|---|
protected |
StreamHeader(javax.xml.stream.XMLStreamReader reader)
Creates a StreamHeader . |
protected |
StreamHeader(javax.xml.stream.XMLStreamReader reader,
com.sun.xml.stream.buffer.XMLStreamBuffer mark)
Creates a StreamHeader . |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String nsUri,
java.lang.String localName)
Gets the attribute value on the header element. |
java.lang.String |
getLocalPart()
Gets the local name of this header element. |
java.lang.String |
getNamespaceURI()
Gets the namespace URI of this header element. |
java.lang.String |
getRole(SOAPVersion soapVersion)
Gets the value of the soap:role attribute (or soap:actor for SOAP 1.1). |
boolean |
isIgnorable(SOAPVersion soapVersion,
java.util.Set<java.lang.String> roles)
Checks if this header is ignorable for us (IOW, make sure that this header has a problematic "mustUnderstand" header value that we have to reject.) |
boolean |
isRelay()
True if this header is to be relayed if not processed. |
protected abstract com.sun.istack.FinalArrayList<StreamHeader.Attribute> |
processHeaderAttributes(javax.xml.stream.XMLStreamReader reader)
|
WSEndpointReference |
readAsEPR(AddressingVersion expected)
Creates an EPR without copying infoset. |
javax.xml.stream.XMLStreamReader |
readHeader()
Reads the header as a XMLStreamReader |
void |
writeTo(org.xml.sax.ContentHandler contentHandler,
org.xml.sax.ErrorHandler errorHandler)
Writes out the header as SAX events. |
void |
writeTo(javax.xml.soap.SOAPMessage saaj)
Writes out the header to the given SOAPMessage. |
void |
writeTo(javax.xml.stream.XMLStreamWriter w)
Writes out the header as a fragment. |
Methods inherited from class com.sun.xml.ws.message.AbstractHeaderImpl |
---|
getAttribute, getStringContent, parseBool, readAsJAXB, readAsJAXB, readAsJAXB, readAsJAXB |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final com.sun.xml.stream.buffer.XMLStreamBuffer _mark
protected boolean _isMustUnderstand
@NotNull protected java.lang.String _role
protected boolean _isRelay
protected java.lang.String _localName
protected java.lang.String _namespaceURI
Constructor Detail |
---|
protected StreamHeader(javax.xml.stream.XMLStreamReader reader, com.sun.xml.stream.buffer.XMLStreamBuffer mark)
StreamHeader
.
reader
- The parser pointing at the start of the mark.
Technically this information is redundant,
but it achieves a better performance.mark
- The start of the buffered header content.protected StreamHeader(javax.xml.stream.XMLStreamReader reader) throws javax.xml.stream.XMLStreamException
StreamHeader
.
reader
- The parser that points to the start tag of the header.
By the end of this method, the parser will point at
the end tag of this element.
javax.xml.stream.XMLStreamException
Method Detail |
---|
public final boolean isIgnorable(@NotNull SOAPVersion soapVersion, @NotNull java.util.Set<java.lang.String> roles)
Header
This method is used as a part of the
mustUnderstanx processing.
At the end of the processing, the JAX-WS identifies a list of Header
s
that were not understood. This method is invoked on those Header
s,
to verify that we don't need to report an error for it.
specifically, this method has to perform the following tasks:
Header.getRole(SOAPVersion)
for how the values are defaulted.
Now, see if the roles
set contains the value.
If so, this method must return false (indicating that an error is in order.)
isIgnorable
in interface Header
isIgnorable
in class AbstractHeaderImpl
soapVersion
- The caller specifies the SOAP version that the pipeline is working against.
Often each Header
implementation already knows the SOAP version
anyway, but this allows some Header
s to avoid keeping it.
That's why this redundant parameter is passed in.roles
- The set of role values that the current JAX-WS pipeline is assuming.
Note that SOAP 1.1 and SOAP 1.2 use different strings for the same role,
and the caller is responsible for supplying a proper value depending on the
active SOAP version in use.
@NotNull public java.lang.String getRole(@NotNull SOAPVersion soapVersion)
Header
If the attribute is omitted, the value defaults to SOAPVersion.implicitRole
.
getRole
in interface Header
getRole
in class AbstractHeaderImpl
soapVersion
- The caller specifies the SOAP version that the pipeline is working against.
Often each Header
implementation already knows the SOAP version
anyway, but this allows some Header
s to avoid keeping it.
That's why this redundant parameter is passed in.
public boolean isRelay()
Header
IOW, this method returns true if there's @soap:relay='true' is present.
The implementation needs to check for both "true" and "1", but because attribute values are normalized, it doesn't have to consider " true", " 1 ", and so on.
isRelay
in interface Header
isRelay
in class AbstractHeaderImpl
@NotNull public java.lang.String getNamespaceURI()
Header
@NotNull public java.lang.String getLocalPart()
Header
public java.lang.String getAttribute(java.lang.String nsUri, java.lang.String localName)
Header
nsUri
- The namespace URI of the attribute. Can be empty.localName
- The local name of the attribute.
Header
implementation
doesn't have to do anything.public javax.xml.stream.XMLStreamReader readHeader() throws javax.xml.stream.XMLStreamException
XMLStreamReader
javax.xml.stream.XMLStreamException
public void writeTo(javax.xml.stream.XMLStreamWriter w) throws javax.xml.stream.XMLStreamException
Header
javax.xml.stream.XMLStreamException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public void writeTo(javax.xml.soap.SOAPMessage saaj) throws javax.xml.soap.SOAPException
Header
Sometimes a Message
needs to produce itself
as SOAPMessage
, in which case each header needs
to turn itself into a header.
javax.xml.soap.SOAPException
- if the operation fails for some reason. This leaves the
writer to an undefined state.public void writeTo(org.xml.sax.ContentHandler contentHandler, org.xml.sax.ErrorHandler errorHandler) throws org.xml.sax.SAXException
Header
Sometimes a Message
needs to produce SAX events,
and this method is necessary for headers to participate to it.
A header is responsible for producing the SAX events for its part, including startPrefixMapping and endPrefixMapping, but not startDocument/endDocument.
Note that SAX contract requires that any error that does NOT originate
from ContentHandler
(meaning any parsing error and etc) must
be first reported to ErrorHandler
. If the SAX event production
cannot be continued and the processing needs to abort, the code may
then throw the same SAXParseException
reported to ErrorHandler
.
contentHandler
- The ContentHandler
that receives SAX events.errorHandler
- The ErrorHandler
that receives parsing errors.
org.xml.sax.SAXException
@NotNull public WSEndpointReference readAsEPR(AddressingVersion expected) throws javax.xml.stream.XMLStreamException
Header.readAsEPR(AddressingVersion)
is invoked on.
readAsEPR
in interface Header
readAsEPR
in class AbstractHeaderImpl
expected
- The version of the addressing used to parse the EPR.
If the actual infoset and this doesn't agree, then
you'll get an WebServiceException
stating that fact.
javax.xml.stream.XMLStreamException
protected abstract com.sun.istack.FinalArrayList<StreamHeader.Attribute> processHeaderAttributes(javax.xml.stream.XMLStreamReader reader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |