示例#1
0
  private void updateGeoData(final Peer peer, final String address) {
    if (peer.hasGeoData()) {
      log.debug("Peer already had geo data: {}", peer);
      return;
    }

    final GeoData geo = geoIpLookupService.getGeoData(address);
    peer.setCountry(geo.getCountrycode());
    peer.setLat(geo.getLatitude());
    peer.setLon(geo.getLongitude());
  }