Class DynamicSegmentNamingStrategy

    • Constructor Detail

      • DynamicSegmentNamingStrategy

        @Deprecated
        public DynamicSegmentNamingStrategy​(java.lang.String fallbackName)
        Creates an instance of DynamicSegmentNamingStrategy with the provided fallbackName and a recognizedHosts value of "*".
        Parameters:
        fallbackName - the fallback segment name used when no host header is included in the incoming request. This will be overriden by the value of the AWS_XRAY_TRACING_NAME environment variable or com.amazonaws.xray.strategy.tracingName system property, if either are set to a non-empty value.
      • DynamicSegmentNamingStrategy

        @Deprecated
        public DynamicSegmentNamingStrategy​(java.lang.String fallbackName,
                                            java.lang.String recognizedHosts)
        Creates an instance of DynamicSegmentNamingStrategy with the provided fallbackName and recognizedHosts values.
        Parameters:
        fallbackName - the fallback segment name used when no host header is included in the incoming request or the incoming host header value does not match the provided pattern. This will be overriden by the value of the AWS_XRAY_TRACING_NAME environment variable or com.amazonaws.xray.strategy.tracingName system property, if either are set to a non-empty value.
        recognizedHosts - the pattern to match the incoming host header value against. This pattern is compared against the incoming host header using the SearchPattern.wildcardMatch(String, String) method.
    • Method Detail

      • nameForRequest

        public java.lang.String nameForRequest​(jakarta.servlet.http.HttpServletRequest request)
        Deprecated.
        Returns the derived segment name for an incoming request. Attempts to get the Host header from the HttpServletRequest. If the Host header has a value and if the value matches the optionally provided recognizedHosts pattern, then this value is returned as the segment name. Otherwise, fallbackName is returned.
        Specified by:
        nameForRequest in interface SegmentNamingStrategy
        Parameters:
        request - the incoming request
        Returns:
        the segment name for the incoming request.