Apache CXF API

org.apache.cxf.ws.rm
Class EncoderDecoder

java.lang.Object
  extended by org.apache.cxf.ws.rm.EncoderDecoder
Direct Known Subclasses:
EncoderDecoder10AImpl, EncoderDecoder10Impl, EncoderDecoder11Impl

public abstract class EncoderDecoder
extends Object

Base class for converting WS-ReliableMessaging structures to and from XML. Subclasses provide version-specific encoding and decoding.


Constructor Summary
EncoderDecoder()
           
 
Method Summary
protected  void addNamespaceDecl(Element element)
          Add WS-RM namespace declaration to element.
protected abstract  void buildHeaderFault(SequenceFault sf, Element header, Marshaller marshaller)
          Build a header fault, using the correct protocol variation.
 Element buildHeaderFault(SequenceFault sf, QName qname)
          Builds an element containing a WS-RM Fault.
 Element buildHeaders(RMProperties rmps, QName qname)
          Builds an element containing WS-RM headers.
protected abstract  void buildHeaders(SequenceType seq, Collection<SequenceAcknowledgement> acks, Collection<AckRequestedType> reqs, boolean last, Element header, Marshaller marshaller)
          Build all required headers, using the correct protocol variation.
abstract  CreateSequenceType convertReceivedCreateSequence(Object create)
          Convert a received CreateSequence message to internal form.
abstract  CreateSequenceResponseType convertReceivedCreateSequenceResponse(Object create)
          Convert a received CreateSequenceResponse message to internal form.
abstract  TerminateSequenceType convertReceivedTerminateSequence(Object term)
          Convert a received TerminateSequence message to internal form.
abstract  Object convertToSend(CreateSequenceResponseType create)
          Convert a CreateSequenceResponse message to the correct format for transmission.
abstract  Object convertToSend(CreateSequenceType create)
          Convert a CreateSequence message to the correct format for transmission.
abstract  Object convertToSend(TerminateSequenceType term)
          Convert a TerminateSequence message to the correct format for transmission.
abstract  AckRequestedType decodeAckRequestedType(Element elem)
          Unmarshals a AckRequestedType, converting it if necessary to the internal form.
abstract  SequenceAcknowledgement decodeSequenceAcknowledgement(Element elem)
          Unmarshals a SequenceAcknowledgement, converting it if necessary to the internal form.
abstract  SequenceType decodeSequenceType(Element elem)
          Unmarshals a SequenceType, converting it if necessary to the internal form.
abstract  CloseSequenceType decodeSequenceTypeCloseSequence(Element elem)
          Generates a CloseSequenceType if a SequenceType represents a last message state.
abstract  Element encodeIdentifier(Identifier id)
          Marshals an Identifier to the appropriate external form.
abstract  Element encodeSequenceAcknowledgement(SequenceAcknowledgement ack)
          Marshals a SequenceAcknowledgement to the appropriate external form.
abstract  RMConstants getConstants()
          Get the WS-ReliableMessaging constants used by this encoder/decoder.
protected abstract  JAXBContext getContext()
          Get context for JAXB marshalling/unmarshalling.
abstract  Class<?> getCreateSequenceResponseType()
          Get the class used for the CreateSequenceResponseType.
abstract  Class<?> getCreateSequenceType()
          Get the class used for the CreateSequenceType.
abstract  Class<?> getTerminateSequenceResponseType()
          Get the class used for the TerminateSequenceResponseType.
abstract  Class<?> getTerminateSequenceType()
          Get the class used for the TerminateSequenceType.
abstract  String getWSANamespace()
          Get the WS-Addressing namespace used by this encoder/decoder.
abstract  String getWSRMNamespace()
          Get the WS-ReliableMessaging namespace used by this encoder/decoder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncoderDecoder

public EncoderDecoder()
Method Detail

getContext

protected abstract JAXBContext getContext()
                                   throws JAXBException
Get context for JAXB marshalling/unmarshalling.

Returns:
context
Throws:
JAXBException

getWSRMNamespace

public abstract String getWSRMNamespace()
Get the WS-ReliableMessaging namespace used by this encoder/decoder.

Returns:
URI

getWSANamespace

public abstract String getWSANamespace()
Get the WS-Addressing namespace used by this encoder/decoder.

Returns:
URI

getConstants

public abstract RMConstants getConstants()
Get the WS-ReliableMessaging constants used by this encoder/decoder.

Returns:

getCreateSequenceType

public abstract Class<?> getCreateSequenceType()
Get the class used for the CreateSequenceType.

Returns:
class

getCreateSequenceResponseType

public abstract Class<?> getCreateSequenceResponseType()
Get the class used for the CreateSequenceResponseType.

Returns:
class

getTerminateSequenceType

public abstract Class<?> getTerminateSequenceType()
Get the class used for the TerminateSequenceType.

Returns:
class

getTerminateSequenceResponseType

public abstract Class<?> getTerminateSequenceResponseType()
Get the class used for the TerminateSequenceResponseType.

Returns:
class

buildHeaders

public Element buildHeaders(RMProperties rmps,
                            QName qname)
                     throws JAXBException
Builds an element containing WS-RM headers. This adds the appropriate WS-RM namespace declaration to the element, and then adds any WS-RM headers set in the supplied properties as child elements.

Parameters:
rmps -
qname - constructed element name
Returns:
element (null if none)
Throws:
JAXBException

addNamespaceDecl

protected void addNamespaceDecl(Element element)
Add WS-RM namespace declaration to element.

Parameters:
element -

buildHeaderFault

public Element buildHeaderFault(SequenceFault sf,
                                QName qname)
                         throws JAXBException
Builds an element containing a WS-RM Fault. This adds the appropriate WS-RM namespace declaration to the element, and then adds the Fault as a child element.

Parameters:
sf -
qname - constructed element name
Returns:
element
Throws:
JAXBException

buildHeaders

protected abstract void buildHeaders(SequenceType seq,
                                     Collection<SequenceAcknowledgement> acks,
                                     Collection<AckRequestedType> reqs,
                                     boolean last,
                                     Element header,
                                     Marshaller marshaller)
                              throws JAXBException
Build all required headers, using the correct protocol variation.

Parameters:
seq -
acks -
reqs -
last -
header -
marshaller -
Throws:
JAXBException

buildHeaderFault

protected abstract void buildHeaderFault(SequenceFault sf,
                                         Element header,
                                         Marshaller marshaller)
                                  throws JAXBException
Build a header fault, using the correct protocol variation.

Parameters:
sf -
header -
marshaller -
Throws:
JAXBException

encodeSequenceAcknowledgement

public abstract Element encodeSequenceAcknowledgement(SequenceAcknowledgement ack)
                                               throws JAXBException
Marshals a SequenceAcknowledgement to the appropriate external form.

Parameters:
ack -
Returns:
element
Throws:
JAXBException

encodeIdentifier

public abstract Element encodeIdentifier(Identifier id)
                                  throws JAXBException
Marshals an Identifier to the appropriate external form.

Parameters:
id -
Returns:
element
Throws:
JAXBException

decodeSequenceType

public abstract SequenceType decodeSequenceType(Element elem)
                                         throws JAXBException
Unmarshals a SequenceType, converting it if necessary to the internal form.

Parameters:
elem -
Returns:
Throws:
JAXBException

decodeSequenceTypeCloseSequence

public abstract CloseSequenceType decodeSequenceTypeCloseSequence(Element elem)
                                                           throws JAXBException
Generates a CloseSequenceType if a SequenceType represents a last message state.

Parameters:
elem -
Returns:
CloseSequenceType if last message state, else null
Throws:
JAXBException

decodeSequenceAcknowledgement

public abstract SequenceAcknowledgement decodeSequenceAcknowledgement(Element elem)
                                                               throws JAXBException
Unmarshals a SequenceAcknowledgement, converting it if necessary to the internal form.

Parameters:
elem -
Returns:
Throws:
JAXBException

decodeAckRequestedType

public abstract AckRequestedType decodeAckRequestedType(Element elem)
                                                 throws JAXBException
Unmarshals a AckRequestedType, converting it if necessary to the internal form.

Parameters:
elem -
Returns:
Throws:
JAXBException

convertToSend

public abstract Object convertToSend(CreateSequenceType create)
Convert a CreateSequence message to the correct format for transmission.

Parameters:
create -
Returns:
converted

convertToSend

public abstract Object convertToSend(CreateSequenceResponseType create)
Convert a CreateSequenceResponse message to the correct format for transmission.

Parameters:
create -
Returns:
converted

convertToSend

public abstract Object convertToSend(TerminateSequenceType term)
Convert a TerminateSequence message to the correct format for transmission.

Parameters:
term -
Returns:
converted

convertReceivedTerminateSequence

public abstract TerminateSequenceType convertReceivedTerminateSequence(Object term)
Convert a received TerminateSequence message to internal form.

Parameters:
term -
Returns:
converted

convertReceivedCreateSequence

public abstract CreateSequenceType convertReceivedCreateSequence(Object create)
Convert a received CreateSequence message to internal form.

Parameters:
create -
Returns:
converted

convertReceivedCreateSequenceResponse

public abstract CreateSequenceResponseType convertReceivedCreateSequenceResponse(Object create)
Convert a received CreateSequenceResponse message to internal form.

Parameters:
create -
Returns:
converted

Apache CXF API

Apache CXF