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

    Constructors
    Constructor
    Description
    Create a context for a request received over the given connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the context of the observation that the given message context takes part in, if any.
    Return the web service connection used for the current request.
    @Nullable String
    Return the target namespace of the operation, or null if the request could not be mapped to an endpoint.
    @Nullable String
    Return the name of the operation, or null if the request could not be mapped to an endpoint.
    Return the request, or null if it has not been read yet.
     
    @Nullable String
    Return the SOAP action of the request, or null if the request is not a SoapMessage or does not define one.
    @Nullable URI
    Return the URI the request was received on, or null if the connection does not expose a valid URI.
    void
    setAsCurrent(MessageContext messageContext)
    Associate this context with the given message context, and register it so that it can be retrieved using findCurrentObservationContext(MessageContext).
    void
    setOperation(@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

    setResponse

    Methods inherited from class io.micrometer.observation.transport.ReceiverContext

    getCarrier, getGetter, getKind, getRemoteServiceAddress, getRemoteServiceName, setCarrier, setRemoteServiceAddress, setRemoteServiceName

    Methods 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, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micrometer.observation.Observation.ContextView

    getOrDefault
  • Constructor Details

    • SoapServerObservationContext

      public SoapServerObservationContext(WebServiceConnection connection)
      Create a context for a request received over the given connection. The MessageContext is not available until the request has been read, and must be provided using setAsCurrent(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 an EndpointInterceptor to 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

      public void setAsCurrent(MessageContext messageContext)
      Associate this context with the given message context, and register it so that it can be retrieved using findCurrentObservationContext(MessageContext).
      Parameters:
      messageContext - the message context of the current request
    • getConnection

      public WebServiceConnection getConnection()
      Return the web service connection used for the current request.
    • getRequest

      public @Nullable WebServiceMessage getRequest()
      Return the request, or null if it has not been read yet.
    • getResponse

      public @Nullable WebServiceMessage getResponse()
      Specified by:
      getResponse in interface io.micrometer.observation.transport.ResponseContext<WebServiceMessage>
      Overrides:
      getResponse in class io.micrometer.observation.transport.RequestReplyReceiverContext<WebServiceConnection, WebServiceMessage>
    • getNamespace

      public @Nullable String getNamespace()
      Return the target namespace of the operation, or null if the request could not be mapped to an endpoint.
    • getOperationName

      public @Nullable String getOperationName()
      Return the name of the operation, or null if the request could not be mapped to an endpoint.
    • setOperation

      public void setOperation(@Nullable String namespace, @Nullable String operationName)
      Set the target namespace and the name of the operation, overriding the values derived from the endpoint mapping.
      Parameters:
      namespace - the target namespace, or null if unknown
      operationName - the name of the operation, or null if unknown
    • getSoapAction

      public @Nullable String getSoapAction()
      Return the SOAP action of the request, or null if the request is not a SoapMessage or does not define one.
    • getUri

      public @Nullable URI getUri()
      Return the URI the request was received on, or null if the connection does not expose a valid URI.