Package com.maxmind.geoip

Examples of com.maxmind.geoip.Country


   * @param date  The date to use for the increment.
   * @throws IOException When updating the counter fails.
   */
  public void incrementUsage(String shortId, RequestInfo info, long incrBy,
      Date date) throws IOException {
    Country country = null;
    if (info != null) {
      country = rm.getCountry(info.get(RequestInfo.InfoName.RemoteAddr));
    }
    // increment user statistics
    HTable table = rm.getTable(ShortUrlTable.NAME);
    byte[] rowKey = Bytes.toBytes(shortId);
    Increment increment = new Increment(rowKey);
    increment.addColumn(ShortUrlTable.DATA_FAMILY, ShortUrlTable.CLICKS,
      incrBy);
    addIncrement(increment, StatisticsCategory.CLICK, date, null, incrBy);
    if (country != null) {
      addIncrement(increment, StatisticsCategory.COUNTRY, date,
        country.getCode(), incrBy);
    }
    table.increment(increment);
    rm.putTable(table);
  }
View Full Code Here

TOP

Related Classes of com.maxmind.geoip.Country

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.