Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.AuthRealmConfig


        //Group Lists
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
        Map<String,AuthRealmConfig>realms = sConfig.getAuthRealmConfigMap();
        StringBuffer groupList = new StringBuffer();
        AuthRealmConfig aRealm = (AuthRealmConfig)realms.get((String)handlerCtx.getInputValue("Realm"));
        String[] gl = aRealm.getUserGroupNames(user);
        for(int i=0; i< gl.length; i++) {
            groupList.append(","+gl[i]);
        }
        if (groupList.length() > 0)
            groupList.deleteCharAt(0)
View Full Code Here


        public static void saveUser(HandlerContext handlerCtx) {
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        try{
            SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
            Map<String,AuthRealmConfig>realms = sConfig.getAuthRealmConfigMap();
            AuthRealmConfig aRealm = (AuthRealmConfig)realms.get((String)handlerCtx.getInputValue("Realm"));
            String grouplist = (String)handlerCtx.getInputValue("GroupList");
            String[] groups = GuiUtil.stringToArray(grouplist, ",");
            String password = (String)handlerCtx.getInputValue("Password");
            String userid = (String)handlerCtx.getInputValue("UserId");
            aRealm.updateUser(userid, password, groups);
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

        public static void addUser(HandlerContext handlerCtx) {
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        try{
            SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
            Map<String,AuthRealmConfig>realms = sConfig.getAuthRealmConfigMap();
            AuthRealmConfig aRealm = (AuthRealmConfig)realms.get((String)handlerCtx.getInputValue("Realm"));
            String grouplist = (String)handlerCtx.getInputValue("GroupList");
            String[] groups = GuiUtil.stringToArray(grouplist, ",");
            String password = (String)handlerCtx.getInputValue("Password");
            String userid = (String)handlerCtx.getInputValue("UserId");
            aRealm.addUser(userid, password, groups);
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }    
View Full Code Here

        String user = (String)handlerCtx.getInputValue("User");   
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
        Map<String,AuthRealmConfig>realms = sConfig.getAuthRealmConfigMap();
        StringBuffer groupList = new StringBuffer();
        AuthRealmConfig aRealm = (AuthRealmConfig)realms.get((String)handlerCtx.getInputValue("Realm"));
        String[] gl = aRealm.getUserGroupNames(user);
        for(int i=0; i< gl.length; i++) {
            groupList.append(","+gl[i]);
        }
        if (groupList.length() > 0)
            groupList.deleteCharAt(0)
View Full Code Here

        String realm = (String) handlerCtx.getInputValue("Realm");
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        List result = new ArrayList();
        try{
            Map<String,AuthRealmConfig>realms = config.getSecurityServiceConfig().getAuthRealmConfigMap();
            AuthRealmConfig aRealm = (AuthRealmConfig)realms.get(realm);
            String[] users = aRealm.getUserNames();
            if(users != null) {
                Map<String, Object> map = null;
                for (Object val : users) {
                    map = new HashMap<String, Object>();
                    map.put("users", val);
View Full Code Here

       
        String realm = (String) handlerCtx.getInputValue("Realm");
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        try{
            Map<String,AuthRealmConfig>realms = config.getSecurityServiceConfig().getAuthRealmConfigMap();
            AuthRealmConfig aRealm = (AuthRealmConfig)realms.get(realm);
            List obj = (List) handlerCtx.getInputValue("selectedRows");
            List<Map> selectedRows = (List) obj;
           
            for(Map oneRow : selectedRows){
                String user = (String)oneRow.get("users");
                aRealm.removeUser(user);
            }
        }catch(Exception ex){
            GuiUtil.handleException(handlerCtx, ex);
        }
    }
View Full Code Here

       
        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
View Full Code Here

        StringBuffer groupNames = null;
        //Group Lists
        ConfigConfig config = AMXUtil.getConfig(configName);
        Map<String,AuthRealmConfig>realms = config.getSecurityServiceConfig().getAuthRealmConfigMap();
        groupNames = new StringBuffer();
        AuthRealmConfig aRealm = (AuthRealmConfig)realms.get(realm);
        groupList = aRealm.getUserGroupNames(userName);
        for(int i=0; i< groupList.length; i++) {
            groupNames.append(","+groupList[i]);
        }
        if (groupNames.length() > 0)
            groupNames.deleteCharAt(0)
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.AuthRealmConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.