use of com.mercedesbenz.sechub.sharedkernel.usecases.admin.config.UseCaseAdmiUpdatesMappingConfiguration in project sechub by mercedes-benz.
the class ScanMessageHandler method handleMappingConfigurationChanged.
@IsReceivingAsyncMessage(MessageID.MAPPING_CONFIGURATION_CHANGED)
@UseCaseAdmiUpdatesMappingConfiguration(@Step(number = 3, name = "Event handler", description = "Receives mapping configuration change event"))
private void handleMappingConfigurationChanged(DomainMessage request) {
MappingMessage data = request.get(MessageDataKeys.CONFIG_MAPPING_DATA);
String mappingId = data.getMappingId();
MappingIdentifier found = MappingIdentifier.getIdentifierOrNull(mappingId);
if (found == null) {
LOG.error("Mapping identifier with id:{} does not exist!", mappingId);
return;
}
/* filter only relevant parts - message may contain uninteresting stuff */
if (!found.hasTypeContainedIn(MappingType.ADAPTER_CONFIGURATION, MappingType.COMMON_CONFIGURATION)) {
LOG.debug("Mapping with id:{} is not relevant for cluster configuration and so ignored.", mappingId);
return;
}
updateScanMappingService.updateScanMapping(mappingId, data.getMappingData());
}
Aggregations