use of org.opennms.netmgt.config.discovery.ExcludeRange in project opennms by OpenNMS.
the class DiscoveryRestService method getDiscoveryConfig.
private DiscoveryConfiguration getDiscoveryConfig(DiscoveryConfigurationDTO discoveryConfigurationDTO) {
DiscoveryConfiguration discoveryConfiguration = new DiscoveryConfiguration();
discoveryConfiguration.setTimeout(discoveryConfigurationDTO.getTimeout());
discoveryConfiguration.setRetries(discoveryConfigurationDTO.getRetries());
discoveryConfiguration.setForeignSource(discoveryConfigurationDTO.getForeignSource());
discoveryConfiguration.setLocation(discoveryConfigurationDTO.getLocation());
discoveryConfiguration.setChunkSize(discoveryConfigurationDTO.getChunkSize());
for (DiscoveryConfigurationDTO.SpecificDTO specificDTO : discoveryConfigurationDTO.getSpecificDTOList()) {
Specific specific = new Specific();
specific.setAddress(specificDTO.getContent());
specific.setTimeout(specificDTO.getTimeout());
specific.setRetries(specificDTO.getRetries());
specific.setForeignSource(specificDTO.getForeignSource());
specific.setLocation(specificDTO.getLocation());
discoveryConfiguration.addSpecific(specific);
}
for (DiscoveryConfigurationDTO.IncludeUrlDTO includeUrlDTO : discoveryConfigurationDTO.getIncludeUrlDTOList()) {
IncludeUrl includeUrl = new IncludeUrl();
includeUrl.setUrl(includeUrlDTO.getContent());
includeUrl.setTimeout(includeUrlDTO.getTimeout());
includeUrl.setRetries(includeUrlDTO.getRetries());
includeUrl.setForeignSource(includeUrlDTO.getForeignSource());
includeUrl.setLocation(includeUrlDTO.getLocation());
discoveryConfiguration.addIncludeUrl(includeUrl);
}
for (DiscoveryConfigurationDTO.IncludeRangeDTO includeRangeDTO : discoveryConfigurationDTO.getIncludeRangeDTOList()) {
IncludeRange includeRange = new IncludeRange();
includeRange.setBegin(includeRangeDTO.getBegin());
includeRange.setEnd(includeRangeDTO.getEnd());
includeRange.setTimeout(includeRangeDTO.getTimeout());
includeRange.setRetries(includeRangeDTO.getRetries());
includeRange.setForeignSource(includeRangeDTO.getForeignSource());
includeRange.setLocation(includeRangeDTO.getLocation());
discoveryConfiguration.addIncludeRange(includeRange);
}
for (DiscoveryConfigurationDTO.ExcludeRangeDTO excludeRangeDTO : discoveryConfigurationDTO.getExcludeRangeDTOList()) {
ExcludeRange excludeRange = new ExcludeRange();
excludeRange.setBegin(excludeRangeDTO.getBegin());
excludeRange.setEnd(excludeRangeDTO.getEnd());
discoveryConfiguration.addExcludeRange(excludeRange);
}
return discoveryConfiguration;
}
Aggregations