Package com.sun.enterprise.deployment.runtime.common

Examples of com.sun.enterprise.deployment.runtime.common.WLSecurityRoleAssignment


        if (newDescriptor instanceof EnvironmentProperty) {
            descriptor.addApplicationParam((ApplicationParameter)newDescriptor);
        } else if (newDescriptor instanceof WLModuleDescriptor) {
            descriptor.addWLModule((WLModuleDescriptor)newDescriptor);
        } else if (newDescriptor instanceof WLSecurityRoleAssignment) {
            WLSecurityRoleAssignment roleMap = (WLSecurityRoleAssignment) newDescriptor;
            if (descriptor!=null && !descriptor.isVirtual()) {
                descriptor.addWLRoleAssignments(roleMap);
                Role role = new Role(roleMap.getRoleName());
                SecurityRoleMapper rm = descriptor.getRoleMapper();
                if (rm != null) {
                    if(roleMap.isExternallyDefined()){
                        rm.assignRole(new Group(roleMap.getRoleName()),
                                role, descriptor);
                    } else {
                        List<String> principals = roleMap.getPrincipalNames();
                        for (int i = 0; i < principals.size(); i++) {
                            rm.assignRole(new PrincipalImpl(principals.get(i)),
                                    role, descriptor);
                        }
                    }
View Full Code Here


     *                                              
     * @param element the xml element               
     * @param value it's associated value
     */
    public void setElementValue(XMLElement element, String value) {
        WLSecurityRoleAssignment sra = (WLSecurityRoleAssignment) getDescriptor();
        if (RuntimeTagNames.ROLE_NAME.equals(element.getQName())) {
            sra.setRoleName(value);
        } else if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) {
            sra.addPrincipalName(value);
        } else if (RuntimeTagNames.EXTERNALLY_DEFINED.equals(element.getQName())) {
            sra.setExternallyDefined();
        } else {
            super.setElementValue(element, value);
        }
    }
View Full Code Here

        }
        return srm;
    }
    public void addDescriptor(Object newDescriptor) {
        if (newDescriptor instanceof WLSecurityRoleAssignment) {
            WLSecurityRoleAssignment roleMap = (WLSecurityRoleAssignment) newDescriptor;
            if (descriptor!=null) {
                descriptor.getSunDescriptor().addWLSecurityRoleAssignment(roleMap);
                Role role = new Role(roleMap.getRoleName());
                Application app = descriptor.getApplication();
                SecurityRoleMapper rm = null;
                if (app != null) {
                    rm = app.getRoleMapper();
                } else {
                    rm = getRoleMapper();
                }
                if (rm != null) {
                    if (roleMap.isExternallyDefined()) {
                        rm.assignRole(new Group(role.getName()), role, descriptor);
                    } else {
                        List<String> principals = roleMap.getPrincipalNames();
                        for (int i = 0; i < principals.size(); i++) {
                            rm.assignRole(new PrincipalImpl(principals.get(i)),
                                    role, descriptor);
                        }
                    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.runtime.common.WLSecurityRoleAssignment

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.