use of com.mercedesbenz.sechub.domain.scan.NetworkTargetProductServerDataProvider in project sechub by mercedes-benz.
the class AbstractProductExecutor method configureNetworkTargetHandlingIfNecessary.
private void configureNetworkTargetHandlingIfNecessary(ProductExecutorData data) {
if (!isUsingNetworkTargets()) {
return;
}
/* check preconditions */
NetworkTargetProductServerDataProvider networkTargetDataProvider = data.networkTargetDataProvider;
if (networkTargetDataProvider == null) {
throw new IllegalStateException("No network target data provider set, but necessary for scantype: " + scanType + "\nInject this at customize method inside " + getClass().getName());
}
NetworkLocationProvider networkLocationProvider = data.networkLocationProvider;
if (networkLocationProvider == null) {
throw new IllegalStateException("No network location provier set, but necessary for scantype: " + scanType + "\nInject this at customize method inside " + getClass().getName());
}
NetworkTargetProductServerDataSuppport networkTargetProductServerDataSupport = new NetworkTargetProductServerDataSuppport(networkTargetDataProvider);
data.networkTargetProductServerDataSupport = networkTargetProductServerDataSupport;
NetworkTargetInfoFactory targetInfoFactory = new NetworkTargetInfoFactory(targetResolver, getClass().getSimpleName());
List<NetworkTargetInfo> targetRegistryInfoList = new ArrayList<>();
for (NetworkTargetType networkTargetType : NetworkTargetType.values()) {
if (!networkTargetType.isValid()) {
continue;
}
NetworkTargetInfo infoForThisNetworkTargetType = targetInfoFactory.createInfo(networkTargetType, data.traceLogId, networkLocationProvider, networkTargetProductServerDataSupport);
if (infoForThisNetworkTargetType.containsAtLeastOneTarget()) {
targetRegistryInfoList.add(infoForThisNetworkTargetType);
}
}
data.networkTargetInfoList = targetRegistryInfoList;
}
Aggregations