brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: add maxmind v2 (now ASL licensed)...
Date Wed, 03 Sep 2014 14:37:12 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/142#discussion_r17053236
  
    --- Diff: core/src/main/java/brooklyn/location/geo/MaxMind2HostGeoLookup.java ---
    @@ -0,0 +1,115 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package brooklyn.location.geo;
    +
    +import java.io.File;
    +import java.io.IOException;
    +import java.net.InetAddress;
    +import java.net.MalformedURLException;
    +
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import brooklyn.util.internal.BrooklynSystemProperties;
    +import brooklyn.util.net.Networking;
    +import brooklyn.util.text.Strings;
    +
    +import com.google.common.base.Throwables;
    +import com.google.common.collect.Lists;
    +import com.maxmind.geoip2.DatabaseReader;
    +import com.maxmind.geoip2.model.CityResponse;
    +import com.maxmind.geoip2.record.Subdivision;
    +
    +public class MaxMind2HostGeoLookup implements HostGeoLookup {
    +
    +    public static final Logger log = LoggerFactory.getLogger(MaxMind2HostGeoLookup.class);
    +    
    +    static final String MAXMIND_DB_URL = "http://dev.maxmind.com/geoip/geoip2/geolite2/#Downloads";
    +    // TODO this should be configurable from system property or brooklyn.properties
    +    // TODO and should use properties BrooklynServerConfig.MGMT_BASE_DIR (but hard to
get mgmt properties here!)
    +    static final String MAXMIND_DB_PATH = System.getProperty("user.home")+"/"+".brooklyn/"+"GeoLite2-City.mmdb";
    --- End diff --
    
    Would be good to externalise this as a config key so can be set in brooklyn.properties
etc. But not needed in this PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message