Package com.maxmind.geoip

Examples of com.maxmind.geoip.Location


        }
            // Save the location information if valid, save the event without
            // location information if not valid
            if(locationService != null)
            {
                Location location = locationService.getLocation(ip);
                if (location != null
                        && !("--".equals(location.countryCode)
                        && location.latitude == -180 && location.longitude == -180))
                {
                    try
View Full Code Here


        }
            // Save the location information if valid, save the event without
            // location information if not valid
            if(locationService != null)
            {
                Location location = locationService.getLocation(ip);
                if (location != null
                        && !("--".equals(location.countryCode)
                        && location.latitude == -180 && location.longitude == -180))
                {
                    try
View Full Code Here

                }
      }
            ip = ipBuilder.toString();
           
      // 2 Depending on our ip get all the location info
      Location location;
      try {
        location = cl.getLocation(ip);
      } catch (Exception e) {
        location = null;
      }
View Full Code Here

                    searchengines++;
                    continue;
                }

                // Get the geo information for the user
                Location location;
                try {
                    location = geoipLookup.getLocation(ip);
                    city = location.city;
                    country = location.countryName;
                    countryCode = location.countryCode;
View Full Code Here

                    searchengines++;
                    continue;
                }

                // Get the geo information for the user
                Location location;
                try {
                    location = geoipLookup.getLocation(ip);
                    city = location.city;
                    country = location.countryName;
                    countryCode = location.countryCode;
View Full Code Here

            synchronized (peers){

                for (org.ethereum.net.peerdiscovery.PeerInfo peer : peers) {
                    InetAddress addr = peer.getAddress();
                    Location cr = IpGeoDB.getLocationForIp(addr);
                    peerInfoList.add(new PeerInfo(cr, addr, peer.isOnline(), peer.getLastCheckTime(),
                            peer.getHandshakeHelloMessage(), peer.getStatusMessage()));
                }
            }
        }
View Full Code Here

    private PeerInfo(Location location, InetAddress ip,
        boolean isConnected, long lastAccessed, HelloMessage helloMessage, StatusMessage statusMessage) {

            if (location == null)
                this.location = new Location();
            else
                this.location = location;

            this.ip = ip;
            this.connected = isConnected;
View Full Code Here

    public void testLookup() throws Exception {
        if (geoipLookup == null) {
            return;
        }
       
        Location loc = geoipLookup.getLocation("64.147.114.82");
        assertEquals("United States", loc.countryName);
        assertEquals("New York", loc.city);
       
        loc = geoipLookup.getLocation("192.168.1.103");
        assertNull(loc);
View Full Code Here

       
        if (geoIPLookup == null) {
            return;
        }
       
        Location loc = geoIPLookup.getLocation(data.getRemoteAddr());
        if (loc == null) {
            LOGGER.fine("Unable to obtain location for " + data.getRemoteAddr());
            return;
        }
       
View Full Code Here

        if (input == null || input.size() == 0) {
            return null;
        }
       
        String ip = (String)input.get(0);
        Location location = lookupService.getLocation(ip);
        if (location != null) {
            Tuple output = tupleFactory.newTuple(6);
            output.set(0, location.countryName != null ? location.countryName : EMPTY_STRING);
            output.set(1, location.countryCode != null ? location.countryCode : EMPTY_STRING);
            output.set(2, location.region != null ? location.region : EMPTY_STRING);
View Full Code Here

TOP

Related Classes of com.maxmind.geoip.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.