protected void validateJDBC(JDBCSecurityServiceConfig config) throws SecurityConfigException { if (isNotEmpty(config.getDriverClassName())==false) throw createSecurityException(DRIVER_CLASSNAME_REQUIRED); if (isNotEmpty(config.getUserName())==false) throw createSecurityException(USERNAME_REQUIRED); if (isNotEmpty(config.getConnectURL())==false) throw createSecurityException(JDBCURL_REQUIRED); try { Class.forName(config.getDriverClassName()); } catch (ClassNotFoundException e) { throw createSecurityException(DRIVER_CLASS_NOT_FOUND_$1, config.getDriverClassName()); } }
protected void validateJNDI(JDBCSecurityServiceConfig config) throws SecurityConfigException { if (isNotEmpty(config.getJndiName())==false) throw createSecurityException(JNDINAME_REQUIRED); }
@Override public void validate(SecurityAuthProviderConfig config) throws SecurityConfigException { super.validate(config); JDBCConnectAuthProviderConfig jdbcConfig = (JDBCConnectAuthProviderConfig) config; if (isNotEmpty(jdbcConfig.getDriverClassName())==false) throw createSecurityException(DRIVER_CLASSNAME_REQUIRED); if (isNotEmpty(jdbcConfig.getConnectURL())==false) throw createSecurityException(JDBCURL_REQUIRED); try { Class.forName(jdbcConfig.getDriverClassName()); } catch (ClassNotFoundException e) { throw createSecurityException(DRIVER_CLASS_NOT_FOUND_$1, jdbcConfig.getDriverClassName()); } } }
protected void validateFileNames(JDBCSecurityServiceConfig config, String defaultDDL, String defaultDML) throws SecurityConfigException { String fileName = config.getPropertyFileNameDDL(); // ddl may be null if (isNotEmpty(fileName)) { if (defaultDDL.equals(fileName)==false) { // not the default property file File file = new File(fileName); if (checkFile(file)==false) { throw createSecurityException(DDL_FILE_INVALID, fileName); } } } fileName = config.getPropertyFileNameDML(); if (isNotEmpty(fileName)==false) { // dml file is required throw createSecurityException(DML_FILE_REQUIRED); } if (defaultDML.equals(fileName)==false) { // not the default property file File file = new File(fileName); if (checkFile(file)==false) { throw createSecurityException(DML_FILE_INVALID, fileName); } } }
protected void checkAutomaticTableCreation (JDBCSecurityServiceConfig config) throws SecurityConfigException { if (config.isCreatingTables()) { if (isNotEmpty(config.getPropertyFileNameDDL())==false) throw createSecurityException(DDL_FILE_REQUIRED); } }