use of org.graylog2.plugin.validate.ConfigValidationException in project graylog2-server by Graylog2.
the class GeoIpResolverConfigValidator method validateConfig.
private void validateConfig(GeoIpResolverConfig config) throws ConfigValidationException {
Timer timer = new Timer(new UniformReservoir());
try {
// A test address. This will NOT be in any database, but should only produce an
// AddressNotFoundException. Any other exception suggests an actual error such as
// a database file that does does not belong to the vendor selected
InetAddress testAddress = InetAddress.getByName("127.0.0.1");
validateGeoIpLocationResolver(config, timer, testAddress);
validateGeoIpAsnResolver(config, timer, testAddress);
} catch (UnknownHostException | IllegalArgumentException e) {
throw new ConfigValidationException(e.getMessage());
}
}
Aggregations