String realmName = (String) handlerCtx.getInputValue("realmName");
String configName = (String) handlerCtx.getInputValue("configName");
ConfigConfig config = AMXUtil.getDomainConfig().getConfigConfigMap().get(configName);
AuthRealmConfig authRealm = config.getSecurityServiceConfig().getAuthRealmConfigMap().get(realmName);
String className = authRealm.getClassname();
Class realm = null;;
try {
realm = Class.forName(className);
} catch (ClassNotFoundException ex) {
//TODO Fine Log
System.out.println("!!!!! ClassNotFound Exception for " + className);
ex.printStackTrace();
handlerCtx.setOutputValue("result", false);
return;
} catch (Exception ex1){
//TODO Fine Log
System.out.println("!!!!! Exception for " + className);
ex1.printStackTrace();
handlerCtx.setOutputValue("result", false);
return;
} catch(NoClassDefFoundError err1 ){
//TODO Fine log
System.out.println("!!!!! NoClassDefFoundError for " + className);
err1.printStackTrace();
handlerCtx.setOutputValue("result", false);
return;
}
Class baseClass = null;;
try {
baseClass = Class.forName("com.sun.enterprise.security.auth.realm.file.FileRealm");
} catch (ClassNotFoundException ex) {
//TODO Fine Log
System.out.println("The class: " +
"\"com.sun.enterprise.security.auth.realm.IASRealm\"" +
" was not found.");
handlerCtx.setOutputValue("result", false);
return;
} catch (Exception ex1){
//TODO Fine Log
ex1.printStackTrace();
handlerCtx.setOutputValue("result", false);
return;
}
if (realm == null || baseClass == null){
handlerCtx.setOutputValue("result", false);
return;
}
if (baseClass.isAssignableFrom(realm)){
Map<String, String> props = authRealm.getProperties();
String ja = props.get("jaas-context");
String file = props.get("file");
if (!GuiUtil.isEmpty(ja) && !GuiUtil.isEmpty(file)){
handlerCtx.setOutputValue("result", true);
}else