|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axis2.jaxws.message.impl.XMLPartBase
public abstract class XMLPartBase
XMLPartBase class for an XMLPart An XMLPart is an abstraction of the xml portion of the message. The actual representation can be in one of three different forms: * An OM tree * A SAAJ SOAPEnvelope * An XMLSpine (an optimized representation of the message) The representation is stored in the private variable (content)
The representation changes as the Message flows through the JAX-WS framework. For example, here is a typical flow on the inbound case: a) Message is built from OM (representation: OM) b) Message flows into SOAP Handler chain (representation: OM->SOAPEnvelope) c) Message flows out of the SOAP Handler chain d) Message flows into the logical dispatch processing (representation: SOAPEnvelope->XMLSpine) The key to performance is the implementation of the transformations between OM, SAAJ SOAPEnvelope and XMLSpine. This base class defines all of the methods that are required on an XMLPart, the actual transformations are provided by the derived class. This division of work allows the derived class to concentrate on the optimization of the transformations. For example, the derived class may implement XMLSpine -> OM using OMObjectWrapperElement constructs...thus avoid expensive parsing. Here are the methods that the derived XMLPart should implement. OMElement _convertSE2OM(SOAPEnvelope se) OMElement _convertSpine2OM(XMLSpine spine) SOAPEnvelope _convertOM2SE(OMElement om) SOAPEnvelope _convertSpine2SE(XMLSpine spine) XMLSpine _convertOM2Spine(OMElement om) XMLSpine _convertSE2Spine(SOAPEnvelope se) XMLSpine _createSpine(Protocol protocol) NOTE: For XML/HTTP (REST), a SOAP 1.1. Envelope is built and the rest payload is placed in the body. This purposely mimics the Axis2 implementation.
XMLPart,
XMLPartImpl| Method Summary | |
|---|---|
protected abstract SOAPEnvelope |
_convertOM2SE(org.apache.axiom.om.OMElement om)
Convert OM tree into a SOAPEnvelope |
protected abstract org.apache.axis2.jaxws.message.impl.XMLSpine |
_convertOM2Spine(org.apache.axiom.om.OMElement om)
Convert OM into XMLSpine |
protected abstract org.apache.axiom.om.OMElement |
_convertSE2OM(SOAPEnvelope se)
Convert SOAPEnvelope into an OM tree |
protected abstract org.apache.axis2.jaxws.message.impl.XMLSpine |
_convertSE2Spine(SOAPEnvelope se)
Convert SOAPEnvelope into XMLSPine |
protected abstract org.apache.axiom.om.OMElement |
_convertSpine2OM(org.apache.axis2.jaxws.message.impl.XMLSpine spine)
Convert XMLSpine into an OM tree |
protected abstract SOAPEnvelope |
_convertSpine2SE(org.apache.axis2.jaxws.message.impl.XMLSpine spine)
Convert XMLSpine into a SOAPEnvelope |
protected static org.apache.axis2.jaxws.message.impl.XMLSpine |
_createSpine(Protocol protocol,
SOAPBinding.Style style,
int indirection,
org.apache.axiom.om.OMElement payload)
Create an empty, default spine for the specificed protocol |
void |
appendHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
appendHeaderBlock Append the block to the list of header blocks. |
void |
close()
Used primarily to ensure the parser is forwarded to the end so it can be closed. |
org.apache.axiom.om.OMElement |
getAsOMElement()
getAsOMElement Get the xml part as a read/write OM...note this returns an OM SOAPEnvelope for all protocols...even REST |
SOAPEnvelope |
getAsSOAPEnvelope()
getAsEnvelope Get the xml part as a read/write SOAPEnvelope |
Block |
getBodyBlock(int index,
java.lang.Object context,
BlockFactory blockFactory)
getBodyBlock Get the body block at the specificed index. |
Block |
getBodyBlock(java.lang.Object context,
BlockFactory blockFactory)
getBodyBlock Get the single Body Block. |
Block |
getHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory)
getHeaderBlock Get the firstheader block with the specified name. |
java.util.List<Block> |
getHeaderBlocks(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory,
org.apache.axiom.soap.RolePlayer rolePlayer)
getHeaderBlock Get the header blocks with the specified name The BlockFactory and object context are passed in to help create the proper kind of block. |
java.util.Set<QName> |
getHeaderQNames()
|
int |
getIndirection()
Get indirection. |
int |
getNumBodyBlocks()
getNumBodyBlocks Calling this method will cache the OM. |
int |
getNumHeaderBlocks()
getNumHeaderBlocks |
QName |
getOperationElement()
|
Message |
getParent()
getParent Get the Message object that this XMLPart is attached to, if it is attached to one at all. |
Protocol |
getProtocol()
Get the protocol for this Message (soap11, soap12, etc.) |
SOAPBinding.Style |
getStyle()
|
XMLFault |
getXMLFault()
If the XMLPart represents a fault, an XMLFault is returned which describes the fault in a protocol agnostic manner |
java.lang.String |
getXMLPartContentType()
The representation of the XMLPart may be in a number of different forms. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean consume)
Get the XMLStreamReader represented by this Message for the xml part |
boolean |
isConsumed()
isConsumed Return true if the part is consumed. |
boolean |
isFault()
Determines whether the XMLPart represents a Fault |
void |
outputTo(javax.xml.stream.XMLStreamWriter writer,
boolean consume)
Write out the Message |
void |
removeBodyBlock(int index)
removeBodyBlock Removes the indicated BodyBlock |
void |
removeHeaderBlock(java.lang.String namespace,
java.lang.String localPart)
removeHeaderBlock Removes all header blocks with this namespace/localpart |
void |
setBodyBlock(Block block)
setBodyBlock Set this as block as the single block for the message. |
void |
setBodyBlock(int index,
Block block)
setBodyBlock Set the block at the specified index Once set, the Message owns the block. |
void |
setHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
setHeaderBlock replaces the first existing header block with this new block. |
void |
setIndirection(int indirection)
Set indirection. |
void |
setOperationElement(QName operationQName)
Set the operation element qname. |
void |
setParent(Message p)
setParent Set the Message object that will hold this XMLPart |
void |
setStyle(SOAPBinding.Style style)
Set the Style. |
void |
setXMLFault(XMLFault xmlFault)
Change the XMLPart so that it represents the fault described by XMLFault |
java.lang.String |
traceString(java.lang.String indent)
Get a traceString...the trace string dumps the contents of the Block without forcing an underlying ill-performant transformation of the message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public org.apache.axiom.om.OMElement getAsOMElement()
throws WebServiceException
XMLPart
getAsOMElement in interface XMLPartWebServiceException
public SOAPEnvelope getAsSOAPEnvelope()
throws WebServiceException
XMLPart
getAsSOAPEnvelope in interface XMLPartWebServiceExceptionpublic Protocol getProtocol()
XMLPart
getProtocol in interface XMLPartpublic SOAPBinding.Style getStyle()
getStyle in interface XMLPartpublic int getIndirection()
XMLPart
getIndirection in interface XMLPart
public void setStyle(SOAPBinding.Style style)
throws WebServiceException
XMLPart
setStyle in interface XMLPartstyle - Style
WebServiceExceptionindirectionpublic void setIndirection(int indirection)
XMLPart
setIndirection in interface XMLPartindirection - (0 or 1)
public QName getOperationElement()
throws WebServiceException
getOperationElement in interface XMLPartWebServiceException
public void setOperationElement(QName operationQName)
throws WebServiceException
XMLPart
setOperationElement in interface XMLPartWebServiceExceptionpublic java.lang.String getXMLPartContentType()
XMLPart
getXMLPartContentType in interface XMLPart
public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean consume)
throws WebServiceException
XMLPart
getXMLStreamReader in interface XMLPartconsume - true if this is the last request on the Message
WebServiceException
public XMLFault getXMLFault()
throws WebServiceException
XMLPart
getXMLFault in interface XMLPartWebServiceExceptionXMLFault
public void setXMLFault(XMLFault xmlFault)
throws WebServiceException
XMLPart
setXMLFault in interface XMLPartWebServiceExceptionXMLFault
public boolean isFault()
throws WebServiceException
XMLPart
isFault in interface XMLPartWebServiceExceptionpublic boolean isConsumed()
XMLPart
isConsumed in interface XMLPart
public void outputTo(javax.xml.stream.XMLStreamWriter writer,
boolean consume)
throws javax.xml.stream.XMLStreamException,
WebServiceException
XMLPart
outputTo in interface XMLPartwriter - XMLStreamWriterconsume - true if this is the last request on the block.
WebServiceException
javax.xml.stream.XMLStreamExceptionpublic java.lang.String traceString(java.lang.String indent)
XMLPart
traceString in interface XMLPart
public Block getBodyBlock(int index,
java.lang.Object context,
BlockFactory blockFactory)
throws WebServiceException
XMLPart
getBodyBlock in interface XMLPartWebServiceExceptiongetBodyBlock
public Block getBodyBlock(java.lang.Object context,
BlockFactory blockFactory)
throws WebServiceException
XMLPart
getBodyBlock in interface XMLPartWebServiceException
public Block getHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory)
throws WebServiceException
XMLPart
getHeaderBlock in interface XMLPartWebServiceExceptionpublic java.util.Set<QName> getHeaderQNames()
getHeaderQNames in interface XMLPart
public java.util.List<Block> getHeaderBlocks(java.lang.String namespace,
java.lang.String localPart,
java.lang.Object context,
BlockFactory blockFactory,
org.apache.axiom.soap.RolePlayer rolePlayer)
throws WebServiceException
XMLPart
getHeaderBlocks in interface XMLPartnamespace - uri of headerlocalPart - local name of headercontext - context for blockFactoryblockFactory - kind of factory (i.e. JAXB)
WebServiceException
public int getNumBodyBlocks()
throws WebServiceException
XMLPart
getNumBodyBlocks in interface XMLPartWebServiceException
public int getNumHeaderBlocks()
throws WebServiceException
XMLPart
getNumHeaderBlocks in interface XMLPartWebServiceException
public void removeBodyBlock(int index)
throws WebServiceException
XMLPart
removeBodyBlock in interface XMLPartWebServiceException
public void removeHeaderBlock(java.lang.String namespace,
java.lang.String localPart)
throws WebServiceException
XMLPart
removeHeaderBlock in interface XMLPartWebServiceException
public void setBodyBlock(int index,
Block block)
throws WebServiceException
XMLPart
setBodyBlock in interface XMLPartWebServiceException
public void setBodyBlock(Block block)
throws WebServiceException
XMLPart
setBodyBlock in interface XMLPartWebServiceException
public void setHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
throws WebServiceException
XMLPart
setHeaderBlock in interface XMLPartWebServiceException
public void appendHeaderBlock(java.lang.String namespace,
java.lang.String localPart,
Block block)
throws WebServiceException
XMLPart
appendHeaderBlock in interface XMLPartWebServiceExceptionpublic Message getParent()
XMLPart
getParent in interface XMLPartpublic void setParent(Message p)
XMLPart
setParent in interface XMLPart
protected abstract org.apache.axiom.om.OMElement _convertSE2OM(SOAPEnvelope se)
throws WebServiceException
se - SOAPEnvelope
WebServiceException
protected abstract org.apache.axiom.om.OMElement _convertSpine2OM(org.apache.axis2.jaxws.message.impl.XMLSpine spine)
throws WebServiceException
spine - XMLSpine
WebServiceException
protected abstract SOAPEnvelope _convertOM2SE(org.apache.axiom.om.OMElement om)
throws WebServiceException
om -
WebServiceException
protected abstract SOAPEnvelope _convertSpine2SE(org.apache.axis2.jaxws.message.impl.XMLSpine spine)
throws WebServiceException
spine -
WebServiceException
protected abstract org.apache.axis2.jaxws.message.impl.XMLSpine _convertOM2Spine(org.apache.axiom.om.OMElement om)
throws WebServiceException
om -
WebServiceException
protected abstract org.apache.axis2.jaxws.message.impl.XMLSpine _convertSE2Spine(SOAPEnvelope se)
throws WebServiceException
SOAPEnvelope -
WebServiceException
protected static org.apache.axis2.jaxws.message.impl.XMLSpine _createSpine(Protocol protocol,
SOAPBinding.Style style,
int indirection,
org.apache.axiom.om.OMElement payload)
throws WebServiceException
protocol -
WebServiceExceptionpublic void close()
XMLPart
close in interface XMLPart
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||