public void load()

in plugins/console/plugin-portlets/src/main/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java [848:933]


        public void load(PortletRequest request) {
            name = request.getParameter("name");
            if (name != null && name.equals("")) name = null;
            realmType = request.getParameter("realmType");
            if (realmType != null && realmType.equals("")) realmType = null;
            jar = request.getParameter("jar");
            if (jar != null && jar.equals("")) jar = null;
            auditPath = request.getParameter("auditPath");
            if (auditPath != null && auditPath.equals("")) auditPath = null;
            lockoutCount = request.getParameter("lockoutCount");
            if (lockoutCount != null && lockoutCount.equals("")) lockoutCount = null;
            lockoutWindow = request.getParameter("lockoutWindow");
            if (lockoutWindow != null && lockoutWindow.equals("")) lockoutWindow = null;
            lockoutDuration = request.getParameter("lockoutDuration");
            if (lockoutDuration != null && lockoutDuration.equals("")) lockoutDuration = null;
            abstractName = request.getParameter("abstractName");
            if (abstractName != null && abstractName.equals("")) abstractName = null;
            String test = request.getParameter("storePassword");
            storePassword = test != null && !test.equals("") && !test.equals("false");
            credentialName = request.getParameter("credentialName");
            if (credentialName != null && credentialName.equals("")) credentialName = null;
            String globalStr = request.getParameter("global");
            global = "on".equals(globalStr) || "true".equals(globalStr);
            Map map = request.getParameterMap();
            for (Iterator it = map.keySet().iterator(); it.hasNext();) {
                String key = (String) it.next();
                if (key.startsWith("option-")) {
                    if (key.equals("option-databasePoolAbstractName"))
                    { // special handling for a data source, where there's one select corresponding to two properties
                        String nameString = request.getParameter(key);
                        if (nameString != null && !nameString.equals("")) {
                            AbstractName an = new AbstractName(URI.create(nameString));
                            options.put("dataSourceName", an.getNameProperty(NameFactory.J2EE_NAME));
                            options.put("dataSourceApplication", an.getNameProperty(NameFactory.J2EE_APPLICATION));
                        }
                    } else {
                        final String optionName = key.substring(7);
                        final String value = request.getParameter(key);
                        if (value != null && !value.equals("")) {
                            options.put(optionName, value);
                        }
                    }
                }
            }
            int count = 0;
            List list = new ArrayList();
            while (true) {
                int index = count;
                ++count;
                String name = request.getParameter("module-domain-" + index);
                if (name == null || name.equals("")) break;
                LoginModuleDetails details = new LoginModuleDetails();
                details.setLoginDomainName(name);
                String cls = request.getParameter("module-class-" + index);
                if (cls == null || cls.equals("")) continue;
                details.setClassName(cls);
                String flag = request.getParameter("module-control-" + index);
                if (flag == null || flag.equals("")) continue;
                details.setControlFlag(toFlag(flag));
                String wrap = request.getParameter("module-wrap-" + index);
                if (wrap == null || wrap.equals("")) continue;
                details.setWrapPrincipals(Boolean.valueOf(wrap).booleanValue());
                String options = request.getParameter("module-options-" + index);
                if (options != null && !options.equals("")) {
                    BufferedReader in = new BufferedReader(new StringReader(options));
                    String line;
                    try {
                        while ((line = in.readLine()) != null) {
                            if (line.startsWith("#") || line.equals("")) {
                                continue;
                            }
                            int pos = line.indexOf('=');
                            if (pos > -1) {
                                details.getOptions().put(line.substring(0, pos), line.substring(pos + 1));
                            }
                        }
                    } catch (IOException e) {
                        log.error("Unable to read properties '" + options + "'", e);
                    }
                }
                list.add(details);
            }
            if (list.size() > 0) {
                modules = (LoginModuleDetails[]) list.toArray(new LoginModuleDetails[list.size()]);
            }
        }