Ejemplo n.º 1
0
  public void systemDatabaseBackup(String dumpPath) throws MyAlumniBaseException {
    //  spring.properties  properties file.
    Properties prop = new Properties();
    String dbUser = new String();
    String dbPswd = new String();
    String dbIpAddress = new String();
    String dbName = new String();
    String dbPort = new String();
    String dbDialet = new String();
    String dbPath = new String();
    InputStream is = null;

    try {
      is = getClass().getResourceAsStream("/spring.properties");
      prop.load(is);
      dbUser = prop.getProperty("username");
      dbPswd = prop.getProperty("password");
      dbIpAddress = prop.getProperty("dbip");
      dbName = prop.getProperty("dbname");
      dbPort = prop.getProperty("dbport");
      dbDialet = prop.getProperty("hibernate.dialect");
      dbPath = prop.getProperty("dbpath");

      if (!(new File(dbPath).exists())) {
        throw new MyAlumniBaseException("myalumni.errorcode.00005");
      }

      if (dbDialet != null && dbDialet.endsWith(DBHelper.DIALET_MYSQL)) {
        dbDialet = DBHelper.DB_TYPE_MYSQL;
      } else if (dbDialet != null && dbDialet.endsWith(DBHelper.DIALET_DB2)) {
        dbDialet = DBHelper.DB_TYPE_DB2;
      } else if (dbDialet != null && dbDialet.endsWith(DBHelper.DIALET_ORACLE)) {
        dbDialet = DBHelper.DB_TYPE_ORACLE;
      } else if (dbDialet != null && dbDialet.endsWith(DBHelper.DIALET_POSTGRESQL)) {
        dbDialet = DBHelper.DB_TYPE_POSTGRESQL;
      } else if (dbDialet != null && dbDialet.endsWith(DBHelper.DIALET_SYBASE)) {
        dbDialet = DBHelper.DB_TYPE_SYBASE;
      }
    } catch (IOException e) {
      // logger.error(e.getMessage());
      throw new MyAlumniBaseException(
          "myalumni.errorcode.00003"); // Unable to read spring properties file.
    } finally {
      try {
        if (is != null) {
          is.close();
        }
      } catch (IOException exception) {
        // ignored
      }
    }
    systemTasksDao.systemDatabaseBackup(
        dbName, dbDialet, dbUser, dbPswd, dbIpAddress, dbPort, dumpPath, dbPath);
  }
Ejemplo n.º 2
0
 public EmailExceptionVO getEmailException(String id) {
   return systemTasksDao.getEmailException(id);
 }
Ejemplo n.º 3
0
 public void deleteLogEmailException(EmailExceptionVO email) {
   systemTasksDao.deleteLogEmailException(email);
 }
Ejemplo n.º 4
0
 public List getAllEmailExceptions() {
   return systemTasksDao.getAllEmailExceptions();
 }
Ejemplo n.º 5
0
 public void logEmailException(EmailExceptionVO email) {
   systemTasksDao.logEmailException(email);
 }