Package com.sun.enterprise.deployment.interfaces

Examples of com.sun.enterprise.deployment.interfaces.SecurityRoleMapperFactory


                         
                    // application loaded
                    deployed = true;

                    SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

                    if (factory==null) {
                        throw new IllegalArgumentException(localStrings.getString(
                        "enterprise.deployment.deployment.norolemapperfactorydefine",
                        "This application has no role mapper factory defined"));
View Full Code Here


        try {
            roleMapper = getRoleMapper();
        } catch(IllegalArgumentException ignore) {};
       
        if (roleMapper!=null) {
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();
            if (factory==null) {
                throw new IllegalArgumentException(localStrings.getLocalString(
                    "enterprise.deployment.norolemapperfactorydefine",
                    "This application has no role mapper factory defined"));
            }
      factory.removeRoleMapper(getName());
            roleMapper.setName(appId);
            factory.setRoleMapper(appId, roleMapper);
        }
       
        this.registrationName = appId;       
    }
View Full Code Here

     * Return my mapping of rolename to users and groups on a particular
     * server.
     */
    public SecurityRoleMapper getRoleMapper() {
  if (this.roleMapper == null) {
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();
            if (factory==null) {
                _logger.log(Level.FINE, "SecurityRoleMapperFactory NOT set.");
            } else {
          this.roleMapper = factory.getRoleMapper(this.getName());
            }                   
  }
  return this.roleMapper;
    }
View Full Code Here

                String sn = servlet.getServletName();
                runAsMap.put(sn, prinName);
            }
        } else {
            SecurityRoleMapping[] srmList =  getSipApplication().getSunSipDescriptor().getSecurityRoleMapping();
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();
            Iterator<String> itr = sipApplication.getServletNames();
            while (itr.hasNext()) {
                String servletName = itr.next();
                String roleName = sipApplication.getRunAsRoleName(servletName);
                if (roleName != null && roleName.length() > 0) {
View Full Code Here

            SipBundleDescriptor sbd = (SipBundleDescriptor) descriptor;
            SunWebApp sunSipDesc = sbd.getSipApplication().getSunSipDescriptor();
            SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

            //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
            SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

            //super.getDescriptor().getApplication().getRoleMapper().getName();
            if (srmList == null) {
                return;
            }

            for (int si = 0; si < srmList.length; si++) {
                SecurityRoleMapping srm = srmList[si];
                Role role = new Role(srm.getRoleName());
                SecurityRoleMapper rm = factory.getRoleMapper(name);

                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = srm.getPrincipalNames();

                    for (int i = 0; i < principals.size(); i++) {
View Full Code Here

            } else {

                SecurityRoleMapping[] srmList = sunSipDesc.getSecurityRoleMapping();

                //SecurityRoleMapping[] srmList = ((WebBundleDescriptor) descriptor).getSunDescriptor().getSecurityRoleMapping();
                SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryMgr.getFactory();

                //super.getDescriptor().getApplication().getRoleMapper().getName();
                if (srmList == null) {
                    return runAs;
                }
View Full Code Here

            roleMapper = getRoleMapper();
        } catch (IllegalArgumentException ignore) {
        }

        if (roleMapper != null) {
            SecurityRoleMapperFactory factory = habitat.getComponent(SecurityRoleMapperFactory.class);
            if (factory == null) {
                throw new IllegalArgumentException(localStrings.getLocalString(
                        "enterprise.deployment.norolemapperfactorydefine",
                        "This application has no role mapper factory defined"));
            }
            factory.removeRoleMapper(getName());
            roleMapper.setName(appId);
            factory.setRoleMapper(appId, roleMapper);
        }

        this.registrationName = appId;
    }
View Full Code Here

     * Return my mapping of rolename to users and groups on a particular
     * server.
     */
    public SecurityRoleMapper getRoleMapper() {
        if (this.roleMapper == null) {
            SecurityRoleMapperFactory factory = habitat.getComponent(SecurityRoleMapperFactory.class);
            if (factory == null) {
                _logger.log(Level.FINE, "SecurityRoleMapperFactory NOT set.");
            } else {
                this.roleMapper = factory.getRoleMapper(this.getName());
            }
        }
        return this.roleMapper;
    }
View Full Code Here

    private SecurityRoleMapper getRoleMapper(){
        Habitat habitat = Globals.getDefaultHabitat();
        SecurityRoleMapper srm = null;
        if(habitat != null){
            SecurityRoleMapperFactory srmf = habitat.getComponent(SecurityRoleMapperFactory.class);
            if(srmf != null){
                srm = srmf.getRoleMapper(descriptor.getModuleDescriptor().getModuleName());
            }
        }
        return srm;
    }
View Full Code Here

        }
    }

    private SecurityRoleMapper getInternalMapper(String pcid) {

        SecurityRoleMapperFactory factory = Globals.get(SecurityRoleMapperFactory.class);
                //SecurityRoleMapperFactoryMgr.getFactory();

        if (factory == null) {
            String msg = "RoleMapper.factory.lookup.failed";
            logger.log(Level.SEVERE, msg);
            throw new SecurityException(msg);
        }

        SecurityRoleMapper srm = factory.getRoleMapper(pcid);

        if (srm == null) {
            String msg = "RoleMapper.mapper.lookup.failed";
            logger.log(Level.SEVERE, msg);
            throw new SecurityException(msg);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.interfaces.SecurityRoleMapperFactory

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.