Package com.sun.appserv.management.config

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


        @HandlerInput(name="Realms",      type=String.class),
        @HandlerInput(name="AddProps", type=Map.class),
        @HandlerInput(name="RemoveProps", type=ArrayList.class)})   
    public static void saveSecuritySettings(HandlerContext handlerCtx) {
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
        ArrayList removeProps = (ArrayList)handlerCtx.getInputValue("RemoveProps");
        Map addProps = (Map)handlerCtx.getInputValue("AddProps");
        String[] remove = (String[])removeProps.toArray(new String[ removeProps.size()]);
        for(int i=0; i<remove.length; i++){
            sConfig.removeProperty(remove[i]);
        }
        if(addProps != null ){
            Iterator additer = addProps.keySet().iterator();
            while(additer.hasNext()){
                Object key = additer.next();
                String addvalue = (String)addProps.get(key);
                sConfig.setPropertyValue((String)key, addvalue);
               
            }
        }             
        sConfig.setAuditEnabled(((Boolean)handlerCtx.getInputValue("Audit")).booleanValue());
        sConfig.setDefaultPrincipal(((String)handlerCtx.getInputValue("Principal")));
        sConfig.setDefaultPrincipalPassword(((String)handlerCtx.getInputValue("Password")));
        sConfig.setActivateDefaultPrincipalToRoleMapping(((Boolean)handlerCtx.getInputValue("RoleMapping")).booleanValue());
        sConfig.setMappedPrincipalClass(((String)handlerCtx.getInputValue("Mapped")));
        sConfig.setJACC((String)handlerCtx.getInputValue("Jaccs"));
        sConfig.setAuditModules((String)handlerCtx.getInputValue("Modules"));
        sConfig.setDefaultRealm((String)handlerCtx.getInputValue("Realms"));
       
    }   
View Full Code Here


        @HandlerOutput(name="Modules", type=String.class),
        @HandlerOutput(name="Realms", type=String.class),
        @HandlerOutput(name="SecurityManager", type=String.class)})    
        public static void getSecurityDefaultAttributes(HandlerContext handlerCtx) {
        ConfigConfig config = AMXUtil.getConfig(((String)handlerCtx.getInputValue("ConfigName")));
        SecurityServiceConfig sConfig = config.getSecurityServiceConfig();
        String audit = sConfig.getDefaultValue("AuditEnabled");
        String principal = sConfig.getDefaultValue("DefaultPrincipal");
        String password = sConfig.getDefaultValue("DefaultPrincipalPassword");
        String roleMapping = sConfig.getDefaultValue("ActivateDefaultPrincipalToRoleMapping");
        String mapped = sConfig.getDefaultValue("MappedPrincipalClass");
        String jaccs = sConfig.getDefaultValue("JACC") ;
        String modules = sConfig.getDefaultValue("AuditModules");
        String realms = sConfig.getDefaultValue("DefaultRealm");

        if(audit.equals("true")) {
            handlerCtx.setOutputValue("Audit", true);   
        } else {
            handlerCtx.setOutputValue("Audit", false);
View Full Code Here

        String user = request.getRemoteUser();
        handlerCtx.setOutputValue("UserId", user);
       
        //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]);
View Full Code Here

        @HandlerInput(name="Password", type=String.class, required=true)})

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

        @HandlerInput(name="Password", type=String.class, required=true)})

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

        @HandlerOutput(name="GroupList",     type=String.class)})

        public static void getUserInfo(HandlerContext handlerCtx) {
        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]);
View Full Code Here

TOP

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

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.