in aws-applicationinsights-application/src/main/java/software/amazon/applicationinsights/application/InputConfiguration/InputSubComponent.java [73:115]
public InputSubComponent(
final InputSubComponent recommendedSubComponent,
final SubComponentTypeConfiguration defaultOverwriteSubComponentConfiguration) {
if (!recommendedSubComponent.getSubComponentType().equals(defaultOverwriteSubComponentConfiguration.getSubComponentType())) {
return;
}
this.subComponentType = recommendedSubComponent.getSubComponentType();
SubComponentConfigurationDetails defaultOverwriteSubComponentConfigurationDetails =
defaultOverwriteSubComponentConfiguration.getSubComponentConfigurationDetails();
List<AlarmMetric> defaultOverwriteAlarmMetrics = defaultOverwriteSubComponentConfigurationDetails.getAlarmMetrics();
if (defaultOverwriteAlarmMetrics != null) {
List<InputAlarmMetric> inputAlarmMetrics = defaultOverwriteAlarmMetrics.stream()
.map(alarmMetric -> new InputAlarmMetric(alarmMetric))
.collect(Collectors.toList());
this.alarmMetrics = inputAlarmMetrics;
} else {
this.alarmMetrics = recommendedSubComponent.getAlarmMetrics();
}
List<Log> defaultOverwriteLogs = defaultOverwriteSubComponentConfigurationDetails.getLogs();
if (defaultOverwriteLogs != null) {
List<InputLog> inputLogs = defaultOverwriteLogs.stream()
.map(log -> new InputLog(log))
.collect(Collectors.toList());
this.logs = inputLogs;
} else {
this.logs = recommendedSubComponent.getLogs();
}
List<WindowsEvent> defaultOverwriteWindowsEvents = defaultOverwriteSubComponentConfigurationDetails.getWindowsEvents();
if (defaultOverwriteWindowsEvents != null) {
List<InputWindowsEvent> inputWindowsEvents = defaultOverwriteWindowsEvents.stream()
.map(windowsEvent -> new InputWindowsEvent(windowsEvent))
.collect(Collectors.toList());
this.windowsEvents = inputWindowsEvents;
} else {
this.windowsEvents = recommendedSubComponent.getWindowsEvents();
}
}