Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored AWSXRayServletFilter #386

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public AWSXRayServletFilter() {
}

public AWSXRayServletFilter(String fixedSegmentName) {
this(new FixedSegmentNamingStrategy(fixedSegmentName));
this(SegmentNamingStrategy.fixed(fixedSegmentName));
}

public AWSXRayServletFilter(@Nullable SegmentNamingStrategy segmentNamingStrategy) {
Expand Down Expand Up @@ -158,12 +158,12 @@ public void init(FilterConfig config) throws ServletException {
String dynamicNamingRecognizedHosts = config.getInitParameter("dynamicNamingRecognizedHosts");
if (StringValidator.isNotNullOrBlank(dynamicNamingFallbackName)) {
if (StringValidator.isNotNullOrBlank(dynamicNamingRecognizedHosts)) {
segmentNamingStrategy = new DynamicSegmentNamingStrategy(dynamicNamingFallbackName, dynamicNamingRecognizedHosts);
segmentNamingStrategy = SegmentNamingStrategy.dynamic(dynamicNamingFallbackName, dynamicNamingRecognizedHosts);
} else {
segmentNamingStrategy = new DynamicSegmentNamingStrategy(dynamicNamingFallbackName);
segmentNamingStrategy = SegmentNamingStrategy.dynamic(dynamicNamingFallbackName);
}
} else if (StringValidator.isNotNullOrBlank(fixedName)) {
segmentNamingStrategy = new FixedSegmentNamingStrategy(fixedName);
segmentNamingStrategy = SegmentNamingStrategy.fixed(fixedName);
} else if (null == segmentNamingStrategy) {
throw new ServletException(
"The AWSXRayServletFilter requires either a fixedName init-param or an instance of SegmentNamingStrategy. "
Expand Down