Package com.dianping.cat.service.IpService

Examples of com.dianping.cat.service.IpService.IpInfo


    String url = parseFormatUrl(targetUrl);

    if (url != null) {
      Transaction t = Cat.newTransaction("Monitor", url);
      String ip = entity.getIp();
      IpInfo ipInfo = m_ipService.findIpInfoByString(ip);

      try {
        if (ipInfo != null) {
          buildMessage(entity, url, ipInfo);
        } else {
View Full Code Here


  }

  private void processVersion2(Payload payload, HttpServletRequest request, String userIp) {
    String content = payload.getContent();
    String records[] = content.split("\n");
    IpInfo ipInfo = m_ipService.findIpInfoByString(userIp);

    if (ipInfo != null) {
      String province = ipInfo.getProvince();
      String operatorStr = ipInfo.getChannel();
      Integer cityId = m_appConfigManager.getCities().get(province);
      Integer operatorId = m_appConfigManager.getOperators().get(operatorStr);

      if (cityId != null && operatorId != null) {
        for (String record : records) {
View Full Code Here

  public void test() throws Exception {
    IpService service = (IpService) lookup(IpService.class);

    for (int i = 0; i < 10000; i++) {
      String ip = i % 255 + "." + i % 255 + "." + i % 255 + "." + i % 255;
      IpInfo info = service.findIpInfoByString(ip);

      if (info != null) {
        System.out.print(ip + " " + info.getChannel());
        System.out.print(" " + info.getCity());
        System.out.println(" " + info.getProvince());
      }
    }
  }
View Full Code Here

  public void test() throws Exception {
    IpService service = (IpService) lookup(IpService.class);

    for (int i = 0; i < 10000; i++) {
      String ip = i % 255 + "." + i % 255 + "." + i % 255 + "." + i % 255;
      IpInfo info = service.findIpInfoByString(ip);

      if (info != null) {
        System.out.print(ip + " " + info.getChannel());
        System.out.print(" " + info.getCity());
        System.out.println(" " + info.getProvince());
      }
    }
  }
View Full Code Here

      return cdn;
    } else if (!m_cdn.equals(cdn)) {
      return null;
    }

    IpInfo ipInfo = m_ipService.findIpInfoByString(sip);
    String province = ipInfo.getProvince();
    String city = ipInfo.getCity();

    if (m_province.equals(ALL)) {
      return province;
    } else if (!m_province.equals(province)) {
      return null;
View Full Code Here

TOP

Related Classes of com.dianping.cat.service.IpService.IpInfo

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.