예제 #1
0
 @Override
 public void setLuckyNum(String issue, String luckyNum) {
   if (agentCommConfig != null) {
     int i = 0;
     int len = agentCommConfig.getAgent().getIssues().getIssue().length;
     for (; i < len; i++) {
       // Verify if it's the desired issue!
       Issue iss = agentCommConfig.getAgent().getIssues().getIssue(i);
       if (issue.trim().equalsIgnoreCase(iss.getIssueNumber())) {
         iss.setBonusCode(luckyNum);
         iss.setStatus("5");
         break;
       }
     }
     if (i >= len) {
       log.error(
           "In setLuckyNum: maybe set the wrong issue number,pls check the configure file!\n "
               + "The issue set is:"
               + issue);
     }
   }
 }
예제 #2
0
 @Override
 public void init(AgentCommConfig agentConfig) {
   agentCommConfig = agentConfig;
   String ftpUrlport[] = agentCommConfig.getFtpUrlPort();
   if (ftpUrlport != null) {
     // Start the ftp server!
     int port = 21;
     try {
       port = Integer.parseInt(ftpUrlport[1]);
     } catch (Exception e) {
       port = 21;
     }
     Fserver ftpServer = new Fserver(port);
     ftpServer.start();
   }
 }