예제 #1
0
 public void run() {
   int numOfCdrs = 0;
   // System.out.println("Getting data from queue table");
   Logger.info("CDRServer:", "Getting data from queue table");
   while (CDRServer.running) {
     try {
       this.readCDRinQueueEx();
       if ("VMS".equals(Preference.mobileOperator.toUpperCase())) {
         // CdrFileCopier4vms cdrcopy = new CdrFileCopier4vms();
         // System.out.println("Starting FTP");
         Logger.info("FTP:", " starting FTP cdr file");
         Ftp2CdrServer ftp = new Ftp2CdrServer(); // .start();
         ftp.runftp();
       } else {
         // System.out.println("Invalid mobile operator: " +
         // Preference.mobileOperator);
         Logger.info("Invalid mobile operator:", Preference.mobileOperator);
         exit();
       }
       sleep10Minutes();
     } catch (InterruptedException ex) {
     } catch (DBException ex) { // when lost connection to db
       // System.out.println("DBScanner::" + ex.getMessage());
       Logger.info("DBScanner:", ex.getMessage());
       try {
         dbTools.log_alert(
             "Billing system",
             "-> ERROR: Ket noi Database bi loi: " + ex.getMessage(),
             1,
             0,
             "serious",
             Preference.alert_person);
       } catch (Exception e) {
       }
       GatewayCDR.rebuildDBConnections(1); // 1 connection
     } catch (Exception ex) {
       // System.out.println("DBScanner::" + ex.getMessage());
       Logger.info("DBScanner:", ex.getMessage());
       try {
         // dbTools.log_alert(Preference.sourceAddressList.toString(),
         // "CDR->DBSCanner",
         // "<-" + Preference.mobileOperator + "-> ERROR: " +
         // ex.getMessage(),
         // 1, Preference.alert_person,
         // Preference.alert_mobile);
         dbTools.log_alert(
             "Billing system",
             "-> ERROR: Loi dinh dang MOBILE OPERATOR: " + ex.getMessage(),
             1,
             0,
             "serious",
             Preference.alert_person);
       } catch (Exception e) {
       }
     }
   }
 }
예제 #2
0
 private void showMenu()
 {
     String option = "";
     try
     {
         option = keyboard.readLine();
         if("Q".equals(option.toUpperCase()))
         {
             CDRServer _tmp = this;
             exit();
         }
     }
     catch(Exception e)
     {
         Logger.info("CDRServer:", e.getMessage());
     }
 }