示例#1
0
文件: Handler.java 项目: ryanjin/cat
 private boolean validate(String errorCode, String httpStatus) {
   try {
     if (StringUtils.isNotEmpty(errorCode) && !Constrants.NOT_SET.equals(errorCode)) {
       Double.parseDouble(errorCode);
     }
     if (StringUtils.isNotEmpty(httpStatus) && !Constrants.NOT_SET.equals(httpStatus)) {
       Double.parseDouble(httpStatus);
     }
     return true;
   } catch (Exception e) {
     return false;
   }
 }
示例#2
0
 private boolean projectContains(String projectName, String app, String ip, String role) {
   if (m_remoteIp.startsWith("All")) {
     if (m_remoteProject.startsWith("AllClient")
         && (role.endsWith("Client") || role.endsWith("Caller"))) {
       return true;
     } else if (m_remoteProject.startsWith("AllServer") && role.endsWith("Server")) {
       return true;
     }
     if (StringUtils.isNotEmpty(app)) {
       if (app.equalsIgnoreCase(projectName)) {
         return true;
       }
     } else {
       if (ip.indexOf(':') > 0) {
         ip = ip.substring(0, ip.indexOf(':'));
       }
       String domain = m_hostinfoService.queryDomainByIp(ip);
       if (projectName.equalsIgnoreCase(domain)) {
         return true;
       }
     }
     return false;
   }
   return false;
 }