|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.oracle.webservices.api.message.BasePropertySet
com.oracle.webservices.api.message.BaseDistributedPropertySet
com.sun.xml.ws.api.message.Packet
public final class Packet
Represents a container of a Message
.
Packet
?
A packet can be thought of as a frame/envelope/package that wraps
a Message
. A packet keeps track of optional metadata (properties)
about a Message
that doesn't go across the wire.
This roughly corresponds to MessageContext
in the JAX-WS API.
Usually a packet contains a Message
in it, but sometimes
(such as for a reply of an one-way operation), a packet may
float around without a Message
in it.
Information frequently used inside the JAX-WS RI
is stored in the strongly-typed fields. Other information is stored
in terms of a generic Map
(see
invocationProperties
.)
Some properties need to be retained between request and response,
some don't. For strongly typed fields, this characteristic is
statically known for each of them, and propagation happens accordingly.
For generic information stored in Map
, invocationProperties
stores per-invocation scope information (which carries over to
the response.)
This object is used as the backing store of MessageContext
, and
LogicalMessageContext
and SOAPMessageContext
will
be delegating to this object for storing/retrieving values.
Request context
is used to
seed the initial values of Packet
.
Some of those values go to strongly-typed fields, and others go to
invocationProperties
, as they need to be retained in the reply message.
Similarly, response context
is constructed from Packet
(or rather it's just a view of Packet
.)
by using properties from invocationProperties
,
modulo properties named explicitly in getHandlerScopePropertyNames(boolean)
.
IOW, properties added to invocationProperties
are exposed to the response context by default.
PropertySet.Property
annotation is to make it easy
for MessageContext
to export properties on this object,
but it probably needs some clean up.
Nested Class Summary | |
---|---|
static class |
Packet.State
|
static class |
Packet.Status
|
Nested classes/interfaces inherited from class com.oracle.webservices.api.message.BasePropertySet |
---|
com.oracle.webservices.api.message.BasePropertySet.Accessor, com.oracle.webservices.api.message.BasePropertySet.PropertyMap, com.oracle.webservices.api.message.BasePropertySet.PropertyMapEntry |
Nested classes/interfaces inherited from interface com.oracle.webservices.api.message.PropertySet |
---|
com.oracle.webservices.api.message.PropertySet.Property |
Field Summary | |
---|---|
java.lang.String |
acceptableMimeTypes
The list of MIME types that are acceptable to a receiver of an outbound message. |
Component |
component
The governing owner of this packet. |
ContentNegotiation |
contentNegotiation
The value of ContentNegotiation.PROPERTY
property. |
WSEndpoint |
endpoint
The governing WSEndpoint in which this message is floating. |
EndpointAddress |
endpointAddress
The endpoint address to which this message is sent to. |
java.lang.Boolean |
expectReply
A hint indicating that whether a transport should expect a reply back from the server. |
static java.lang.String |
HA_INFO
|
HandlerConfiguration |
handlerConfig
This property holds the snapshot of HandlerConfiguration at the time of invocation. |
static java.lang.String |
INBOUND_TRANSPORT_HEADERS
Inbound transport headers are captured in a transport neutral way. |
java.util.Map<java.lang.String,java.lang.Object> |
invocationProperties
Bag to capture properties that are available for the whole message invocation (namely on both requests and responses.) |
boolean |
isAdapterDeliversNonAnonymousResponse
Determines if the governing Adapter or Fiber.CompletionCallback
will handle delivering response messages targeted at non-anonymous endpoint
addresses. |
java.lang.Boolean |
isOneWay
Deprecated. |
java.lang.Boolean |
isSynchronousMEP
Indicates whether is invoking a synchronous pattern. |
java.lang.Boolean |
nonNullAsyncHandlerGiven
Indicates whether a non-null AsyncHandler was given at the point of making the request that created this packet. |
static java.lang.String |
OUTBOUND_TRANSPORT_HEADERS
Outbound transport headers are captured in a transport neutral way. |
boolean |
packetTakesPriorityOverRequestContext
During invocation of a client Stub or Dispatch a Packet is created then the Stub's RequestContext is copied into the Packet. |
BindingProvider |
proxy
If a message originates from a proxy stub that implements a port interface, this field is set to point to that object. |
java.lang.String |
soapAction
The value of the SOAPAction header associated with the message. |
TransportBackChannel |
transportBackChannel
Used only on the server side so that the transport can close the connection early. |
boolean |
wasTransportSecure
True if this message came from a transport (IOW inbound), and in paricular from a "secure" transport. |
WebServiceContextDelegate |
webServiceContextDelegate
When non-null, this object is consulted to implement WebServiceContext methods
exposed to the user application. |
Constructor Summary | |
---|---|
Packet()
Creates an empty Packet that doesn't have any Message . |
|
Packet(Message request)
Creates a Packet that wraps a given Message . |
Method Summary | |
---|---|
void |
addSatellite(java.lang.Class keyClass,
PropertySet satellite)
Deprecated. |
void |
addSatellite(PropertySet satellite)
Deprecated. |
java.util.Map<java.lang.String,java.lang.Object> |
asMapIncludingInvocationProperties()
|
void |
checkMtomAcceptable()
|
Packet |
copy(boolean copyMessage)
Creates a copy of this Packet . |
void |
copyPropertiesTo(Packet response)
Copy all properties from ( this ) packet into a input Packet |
void |
copySatelliteInto(DistributedPropertySet r)
Deprecated. |
Packet |
createClientResponse(Message msg)
Creates a response Packet from a request packet (this ). |
Packet |
createResponse(Message msg)
Deprecated. Use createClientResponse(Message) for client side and createServerResponse(Message, String) for server side response creation. |
Packet |
createServerResponse(Message responseMessage,
AddressingVersion addressingVersion,
SOAPVersion soapVersion,
java.lang.String action)
Creates a server-side response Packet from a request
packet (this ). |
Packet |
createServerResponse(Message responseMessage,
WSDLPort wsdlPort,
SEIModel seiModel,
WSBinding binding)
Creates a server-side response Packet from a request
packet (this ). |
java.util.Set<java.lang.String> |
getApplicationScopePropertyNames(boolean readOnly)
Deprecated. Use getHandlerScopePropertyNames(boolean) .
To be removed once Tango components are updated. |
javax.xml.soap.SOAPMessage |
getAsSOAPMessage()
Gets the SAAJ SOAPMessage representation of the SOAP message. |
WSBinding |
getBinding()
|
Codec |
getCodec()
|
java.lang.String |
getContentNegotiationString()
|
com.oracle.webservices.api.message.ContentType |
getContentType()
Gets the Content-type of this message. |
java.lang.String |
getEndPointAddressString()
Deprecated. The programatic acccess should be done via endpointAddress . This is for JAX-WS client applications
that access this property via BindingProvider.ENDPOINT_ADDRESS_PROPERTY . |
java.lang.Boolean |
getFastInfosetAcceptable(java.lang.String fiMimeType)
|
java.util.Set<java.lang.String> |
getHandlerScopePropertyNames(boolean readOnly)
Gets a Set that stores handler-scope properties. |
com.oracle.webservices.api.message.ContentType |
getInternalContentType()
|
Message |
getInternalMessage()
|
Message |
getMessage()
Gets the last Message set through setMessage(Message) . |
java.lang.Boolean |
getMtomAcceptable()
|
MTOMFeature |
getMtomFeature()
|
java.lang.Boolean |
getMtomRequest()
|
protected com.oracle.webservices.api.message.BasePropertySet.PropertyMap |
getPropertyMap()
Map representing the Fields and Methods annotated with PropertySet.Property . |
java.util.List<org.w3c.dom.Element> |
getReferenceParameters()
Gives a list of Reference Parameters in the Message |
javax.xml.soap.SOAPMessage |
getSOAPMessage()
Gets the SAAJ SOAPMessage representation of the SOAP message. |
Packet.State |
getState()
|
javax.xml.namespace.QName |
getWSDLOperation()
Returns the QName of the wsdl operation associated with this packet. |
WSDLOperationMapping |
getWSDLOperationMapping()
|
java.lang.Boolean |
isRequestReplyMEP()
|
TransportBackChannel |
keepTransportBackChannelOpen()
Keeps the transport back channel open (by seeting transportBackChannel to null.) |
Packet |
relateClientResponse(Packet response)
For use cases that start with an existing Packet. |
Packet |
relateServerResponse(Packet r,
WSDLPort wsdlPort,
SEIModel seiModel,
WSBinding binding)
|
void |
removeSatellite(PropertySet satellite)
Deprecated. |
void |
setContentNegotiationString(java.lang.String s)
|
void |
setContentType(com.oracle.webservices.api.message.ContentType contentType)
|
void |
setEndPointAddressString(java.lang.String s)
|
void |
setFastInfosetDisabled(boolean b)
|
void |
setMessage(Message message)
Sets a Message to this packet. |
void |
setMtomFeature(MTOMFeature mtomFeature)
|
void |
setMtomRequest(java.lang.Boolean mtomRequest)
|
void |
setRequestReplyMEP(java.lang.Boolean x)
|
void |
setResponseMessage(Packet request,
Message responseMessage,
AddressingVersion addressingVersion,
SOAPVersion soapVersion,
java.lang.String action)
Overwrites the Message of the response packet (this ) by the given Message . |
void |
setState(Packet.State state)
|
void |
setWSDLOperation(javax.xml.namespace.QName wsdlOp)
Set the wsdl operation to avoid lookup from other data. |
boolean |
shouldUseMtom()
|
java.lang.String |
toShortString()
|
java.lang.String |
toString()
|
com.oracle.webservices.api.message.ContentType |
writeTo(java.io.OutputStream out)
Writes the XML infoset portion of this MessageContext (from <soap:Envelope> to </soap:Envelope>). |
com.oracle.webservices.api.message.ContentType |
writeTo(java.nio.channels.WritableByteChannel buffer)
|
Methods inherited from class com.oracle.webservices.api.message.BaseDistributedPropertySet |
---|
addSatellite, addSatellite, asMapLocal, containsKey, copySatelliteInto, copySatelliteInto, createEntrySet, createView, get, getSatellite, getSatellites, put, remove, removeSatellite, supports, supportsLocal |
Methods inherited from class com.oracle.webservices.api.message.BasePropertySet |
---|
asMap, createMapView, mapAllowsAdditionalProperties, parse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.oracle.webservices.api.message.DistributedPropertySet |
---|
addSatellite, addSatellite, copySatelliteInto, getSatellite, getSatellites, removeSatellite |
Methods inherited from interface com.oracle.webservices.api.message.PropertySet |
---|
asMap, containsKey, createMapView, get, put, remove, supports |
Field Detail |
---|
public boolean wasTransportSecure
This is a requirement from the security team.
public static final java.lang.String INBOUND_TRANSPORT_HEADERS
SOAPMessage.getMimeHeaders()
would return these headers.
public static final java.lang.String OUTBOUND_TRANSPORT_HEADERS
Transports may choose to ignore certain headers that interfere with its correct operation, such as Content-Type and Content-Length.
public static final java.lang.String HA_INFO
public HandlerConfiguration handlerConfig
public BindingProvider proxy
public boolean isAdapterDeliversNonAnonymousResponse
Adapter
or Fiber.CompletionCallback
will handle delivering response messages targeted at non-anonymous endpoint
addresses. Prior to the introduction of this flag
the WsaServerTube
would deliver non-anonymous responses.
public boolean packetTakesPriorityOverRequestContext
public EndpointAddress endpointAddress
The JAX-WS spec allows this to be changed for each message, so it's designed to be a property.
Must not be null for a request message on the client. Otherwise it's null.
public ContentNegotiation contentNegotiation
ContentNegotiation.PROPERTY
property.
This property is used only on the client side.
public java.lang.String acceptableMimeTypes
The representation shall be that specified by the HTTP Accept request-header field.
The list of content types will be obtained from the transport meta-data of a inbound message in a request/response message exchange. Hence this property will be set by the service-side transport pipe.
public WebServiceContextDelegate webServiceContextDelegate
WebServiceContext
methods
exposed to the user application.
Used only on the server side.
This property is set from the parameter
of WSEndpoint.PipeHead#process
.
@Nullable public TransportBackChannel transportBackChannel
This field can be null. While a message is being processed,
this field can be set explicitly to null, to prevent
future pipes from closing a transport (see keepTransportBackChannelOpen()
)
This property is set from the parameter
of WSEndpoint.PipeHead#process
.
public Component component
Adapter
and on the client it is the Stub
.
public WSEndpoint endpoint
WSEndpoint
in which this message is floating.
This property is set if and only if this is on the server side.
public java.lang.String soapAction
For outgoing messages, the transport may sends out this value. If this field is null, the transport may choose to send "" (quoted empty string.) For incoming messages, the transport will set this field. If the incoming message did not contain the SOAPAction header, the transport sets this field to null.
If the value is non-null, it must be always in the quoted form. The value can be null.
Note that the way the transport sends this value out depends on transport and SOAP version.
For HTTP transport and SOAP 1.1, BP requires that SOAPAction header is present (See and .) For SOAP 1.2, this is moved to the parameter of the "application/soap+xml".
public java.lang.Boolean expectReply
This property is used on the client-side for
outbound messages, so that a pipeline
can communicate to the terminal (or intermediate) Tube
s
about this knowledge.
This property MUST NOT be used by 2-way transports that have the transport back channel. Those transports must always check a reply coming through the transport back channel regardless of this value, and act accordingly. (This is because the expectation of the client and that of the server can be different, for example because of a bug in user's configuration.)
This property is for one-way transports, and more specifically for the coordinator that correlates sent requests and incoming replies, to decide whether to block until a response is received.
Also note that this property is related to
WSDLOperation.isOneWay()
but not the same thing.
In fact in general, they are completely orthogonal.
For example, the calling application can choose to invoke
Dispatch.invoke(Object)
or Dispatch.invokeOneWay(Object)
with an operation (which determines the value of this property),
regardless of whether WSDL actually says it's one way or not.
So these two booleans can take any combinations.
When this property is Boolean.FALSE
, it means that
the pipeline does not expect a reply from a server (and therefore
the correlator should not block for a reply message
-- if such a reply does arrive, it can be just ignored.)
When this property is Boolean.TRUE
, it means that
the pipeline expects a reply from a server (and therefore
the correlator should block to see if a reply message is received,
This property is always set to Boolean.TRUE
or
Boolean.FALSE
when used on the request message
on the client side.
No other Boolean
instances are allowed.
In all other situations, this property is null.
@Deprecated public java.lang.Boolean isOneWay
A part of what this flag represented moved to
expectReply
and the other part was moved
to Message.isOneWay(WSDLPort)
. Please update
your code soon, or risk breaking your build!!
public java.lang.Boolean isSynchronousMEP
public java.lang.Boolean nonNullAsyncHandlerGiven
public final java.util.Map<java.lang.String,java.lang.Object> invocationProperties
These properties are copied from a request to a response. This is where we keep properties that are set by handlers.
See class javadoc for more discussion.
getHandlerScopePropertyNames(boolean)
Constructor Detail |
---|
public Packet(Message request)
Packet
that wraps a given Message
.
This method should be only used to create a fresh Packet
.
To create a Packet
for a reply, use createResponse(Message)
.
request
- The request Message
. Can be null.public Packet()
Packet
that doesn't have any Message
.
Method Detail |
---|
public Packet copy(boolean copyMessage)
Packet
.
copyMessage
- determines whether the Message
from the original Packet
should be copied as
well, or not. If the value is false
, the Message
in the copy of the Packet
is null
.
public Message getMessage()
Message
set through setMessage(Message)
.
public Message getInternalMessage()
public WSBinding getBinding()
public void setMessage(Message message)
Message
to this packet.
message
- Can be null.@Nullable public final javax.xml.namespace.QName getWSDLOperation()
public WSDLOperationMapping getWSDLOperationMapping()
getWSDLOperationMapping
in interface MessageMetadata
public void setWSDLOperation(javax.xml.namespace.QName wsdlOp)
JavaMethod
wsdlOp
- QNamepublic java.lang.String getEndPointAddressString()
endpointAddress
. This is for JAX-WS client applications
that access this property via BindingProvider.ENDPOINT_ADDRESS_PROPERTY
.
public void setEndPointAddressString(java.lang.String s)
public java.lang.String getContentNegotiationString()
public void setContentNegotiationString(java.lang.String s)
@NotNull public java.util.List<org.w3c.dom.Element> getReferenceParameters()
Headers which have attribute wsa:IsReferenceParameter="true" This is not cached as one may reset the Message.
public TransportBackChannel keepTransportBackChannelOpen()
transportBackChannel
to null.)
transportBackChannel
.public java.lang.Boolean isRequestReplyMEP()
public void setRequestReplyMEP(java.lang.Boolean x)
public final java.util.Set<java.lang.String> getHandlerScopePropertyNames(boolean readOnly)
Set
that stores handler-scope properties.
These properties will not be exposed to the response context.
Consequently, if a Tube
wishes to hide a property
to ResponseContext
, it needs to add the property name
to this set.
readOnly
- Return true if the caller only intends to read the value of this set.
Internally, the Set
is allocated lazily, and this flag helps
optimizing the strategy.
public final java.util.Set<java.lang.String> getApplicationScopePropertyNames(boolean readOnly)
getHandlerScopePropertyNames(boolean)
.
To be removed once Tango components are updated.
@Deprecated public Packet createResponse(Message msg)
Packet
from a request packet (this
).
When a Packet
for a reply is created, some properties need to be
copied over from a request to a response, and this method handles it correctly.
msg
- The Message
that represents a reply. Can be null.public Packet createClientResponse(Message msg)
Packet
from a request packet (this
).
When a Packet
for a reply is created, some properties need to be
copied over from a request to a response, and this method handles it correctly.
msg
- The Message
that represents a reply. Can be null.public Packet relateClientResponse(Packet response)
public Packet createServerResponse(@Nullable Message responseMessage, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding)
Packet
from a request
packet (this
). If WS-Addressing is enabled, a default Action
Message Addressing Property is obtained using wsdlPort
WSDLPort
and binding
WSBinding
.
This method should be called to create application response messages
since they are associated with a WSBinding
and WSDLPort
.
For creating protocol messages that require a non-default Action, use
createServerResponse(Message, com.sun.xml.ws.api.addressing.AddressingVersion, com.sun.xml.ws.api.SOAPVersion, String)
.
responseMessage
- The Message
that represents a reply. Can be null.wsdlPort
- The response WSDL port.binding
- The response Binding. Cannot be null.
public void copyPropertiesTo(@Nullable Packet response)
this
) packet into a input Packet
response
- packetpublic Packet relateServerResponse(@Nullable Packet r, @Nullable WSDLPort wsdlPort, @Nullable SEIModel seiModel, @NotNull WSBinding binding)
public Packet createServerResponse(@Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull java.lang.String action)
Packet
from a request
packet (this
). If WS-Addressing is enabled, action
is used as Action Message Addressing Property.
This method should be called only for creating protocol response messages
that require a particular value of Action since they are not associated
with a WSBinding
and WSDLPort
but do know the AddressingVersion
and SOAPVersion
.
responseMessage
- The Message
that represents a reply. Can be null.addressingVersion
- The WS-Addressing version of the response message.soapVersion
- The SOAP version of the response message.action
- The response Action Message Addressing Property value.
public void setResponseMessage(@NotNull Packet request, @Nullable Message responseMessage, @NotNull AddressingVersion addressingVersion, @NotNull SOAPVersion soapVersion, @NotNull java.lang.String action)
Message
of the response packet (this
) by the given Message
.
Unlike setMessage(Message)
, fill in the addressing headers correctly, and this process
requires the access to the request packet.
This method is useful when the caller needs to swap a response message completely to a new one.
createServerResponse(Message, AddressingVersion, SOAPVersion, String)
public java.lang.String toShortString()
public java.lang.String toString()
toString
in class java.lang.Object
protected com.oracle.webservices.api.message.BasePropertySet.PropertyMap getPropertyMap()
com.oracle.webservices.api.message.BasePropertySet
PropertySet.Property
.
Model of PropertySet
class.
At the end of the derivation chain this method just needs to be implemented as:
private static final PropertyMap model; static { model = parse(MyDerivedClass.class); } protected PropertyMap getPropertyMap() { return model; }
getPropertyMap
in class com.oracle.webservices.api.message.BasePropertySet
public java.util.Map<java.lang.String,java.lang.Object> asMapIncludingInvocationProperties()
public javax.xml.soap.SOAPMessage getSOAPMessage() throws javax.xml.soap.SOAPException
com.oracle.webservices.api.message.MessageContext
getSOAPMessage
in interface com.oracle.webservices.api.message.MessageContext
javax.xml.soap.SOAPException
public javax.xml.soap.SOAPMessage getAsSOAPMessage() throws javax.xml.soap.SOAPException
com.oracle.webservices.api.message.MessageContext
getAsSOAPMessage
in interface com.oracle.webservices.api.message.MessageContext
javax.xml.soap.SOAPException
public Codec getCodec()
public com.oracle.webservices.api.message.ContentType writeTo(java.io.OutputStream out) throws java.io.IOException
com.oracle.webservices.api.message.MessageContext
writeTo
in interface com.oracle.webservices.api.message.MessageContext
out
- Must not be null. The caller is responsible for closing the stream,
not the callee.
java.io.IOException
- if a OutputStream
throws IOException
.public com.oracle.webservices.api.message.ContentType writeTo(java.nio.channels.WritableByteChannel buffer)
public java.lang.Boolean getMtomRequest()
public void setMtomRequest(java.lang.Boolean mtomRequest)
public java.lang.Boolean getMtomAcceptable()
public void checkMtomAcceptable()
public java.lang.Boolean getFastInfosetAcceptable(java.lang.String fiMimeType)
public void setMtomFeature(MTOMFeature mtomFeature)
public MTOMFeature getMtomFeature()
public com.oracle.webservices.api.message.ContentType getContentType()
com.oracle.webservices.api.message.MessageContext
getContentType
in interface com.oracle.webservices.api.message.MessageContext
public com.oracle.webservices.api.message.ContentType getInternalContentType()
public void setContentType(com.oracle.webservices.api.message.ContentType contentType)
public Packet.State getState()
public void setState(Packet.State state)
public boolean shouldUseMtom()
public void addSatellite(@NotNull PropertySet satellite)
public void addSatellite(@NotNull java.lang.Class keyClass, @NotNull PropertySet satellite)
public void copySatelliteInto(@NotNull DistributedPropertySet r)
public void removeSatellite(PropertySet satellite)
public void setFastInfosetDisabled(boolean b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |