All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxmind.geoip.DatabaseInfo Maven / Gradle / Ivy

Go to download

SilverTunnel-NG Netlib is a free library for the Java programming language that implements and encapsulates all the complex network protocol stuff needed for anonymous communication over the Tor anonymity network. Netlib can be easily integrated in almost every existing and new Java application. The library requires Java 1.6/Java SE 6 or a newer version. The original silvertunnel Netlib can be found here : silvertunnel.org

There is a newer version: 0.0.5
Show newest version
/**
 * DatabaseInfo.java
 *
 * Copyright (C) 2003 MaxMind LLC.  All Rights Reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package com.maxmind.geoip;

// TODO : implement GeoIP2 from MaxMind via maven
/**
 * Encapsulates metadata about the GeoIP database. The database has a date, is a
 * premium or standard version, and is one of the following types:
 * 
 * 
    *
  • Country edition -- this is the most common version of the database. It * includes the name of the country and it's ISO country code given an IP * address. *
  • Region edition -- includes the country information as well as what U.S. * state or Canadian province the IP address is from if the IP address is from * the U.S. or Canada. *
  • City edition -- includes country, region, city, postal code, latitude, * and longitude information. *
  • Org edition -- includes country and netblock owner. *
  • ISP edition -- includes country, region, city, postal code, latitude, * longitude, ISP, and organization information. *
* * @author Matt Tucker */ public final class DatabaseInfo { /** */ // private static final Logger LOG = LoggerFactory.getLogger(DatabaseInfo.class); public static final int COUNTRY_EDITION = 1; public static final int REGION_EDITION_REV0 = 7; public static final int REGION_EDITION_REV1 = 3; public static final int CITY_EDITION_REV0 = 6; public static final int CITY_EDITION_REV1 = 2; public static final int ORG_EDITION = 5; public static final int ISP_EDITION = 4; public static final int PROXY_EDITION = 8; public static final int ASNUM_EDITION = 9; public static final int NETSPEED_EDITION = 10; private final String info; /** * Creates a new DatabaseInfo object given the database info String. * * @param info */ public DatabaseInfo(final String info) { this.info = info; } /** * Returns true if the database is the premium version. * * @return true if the premium version of the database. */ public boolean isPremium() { return info.indexOf("FREE") < 0; } @Override public String toString() { return info; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy