com.sun.xml.ws.rm.runtime
Class PacketAdapter

java.lang.Object
  extended by com.sun.xml.ws.rm.runtime.PacketAdapter

public abstract class PacketAdapter
extends java.lang.Object


Method Summary
abstract  void appendAckRequestedHeader(java.lang.String sequenceId)
          TODO javadoc
 void appendHeader(java.lang.Object jaxbHeaderContent)
          Utility method which creates a RM Header with the specified JAXB bean content and adds it to the message stored in the underlying packet.
abstract  void appendSequenceAcknowledgementHeader(Sequence sequence)
          TODO javadoc
abstract  void appendSequenceHeader(java.lang.String sequenceId, long messageNumber)
          TODO javadoc
 void checkMessageReadyState()
          Checks internal state of this PacketAdapter instance whether it is safe to perform message read or update operations.
 void checkPacketReadyState()
          Checks internal state of this PacketAdapter instance whether it is safe to perform packet read or update operations.
 PacketAdapter closeTransportAndReturnNull()
           
 void consume()
          TODO javadoc
 boolean containsMessage()
          TODO javadoc
 com.sun.xml.ws.api.message.Packet copyPacket(boolean copyMessage)
          TODO javadoc
 PacketAdapter createAckResponse(Sequence sequence, java.lang.String wsaAction)
          TODO javadoc
 PacketAdapter createEmptyServerResponse(java.lang.String wsaAction)
          TODO javadoc
 PacketAdapter createServerResponse(java.lang.Object jaxbElement, java.lang.String wsaAction)
          TODO javadoc
 void exposeSequenceDataToUser()
           
 java.lang.String getAckRequestedHeaderSequenceId()
          TODO javadoc
 java.lang.String getDestination()
          Provides information about value of the addressing To header of the message in the wrapped Packet instance.
static PacketAdapter getInstance(RmVersion rmVersion, com.sun.xml.ws.api.SOAPVersion soapVersion, com.sun.xml.ws.api.addressing.AddressingVersion addressingVersion, com.sun.xml.ws.api.message.Packet packet)
           
static PacketAdapter getInstance(RxConfiguration configuration, com.sun.xml.ws.api.message.Packet packet)
          Provides an instance of a packet adapter based on the configuration and attaches a provided packet instance to it.
 long getMessageNumber()
          TODO javadoc
 com.sun.xml.ws.api.message.Packet getPacket()
          TODO javadoc
 java.lang.String getSecurityContextTokenId()
          TODO javadoc
 java.lang.String getSequenceId()
          TODO javadoc
 Session getSession()
          TODO javadoc
 java.lang.String getWsaAction()
          Provides information about value of the addressing Action header of the message in the wrapped Packet instance.
 boolean hasSession()
          TODO javadoc
 boolean isFault()
          TODO javadoc
 boolean isProtocolMessage()
          TODO javadoc
 boolean isProtocolRequest()
          TODO javadoc
 boolean isProtocolResponse()
          TODO javadoc
 boolean isRmFault()
          TODO javadoc
 boolean isSecurityContextTokenIdValid(java.lang.String expectedSctId)
          Determines whether the security context token identifier used to secure the message wrapped in this adapter is the expected one
 PacketAdapter keepTransportBackChannelOpen()
          TODO javadoc
abstract  void processAcknowledgements(SequenceManager sequenceManager, java.lang.String expectedAckedSequenceId)
          TODO javadoc
<T> T
readHeaderAsUnderstood(java.lang.String name)
          Utility method which retrieves the RM header with the specified name from the underlying Message's {@link HeaderList) in the form of JAXB element and marks the header as understood.
 PacketAdapter setEmptyRequestMessage(java.lang.String wsaAction)
          Creates a new JAX-WS Message object that doesn't have any payload and sets it as the current packet content as a request message.
 PacketAdapter setEmptyResponseMessage(PacketAdapter requestAdapter, java.lang.String wsaAction)
          TODO javadoc
 PacketAdapter setRequestMessage(java.lang.Object jaxbElement, java.lang.String wsaAction)
          TODO javadoc Creates a new JAX-WS Message object backed by a JAXB bean using JAXB context of a configured RM version.
 void setSequenceData(java.lang.String sequenceId, long messageNumber)
          TODO javadoc
 void setSession(java.lang.String sessionId)
          TODO javadoc
<T> T
unmarshallMessage()
          Unmarshalls underlying JAXWS Message using JAXB context of a configured RM version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PacketAdapter getInstance(@NotNull
                                        RxConfiguration configuration,
                                        @NotNull
                                        com.sun.xml.ws.api.message.Packet packet)
Provides an instance of a packet adapter based on the configuration and attaches a provided packet instance to it.

Parameters:
configuration - configuration used to configure newly created packet
packet - Packet instance to be attached to the newly created packet adapter
Returns:
new empty PacketAdapter instance

getInstance

public static PacketAdapter getInstance(@NotNull
                                        RmVersion rmVersion,
                                        @NotNull
                                        com.sun.xml.ws.api.SOAPVersion soapVersion,
                                        @NotNull
                                        com.sun.xml.ws.api.addressing.AddressingVersion addressingVersion,
                                        @NotNull
                                        com.sun.xml.ws.api.message.Packet packet)

consume

public final void consume()
TODO javadoc


getPacket

public final com.sun.xml.ws.api.message.Packet getPacket()
TODO javadoc


copyPacket

public final com.sun.xml.ws.api.message.Packet copyPacket(boolean copyMessage)
TODO javadoc


createServerResponse

public final PacketAdapter createServerResponse(java.lang.Object jaxbElement,
                                                java.lang.String wsaAction)
TODO javadoc


createEmptyServerResponse

public final PacketAdapter createEmptyServerResponse(java.lang.String wsaAction)
TODO javadoc


createAckResponse

public final PacketAdapter createAckResponse(Sequence sequence,
                                             java.lang.String wsaAction)
                                      throws RxRuntimeException
TODO javadoc

Parameters:
requestAdapter -
inboundSequence -
wsaAction -
Returns:
Throws:
RxRuntimeException

closeTransportAndReturnNull

public final PacketAdapter closeTransportAndReturnNull()

appendHeader

public final void appendHeader(java.lang.Object jaxbHeaderContent)
                        throws java.lang.IllegalStateException
Utility method which creates a RM Header with the specified JAXB bean content and adds it to the message stored in the underlying packet.

Parameters:
jaxbHeaderContent - content of the newly created Header
Throws:
java.lang.IllegalStateException - in case of failed internal state check

appendSequenceHeader

public abstract void appendSequenceHeader(@NotNull
                                          java.lang.String sequenceId,
                                          long messageNumber)
                                   throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

appendAckRequestedHeader

public abstract void appendAckRequestedHeader(@NotNull
                                              java.lang.String sequenceId)
                                       throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

appendSequenceAcknowledgementHeader

public abstract void appendSequenceAcknowledgementHeader(@NotNull
                                                         Sequence sequence)
                                                  throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

keepTransportBackChannelOpen

public final PacketAdapter keepTransportBackChannelOpen()
TODO javadoc

Returns:

setEmptyRequestMessage

public final PacketAdapter setEmptyRequestMessage(java.lang.String wsaAction)
Creates a new JAX-WS Message object that doesn't have any payload and sets it as the current packet content as a request message.

Parameters:
wsaAction - WS-Addressing action header to set
Returns:
the updated PacketAdapter instance

setEmptyResponseMessage

public final PacketAdapter setEmptyResponseMessage(PacketAdapter requestAdapter,
                                                   java.lang.String wsaAction)
TODO javadoc

Parameters:
requestAdapter -
wsaAction -
Returns:

setRequestMessage

public final PacketAdapter setRequestMessage(java.lang.Object jaxbElement,
                                             java.lang.String wsaAction)
TODO javadoc Creates a new JAX-WS Message object backed by a JAXB bean using JAXB context of a configured RM version.

Parameters:
jaxbObject - The JAXB object that represents the payload. must not be null. This object must be bound to an element (which means it either is a JAXBElement or an instanceof a class with XmlRootElement).
wsaAction -
Returns:
the updated PacketAdapter instance

isProtocolMessage

public final boolean isProtocolMessage()
TODO javadoc

Returns:

isProtocolRequest

public final boolean isProtocolRequest()
TODO javadoc

Returns:

isProtocolResponse

public final boolean isProtocolResponse()
TODO javadoc

Returns:

isRmFault

public final boolean isRmFault()
TODO javadoc

Returns:

isFault

public final boolean isFault()
TODO javadoc

Returns:

containsMessage

public final boolean containsMessage()
TODO javadoc

Returns:

getWsaAction

public final java.lang.String getWsaAction()
Provides information about value of the addressing Action header of the message in the wrapped Packet instance.

Returns:
addressing Action header of the message in the wrapped Packet instance.

getDestination

public final java.lang.String getDestination()
Provides information about value of the addressing To header of the message in the wrapped Packet instance.

Returns:
addressing To header of the message in the wrapped Packet instance.

readHeaderAsUnderstood

public final <T> T readHeaderAsUnderstood(java.lang.String name)
                               throws RxRuntimeException
Utility method which retrieves the RM header with the specified name from the underlying Message's {@link HeaderList) in the form of JAXB element and marks the header as understood.

Parameters:
name - the name of the Header to find.
Returns:
RM header with the specified name in the form of JAXB element or null in case no such header was found
Throws:
RxRuntimeException

unmarshallMessage

public final <T> T unmarshallMessage()
                          throws RxRuntimeException
Unmarshalls underlying JAXWS Message using JAXB context of a configured RM version

Returns:
message content unmarshalled JAXB bean
Throws:
RxException - in case the message unmarshalling failed
RxRuntimeException

getSequenceId

public final java.lang.String getSequenceId()
                                     throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

getMessageNumber

public final long getMessageNumber()
                            throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

setSequenceData

public final void setSequenceData(java.lang.String sequenceId,
                                  long messageNumber)
TODO javadoc


getAckRequestedHeaderSequenceId

public final java.lang.String getAckRequestedHeaderSequenceId()
                                                       throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

processAcknowledgements

public abstract void processAcknowledgements(SequenceManager sequenceManager,
                                             java.lang.String expectedAckedSequenceId)
                                      throws RxRuntimeException
TODO javadoc

Throws:
RxRuntimeException

getSession

public Session getSession()
TODO javadoc


hasSession

public boolean hasSession()
TODO javadoc


setSession

public void setSession(java.lang.String sessionId)
TODO javadoc


exposeSequenceDataToUser

public void exposeSequenceDataToUser()

getSecurityContextTokenId

public final java.lang.String getSecurityContextTokenId()
TODO javadoc


checkMessageReadyState

public final void checkMessageReadyState()
                                  throws java.lang.IllegalStateException
Checks internal state of this PacketAdapter instance whether it is safe to perform message read or update operations. Success of this condition guarantees the success of #checkPacketUpdateState() operation.

Throws:
java.lang.IllegalStateException - if the check fails

checkPacketReadyState

public final void checkPacketReadyState()
                                 throws java.lang.IllegalStateException
Checks internal state of this PacketAdapter instance whether it is safe to perform packet read or update operations. Success of this condition does not guarantee the success of #checkMessageUpdateState() operation.

Throws:
java.lang.IllegalStateException - if the check fails

isSecurityContextTokenIdValid

public final boolean isSecurityContextTokenIdValid(java.lang.String expectedSctId)
Determines whether the security context token identifier used to secure the message wrapped in this adapter is the expected one

Parameters:
expectedStrId - expected security context token identifier