|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.ws.security.opt.impl.message.Header
public class Header
Header represents any Header element that has its contents signed. This implementation can be used for encryption too.
| Constructor Summary | |
|---|---|
Header(Header header,
SecurityHeaderElement she)
|
|
| Method Summary | ||
|---|---|---|
String |
getAttribute(QName name)
Gets the attribute value on the header element. |
|
String |
getAttribute(String nsUri,
String localName)
Gets the attribute value on the header element. |
|
String |
getLocalPart()
Gets the local name of this header element. |
|
String |
getNamespaceURI()
Gets the namespace URI of this header element. |
|
String |
getRole(SOAPVersion soapVersion)
Gets the value of the soap:role attribute (or soap:actor for SOAP 1.1). |
|
String |
getStringContent()
Used to obtain value XYZ from a header that looks like "<header>XYZ</header>". |
|
boolean |
isIgnorable(SOAPVersion soapVersion,
Set<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 void |
parse()
|
|
WSEndpointReference |
readAsEPR(AddressingVersion expected)
Reads this header as an WSEndpointReference. |
|
|
readAsJAXB(Bridge<T> bridge)
Reads the header as a JAXB object by using the given unmarshaller. |
|
|
readAsJAXB(Bridge<T> bridge,
BridgeContext context)
Deprecated. Use readAsJAXB(Bridge). To be removed after JavaOne. |
|
|
readAsJAXB(Unmarshaller unmarshaller)
Reads the header as a JAXB object by using the given unmarshaller. |
|
|
readAsJAXB(XMLBridge<T> arg0)
Reads the header as a data-bond object |
|
XMLStreamReader |
readHeader()
Reads the header as a XMLStreamReader. |
|
void |
writeTo(ContentHandler contentHandler,
ErrorHandler errorHandler)
Writes out the header as SAX events. |
|
void |
writeTo(SOAPMessage saaj)
Writes out the header to the given SOAPMessage. |
|
void |
writeTo(XMLStreamWriter w)
Writes out the header. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Header(Header header,
SecurityHeaderElement she)
header - represents the Header element whose content is either signed or encryptedshe - represents a SecurityHeaderElement wrapped over the content of header.| Method Detail |
|---|
public boolean isIgnorable(@NotNull
SOAPVersion soapVersion,
@NotNull
Set<String> roles)
This method is used as a part of the
mustUnderstanx processing.
At the end of the processing, the JAX-WS identifies a list of Headers
that were not understood. This method is invoked on those Headers,
to verify that we don't need to report an error for it.
specifically, this method has to perform the following tasks:
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 HeadersoapVersion - 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 Headers 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 String getRole(@NotNull
SOAPVersion soapVersion)
If the attribute is omitted, the value defaults to SOAPVersion.implicitRole.
getRole in interface HeadersoapVersion - 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 Headers to avoid keeping it.
That's why this redundant parameter is passed in.
public boolean isRelay()
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@NotNull public String getNamespaceURI()
getNamespaceURI in interface Header@NotNull public String getLocalPart()
getLocalPart in interface Header
@Nullable
public String getAttribute(@NotNull
String nsUri,
@NotNull
String localName)
getAttribute in interface HeadernsUri - The namespace URI of the attribute. Can be empty.localName - The local name of the attribute.
Header implementation
doesn't have to do anything.
@Nullable
public String getAttribute(@NotNull
QName name)
This is a convenience method that calls into getAttribute(String, String)
getAttribute in interface Headername - Never null.getAttribute(String, String)
public XMLStreamReader readHeader()
throws XMLStreamException
XMLStreamReader.
The returned parser points at the start element of this header.
(IOW, XMLStreamReader.getEventType() would return
XMLStreamConstants.START_ELEMENT.
For some Header implementations, this operation
is a non-trivial operation. Therefore, use of this method
is discouraged unless the caller is interested in reading
the whole header.
Similarly, if the caller wants to use this method only to do
the API conversion (such as simply firing SAX events from
XMLStreamReader), then the JAX-WS team requests
that you talk to us.
Messages that come from tranport usually provides
a reasonably efficient implementation of this method.
readHeader in interface HeaderXMLStreamException
public <T> T readAsJAXB(Unmarshaller unmarshaller)
throws JAXBException
readAsJAXB in interface HeaderJAXBException
public <T> T readAsJAXB(Bridge<T> bridge,
BridgeContext context)
throws JAXBException
readAsJAXB(Bridge). To be removed after JavaOne.
JAXBException
public <T> T readAsJAXB(Bridge<T> bridge)
throws JAXBException
readAsJAXB in interface HeaderJAXBException
public void writeTo(XMLStreamWriter w)
throws XMLStreamException
writeTo in interface HeaderXMLStreamException - if the operation fails for some reason. This leaves the
writer to an undefined state.
public void writeTo(SOAPMessage saaj)
throws SOAPException
Sometimes a Message needs to produce itself
as SOAPMessage, in which case each header needs
to turn itself into a header.
writeTo in interface HeaderSOAPException - if the operation fails for some reason. This leaves the
writer to an undefined state.
public void writeTo(ContentHandler contentHandler,
ErrorHandler errorHandler)
throws SAXException
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.
writeTo in interface HeadercontentHandler - The ContentHandler that receives SAX events.errorHandler - The ErrorHandler that receives parsing errors.
SAXExceptionpublic String getStringContent()
Header
getStringContent in interface Header
@NotNull
public WSEndpointReference readAsEPR(AddressingVersion expected)
throws XMLStreamException
HeaderWSEndpointReference.
readAsEPR in interface Headerexpected - 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.
XMLStreamException
protected void parse()
throws XMLStreamException
XMLStreamException
public <T> T readAsJAXB(XMLBridge<T> arg0)
throws JAXBException
Header
readAsJAXB in interface HeaderJAXBException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||