Interface SegmentNamingStrategy
-
- All Known Implementing Classes:
DynamicSegmentNamingStrategy,FixedSegmentNamingStrategy
public interface SegmentNamingStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEYEnvironment variable key used to override the default segment name used by implementors ofSegmentNamingStrategy.static java.lang.StringNAME_OVERRIDE_SYSTEM_PROPERTY_KEYSystem property key used to override the default segment name used by implementors ofSegmentNamingStrategy.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static SegmentNamingStrategydynamic(java.lang.String fallbackName)Returns aSegmentNamingStrategythat names segments based on theHostheader of incoming requests, accepting anyHostheader value.static SegmentNamingStrategydynamic(java.lang.String fallbackName, java.lang.String recognizedHosts)Returns aSegmentNamingStrategythat names segments based on theHostheader of incoming requests, accepting only recognizedHostheader values.static SegmentNamingStrategyfixed(java.lang.String name)Returns aSegmentNamingStrategythat assigns the providednameto all segments generated for incoming requests.default @Nullable java.lang.StringgetOverrideName()java.lang.StringnameForRequest(jakarta.servlet.http.HttpServletRequest request)
-
-
-
Field Detail
-
NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY
static final java.lang.String NAME_OVERRIDE_ENVIRONMENT_VARIABLE_KEY
Environment variable key used to override the default segment name used by implementors ofSegmentNamingStrategy. Takes precedence over any system property, web.xml configuration value, or constructor value used for a fixed segment name.- See Also:
- Constant Field Values
-
NAME_OVERRIDE_SYSTEM_PROPERTY_KEY
static final java.lang.String NAME_OVERRIDE_SYSTEM_PROPERTY_KEY
System property key used to override the default segment name used by implementors ofSegmentNamingStrategy. Takes precedence over any web.xml configuration value or constructor value used for a fixed segment name.- See Also:
- Constant Field Values
-
-
Method Detail
-
fixed
static SegmentNamingStrategy fixed(java.lang.String name)
Returns aSegmentNamingStrategythat assigns the providednameto all segments generated for incoming requests. This will be ignored and will use the the value of theAWS_XRAY_TRACING_NAMEenvironment variable orcom.amazonaws.xray.strategy.tracingNamesystem property if set.
-
dynamic
static SegmentNamingStrategy dynamic(java.lang.String fallbackName)
Returns aSegmentNamingStrategythat names segments based on theHostheader of incoming requests, accepting anyHostheader value.- 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 theAWS_XRAY_TRACING_NAMEenvironment variable orcom.amazonaws.xray.strategy.tracingNamesystem property, if either are set to a non-empty value.
-
dynamic
static SegmentNamingStrategy dynamic(java.lang.String fallbackName, java.lang.String recognizedHosts)
Returns aSegmentNamingStrategythat names segments based on theHostheader of incoming requests, accepting only recognizedHostheader 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 theAWS_XRAY_TRACING_NAMEenvironment variable orcom.amazonaws.xray.strategy.tracingNamesystem 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 theSearchPattern.wildcardMatch(String, String)method.
-
nameForRequest
java.lang.String nameForRequest(jakarta.servlet.http.HttpServletRequest request)
-
getOverrideName
default @Nullable java.lang.String getOverrideName()
-
-