|
||||||||||
| 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.HeaderWrapper
public class HeaderWrapper
| Constructor Summary | |
|---|---|
HeaderWrapper(SecurityElement se)
|
|
HeaderWrapper(SecurityHeader sh)
Creates a new instance of HeaderWrapper |
|
| 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. |
|
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(Unmarshaller unmarshaller)
Reads the header as a JAXB object by using the given unmarshaller. |
|
|
readAsJAXB(XMLBridge<T> bridge)
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 HeaderWrapper(SecurityHeader sh)
public HeaderWrapper(SecurityElement se)
| Method Detail |
|---|
public boolean isIgnorable(SOAPVersion soapVersion,
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.
public String getRole(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 Headerpublic String getNamespaceURI()
getNamespaceURI in interface Headerpublic String getLocalPart()
getLocalPart in interface Header
public String getAttribute(String nsUri,
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.public String getAttribute(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)
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
public <T> T readAsJAXB(XMLBridge<T> bridge)
throws JAXBException
Header
readAsJAXB in interface HeaderJAXBException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||