for (int i = 0; i < data.getModules().length; i++) {
LoginModuleDetails details = data.getModules()[i];
if (details.getLoginDomainName() == null || details.getLoginDomainName().equals("")) {
continue;
}
GerLoginModuleType module = login.addNewLoginModule();
module.setControlFlag(details.getControlFlag().equals("OPTIONAL") ? GerControlFlagType.OPTIONAL :
details.getControlFlag().equals("REQUIRED") ? GerControlFlagType.REQUIRED :
details.getControlFlag().equals("REQUISITE") ? GerControlFlagType.REQUISITE :
details.getControlFlag().equals("SUFFICIENT") ? GerControlFlagType.SUFFICIENT :
GerControlFlagType.OPTIONAL);
module.setServerSide(details.isServerSide());
module.setLoginDomainName(details.getLoginDomainName());
module.setLoginModuleClass(details.getClassName());
module.setWrapPrincipals(details.isWrapPrincipals());
for (Iterator it = details.getOptions().entrySet().iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
GerOptionType option = module.addNewOption();
option.setName((String) entry.getKey());
option.setStringValue((String) entry.getValue());
}
// bit of a hack -- to put the DataSource module in as a parent for SQL modules