*/
public void configure() {
configured = true;
if(dataSource == null) {
throw new FtpServerConfigurationException("Required data source not provided");
}
if(insertUserStmt == null) {
throw new FtpServerConfigurationException("Required insert user SQL statement not provided");
}
if(updateUserStmt == null) {
throw new FtpServerConfigurationException("Required update user SQL statement not provided");
}
if(deleteUserStmt == null) {
throw new FtpServerConfigurationException("Required delete user SQL statement not provided");
}
if(selectUserStmt == null) {
throw new FtpServerConfigurationException("Required select user SQL statement not provided");
}
if(selectAllStmt == null) {
throw new FtpServerConfigurationException("Required select all users SQL statement not provided");
}
if(isAdminStmt == null) {
throw new FtpServerConfigurationException("Required is admin user SQL statement not provided");
}
if(authenticateStmt == null) {
throw new FtpServerConfigurationException("Required authenticate user SQL statement not provided");
}
try {
// test the connection
createConnection();
LOG.info("Database connection opened.");
}
catch(SQLException ex) {
LOG.error("DbUserManager.configure()", ex);
throw new FtpServerConfigurationException("DbUserManager.configure()", ex);
}
}