Class SoapServerObservationContext
java.lang.Object
io.micrometer.observation.Observation.Context
io.micrometer.observation.transport.ReceiverContext<WebServiceConnection>
io.micrometer.observation.transport.RequestReplyReceiverContext<WebServiceConnection, WebServiceMessage>
org.springframework.ws.transport.observation.SoapServerObservationContext
- All Implemented Interfaces:
io.micrometer.observation.Observation.ContextView, io.micrometer.observation.transport.ResponseContext<WebServiceMessage>
public class SoapServerObservationContext
extends io.micrometer.observation.transport.RequestReplyReceiverContext<WebServiceConnection, WebServiceMessage>
Context that holds information for metadata collection regarding
SOAP requests
observations.
This context also extends RequestReplyReceiverContext for propagating tracing
information over supported transports. Tracing information is not extracted for the
HTTP transport, as the Servlet layer is instrumented already.
- Since:
- 5.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionSoapServerObservationContext(WebServiceConnection connection) Create a context for a request received over the given connection. -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<SoapServerObservationContext> findCurrentObservationContext(MessageContext messageContext) Return the context of the observation that the given message context takes part in, if any.Return theweb service connectionused for the current request.@Nullable StringReturn the target namespace of the operation, ornullif the request could not be mapped to an endpoint.@Nullable StringReturn the name of the operation, ornullif the request could not be mapped to an endpoint.@Nullable WebServiceMessageReturn the request, ornullif it has not been read yet.@Nullable WebServiceMessage@Nullable StringReturn the SOAP action of the request, ornullif the request is not aSoapMessageor does not define one.@Nullable URIgetUri()Return the URI the request was received on, ornullif the connection does not expose a valid URI.voidsetAsCurrent(MessageContext messageContext) Associate this context with the given message context, and register it so that it can be retrieved usingfindCurrentObservationContext(MessageContext).voidsetOperation(@Nullable String namespace, @Nullable String operationName) Set the target namespace and the name of the operation, overriding the values derived from the endpoint mapping.Methods inherited from class io.micrometer.observation.transport.RequestReplyReceiverContext
setResponseMethods inherited from class io.micrometer.observation.transport.ReceiverContext
getCarrier, getGetter, getKind, getRemoteServiceAddress, getRemoteServiceName, setCarrier, setRemoteServiceAddress, setRemoteServiceNameMethods inherited from class io.micrometer.observation.Observation.Context
addHighCardinalityKeyValue, addHighCardinalityKeyValues, addLowCardinalityKeyValue, addLowCardinalityKeyValues, clear, computeIfAbsent, containsKey, get, getAllKeyValues, getContextualName, getError, getHighCardinalityKeyValue, getHighCardinalityKeyValues, getLowCardinalityKeyValue, getLowCardinalityKeyValues, getName, getOrDefault, getParentObservation, getRequired, put, remove, removeHighCardinalityKeyValue, removeHighCardinalityKeyValues, removeLowCardinalityKeyValue, removeLowCardinalityKeyValues, setContextualName, setError, setName, setParentObservation, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micrometer.observation.Observation.ContextView
getOrDefault
-
Constructor Details
-
SoapServerObservationContext
Create a context for a request received over the given connection. TheMessageContextis not available until the request has been read, and must be provided usingsetAsCurrent(MessageContext).- Parameters:
connection- the connection the request was received on
-
-
Method Details
-
findCurrentObservationContext
public static Optional<SoapServerObservationContext> findCurrentObservationContext(MessageContext messageContext) Return the context of the observation that the given message context takes part in, if any. This allows anEndpointInterceptorto contribute additional metadata to the current observation.- Parameters:
messageContext- the message context of the current request- Returns:
- the current observation context, or
Optional.empty()if the request is not being observed
-
setAsCurrent
Associate this context with the given message context, and register it so that it can be retrieved usingfindCurrentObservationContext(MessageContext).- Parameters:
messageContext- the message context of the current request
-
getConnection
Return theweb service connectionused for the current request. -
getRequest
Return the request, ornullif it has not been read yet. -
getResponse
- Specified by:
getResponsein interfaceio.micrometer.observation.transport.ResponseContext<WebServiceMessage>- Overrides:
getResponsein classio.micrometer.observation.transport.RequestReplyReceiverContext<WebServiceConnection, WebServiceMessage>
-
getNamespace
Return the target namespace of the operation, ornullif the request could not be mapped to an endpoint. -
getOperationName
Return the name of the operation, ornullif the request could not be mapped to an endpoint. -
setOperation
Set the target namespace and the name of the operation, overriding the values derived from the endpoint mapping.- Parameters:
namespace- the target namespace, ornullif unknownoperationName- the name of the operation, ornullif unknown
-
getSoapAction
Return the SOAP action of the request, ornullif the request is not aSoapMessageor does not define one. -
getUri
Return the URI the request was received on, ornullif the connection does not expose a valid URI.
-