Package org.apache.cxf.ws.addressing
Class ContextUtils
- java.lang.Object
- 
- org.apache.cxf.ws.addressing.ContextUtils
 
- 
 public final class ContextUtils extends Object Holder for utility methods relating to contexts.
- 
- 
Field SummaryFields Modifier and Type Field Description static StringACTIONstatic org.apache.cxf.ws.addressing.ObjectFactoryWSA_OBJECT_FACTORY
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static voidapplyReferenceParam(org.apache.cxf.ws.addressing.EndpointReferenceType toEpr, Object el)static DestinationcreateDecoupledDestination(Exchange exchange, org.apache.cxf.ws.addressing.EndpointReferenceType reference)static MessagecreateMessage(Exchange exchange)Create a Binding specific Message.static StringgenerateUUID()static org.apache.cxf.ws.addressing.AttributedURITypegetAttributedURI(String uri)Helper method to get an attributed URI.static ConduitgetConduit(Conduit conduit, Message message)Retreive Conduit from Exchange if not already availablestatic StringgetMAPProperty(boolean isRequestor, boolean isProviderContext, boolean isOutbound)Get appropriate property name for message addressing properties.static org.apache.cxf.ws.addressing.EndpointReferenceTypegetNoneEndpointReference()static org.apache.cxf.ws.addressing.RelatesToTypegetRelatesTo(String uri)Helper method to get a RealtesTo instance.static booleanhasEmptyAction(AddressingProperties maps)Helper method to determine if an MAPs Action is empty (a null action is considered empty, whereas a zero length action suppresses the propagation of the Action property).static booleanisAnonymousAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref)Helper method to determine if an EPR address is anon (either null, anonymous).static booleanisFault(Message message)Determine if message is fault.static booleanisGenericAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref)Helper method to determine if an EPR address is generic (either null, none or anonymous).static booleanisNoneAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref)Helper method to determine if an EPR address is none.static booleanisOutbound(Message message)Determine if message is outbound.static booleanisRequestor(Message message)Determine if current messaging role is that of requestor.static voidpropogateReceivedMAPs(AddressingProperties inMAPs, Exchange exchange)Propagate inbound MAPs onto full reponse & fault messages.static voidpropogateReceivedMAPs(AddressingProperties inMAPs, Message responseMessage)Propogate inbound MAPs onto reponse message if applicable (not applicable for oneways).static booleanretrieveAsyncPostResponseDispatch(Message message)Retrieve indication that an async post-response service invocation is required.static booleanretrieveDeferredUncorrelatedMessageAbort(Message message)Retrieve indication that a deferred uncorrelated message abort should occur.static booleanretrieveDeferUncorrelatedMessageAbort(Message message)Retrieve indication that a deferred uncorrelated message abort is supportedstatic StringretrieveMAPFaultName(Message message)Retrieve MAP fault name from the message.static StringretrieveMAPFaultReason(Message message)Retrieve MAP fault reason from the message.static AddressingPropertiesretrieveMAPs(Message message, boolean isProviderContext, boolean isOutbound)static AddressingPropertiesretrieveMAPs(Message message, boolean isProviderContext, boolean isOutbound, boolean warnIfMissing)static booleanretrievePartialResponseSent(Message message)Retrieve indication that a partial response has been sent.static voidstoreDeferredUncorrelatedMessageAbort(Message message)Store indication that a deferred uncorrelated message abort should occurstatic voidstoreDeferUncorrelatedMessageAbort(Message message)Store indication that a deferred uncorrelated message abort is supportedstatic voidstoreMAPFaultName(String faultName, Message message)Store bad MAP fault name in the message.static voidstoreMAPFaultReason(String reason, Message message)Store MAP fault reason in the message.static voidstoreMAPs(AddressingProperties maps, Message message, boolean isOutbound)Store MAPs in the message.static voidstoreMAPs(AddressingProperties maps, Message message, boolean isOutbound, boolean isRequestor)Store MAPs in the message.static voidstoreMAPs(AddressingProperties maps, Message message, boolean isOutbound, boolean isRequestor, boolean isProviderContext)Store MAPs in the message.static voidstorePartialResponseSent(Message message)Store an indication that a partial response has been sent.
 
- 
- 
- 
Field Detail- 
WSA_OBJECT_FACTORYpublic static final org.apache.cxf.ws.addressing.ObjectFactory WSA_OBJECT_FACTORY 
 - 
ACTIONpublic static final String ACTION 
 
- 
 - 
Method Detail- 
isOutboundpublic static boolean isOutbound(Message message) Determine if message is outbound.- Parameters:
- message- the current Message
- Returns:
- true iff the message direction is outbound
 
 - 
isFaultpublic static boolean isFault(Message message) Determine if message is fault.- Parameters:
- message- the current Message
- Returns:
- true iff the message is a fault
 
 - 
isRequestorpublic static boolean isRequestor(Message message) Determine if current messaging role is that of requestor.- Parameters:
- message- the current Message
- Returns:
- true if the current messaging role is that of requestor
 
 - 
getMAPPropertypublic static String getMAPProperty(boolean isRequestor, boolean isProviderContext, boolean isOutbound) Get appropriate property name for message addressing properties.- Parameters:
- isRequestor- true if the current messaging role is that of requestor
- isProviderContext- true if the binding provider request context available to the client application as opposed to the message context visible to handlers
- isOutbound- true if the message is outbound
- Returns:
- the property name to use when caching the MAPs in the context
 
 - 
storeMAPspublic static void storeMAPs(AddressingProperties maps, Message message, boolean isOutbound) Store MAPs in the message.- Parameters:
- message- the current message
- isOutbound- true if the message is outbound
 
 - 
storeMAPspublic static void storeMAPs(AddressingProperties maps, Message message, boolean isOutbound, boolean isRequestor) Store MAPs in the message.- Parameters:
- maps- the MAPs to store
- message- the current message
- isOutbound- true if the message is outbound
- isRequestor- true if the current messaging role is that of requestor
 
 - 
storeMAPspublic static void storeMAPs(AddressingProperties maps, Message message, boolean isOutbound, boolean isRequestor, boolean isProviderContext) Store MAPs in the message.- Parameters:
- maps- the MAPs to store
- message- the current message
- isOutbound- true if the message is outbound
- isRequestor- true if the current messaging role is that of requestor
- isProviderContext- true if the binding provider request context
 
 - 
retrieveMAPspublic static AddressingProperties retrieveMAPs(Message message, boolean isProviderContext, boolean isOutbound) - Parameters:
- message- the current message
- isProviderContext- true if the binding provider request context available to the client application as opposed to the message context visible to handlers
- isOutbound- true if the message is outbound
- Returns:
- the current addressing properties
 
 - 
retrieveMAPspublic static AddressingProperties retrieveMAPs(Message message, boolean isProviderContext, boolean isOutbound, boolean warnIfMissing) - Parameters:
- message- the current message
- isProviderContext- true if the binding provider request context available to the client application as opposed to the message context visible to handlers
- isOutbound- true if the message is outbound
- warnIfMissing- log a warning message if properties cannot be retrieved
- Returns:
- the current addressing properties
 
 - 
getAttributedURIpublic static org.apache.cxf.ws.addressing.AttributedURIType getAttributedURI(String uri) Helper method to get an attributed URI.- Parameters:
- uri- the URI
- Returns:
- an AttributedURIType encapsulating the URI
 
 - 
getRelatesTopublic static org.apache.cxf.ws.addressing.RelatesToType getRelatesTo(String uri) Helper method to get a RealtesTo instance.- Parameters:
- uri- the related URI
- Returns:
- a RelatesToType encapsulating the URI
 
 - 
isGenericAddresspublic static boolean isGenericAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref) Helper method to determine if an EPR address is generic (either null, none or anonymous).- Parameters:
- ref- the EPR under test
- Returns:
- true if the address is generic
 
 - 
isAnonymousAddresspublic static boolean isAnonymousAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref) Helper method to determine if an EPR address is anon (either null, anonymous).- Parameters:
- ref- the EPR under test
- Returns:
- true if the address is generic
 
 - 
isNoneAddresspublic static boolean isNoneAddress(org.apache.cxf.ws.addressing.EndpointReferenceType ref) Helper method to determine if an EPR address is none.- Parameters:
- ref- the EPR under test
- Returns:
- true if the address is generic
 
 - 
hasEmptyActionpublic static boolean hasEmptyAction(AddressingProperties maps) Helper method to determine if an MAPs Action is empty (a null action is considered empty, whereas a zero length action suppresses the propagation of the Action property).- Parameters:
- maps- the MAPs Action under test
- Returns:
- true if the Action is empty
 
 - 
propogateReceivedMAPspublic static void propogateReceivedMAPs(AddressingProperties inMAPs, Exchange exchange) Propagate inbound MAPs onto full reponse & fault messages.- Parameters:
- inMAPs- the inbound MAPs
- exchange- the current Exchange
 
 - 
propogateReceivedMAPspublic static void propogateReceivedMAPs(AddressingProperties inMAPs, Message responseMessage) Propogate inbound MAPs onto reponse message if applicable (not applicable for oneways).- Parameters:
- inMAPs- the inbound MAPs
- responseMessage-
 
 - 
storeMAPFaultNamepublic static void storeMAPFaultName(String faultName, Message message) Store bad MAP fault name in the message.- Parameters:
- faultName- the fault name to store
- message- the current message
 
 - 
retrieveMAPFaultNamepublic static String retrieveMAPFaultName(Message message) Retrieve MAP fault name from the message.- Parameters:
- message- the current message
- Returns:
- the retrieved fault name
 
 - 
storeMAPFaultReasonpublic static void storeMAPFaultReason(String reason, Message message) Store MAP fault reason in the message.- Parameters:
- reason- the fault reason to store
- message- the current message
 
 - 
retrieveMAPFaultReasonpublic static String retrieveMAPFaultReason(Message message) Retrieve MAP fault reason from the message.- Parameters:
- message- the current message
- Returns:
- the retrieved fault reason
 
 - 
storePartialResponseSentpublic static void storePartialResponseSent(Message message) Store an indication that a partial response has been sent. Relavant if *both* the replyTo & faultTo are decoupled, and a fault occurs, then we would already have sent the partial response (pre-dispatch) for the replyTo, so no need to send again.- Parameters:
- message- the current message
 
 - 
retrievePartialResponseSentpublic static boolean retrievePartialResponseSent(Message message) Retrieve indication that a partial response has been sent.- Parameters:
- message- the current message
- Returns:
- the retrieved indication that a partial response has been sent
 
 - 
storeDeferUncorrelatedMessageAbortpublic static void storeDeferUncorrelatedMessageAbort(Message message) Store indication that a deferred uncorrelated message abort is supported- Parameters:
- message- the current message
 
 - 
retrieveDeferUncorrelatedMessageAbortpublic static boolean retrieveDeferUncorrelatedMessageAbort(Message message) Retrieve indication that a deferred uncorrelated message abort is supported- Parameters:
- message- the current message
- Returns:
- the retrieved indication
 
 - 
storeDeferredUncorrelatedMessageAbortpublic static void storeDeferredUncorrelatedMessageAbort(Message message) Store indication that a deferred uncorrelated message abort should occur- Parameters:
- message- the current message
 
 - 
retrieveDeferredUncorrelatedMessageAbortpublic static boolean retrieveDeferredUncorrelatedMessageAbort(Message message) Retrieve indication that a deferred uncorrelated message abort should occur.- Parameters:
- message- the current message
- Returns:
- the retrieved indication
 
 - 
retrieveAsyncPostResponseDispatchpublic static boolean retrieveAsyncPostResponseDispatch(Message message) Retrieve indication that an async post-response service invocation is required.- Parameters:
- message- the current message
- Returns:
- the retrieved indication that an async post-response service invocation is required.
 
 - 
generateUUIDpublic static String generateUUID() - Returns:
- a generated UUID
 
 - 
getConduitpublic static Conduit getConduit(Conduit conduit, Message message) Retreive Conduit from Exchange if not already available- Parameters:
- conduit- the current value for the Conduit
- message- the current message
- Returns:
- the Conduit if available
 
 - 
getNoneEndpointReferencepublic static org.apache.cxf.ws.addressing.EndpointReferenceType getNoneEndpointReference() 
 - 
applyReferenceParampublic static void applyReferenceParam(org.apache.cxf.ws.addressing.EndpointReferenceType toEpr, Object el)
 - 
createMessagepublic static Message createMessage(Exchange exchange) Create a Binding specific Message.- Parameters:
- exchange- the current exchange
- Returns:
- the Method from the BindingOperationInfo
 
 - 
createDecoupledDestinationpublic static Destination createDecoupledDestination(Exchange exchange, org.apache.cxf.ws.addressing.EndpointReferenceType reference) 
 
- 
 
-