Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.Role


    public void addDescriptor(Object newDescriptor) {
        if (newDescriptor instanceof SecurityRoleMapping) {
            SecurityRoleMapping roleMap = (SecurityRoleMapping) newDescriptor;
            descriptor.addSecurityRoleMapping(roleMap);
            if (descriptor!=null && !descriptor.isVirtual()) {
                Role role = new Role(roleMap.getRoleName());
                SecurityRoleMapper rm = descriptor.getRoleMapper();
                if (rm != null) {
                    List<PrincipalNameDescriptor> principals = roleMap.getPrincipalNames();
                    for (int i = 0; i < principals.size(); i++) {
                        rm.assignRole(principals.get(i).getPrincipal(),
View Full Code Here


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

    /** Returns an Enumeration of my SecurityRole objects. */
    public Enumeration getSecurityRoles() {
        Vector securityRoles = new Vector();

        for (Iterator itr = super.getRoles().iterator(); itr.hasNext();) {
            Role r = (Role) itr.next();
            SecurityRoleDescriptor srd = new SecurityRoleDescriptor(r);
            securityRoles.add(srd);
        }

        return securityRoles.elements();
View Full Code Here

        return securityRoles.elements();
    }

    /** Add a new abstrct role to me. */
    public void addSecurityRole(SecurityRole securityRole) {
        Role r = new Role(securityRole.getName());
        r.setDescription(securityRole.getDescription());
        super.addRole(r);
    }
View Full Code Here

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

            // store it in the application using pure DOL descriptors...
            Application app = descriptor.getApplication();

            if (app != null) {
                Role role = new Role(srm.getRoleName());
                SecurityRoleMapper rm = app.getRoleMapper();

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

    /**
     * Return the role object from this descriptor.
     * @return the role.
     */
    public Role getRole() {
  return new Role(super.getValue());
    }
View Full Code Here

            }
           
            if(_logger.isLoggable(Level.FINE)){
                _logger.log(Level.FINE, "Default role is: " +  defaultRoleName);
            }
            defaultRole = new Role(defaultRoleName);
        }
    }
View Full Code Here

    public RoleMapper(RoleMapper r){
        this.appName = r.getName();
        for(Iterator it = r.getRoles();it.hasNext(); ){
            String role = (String) it.next();
            // recover groups
            Enumeration groups = r.getGroupsAssignedTo(new Role(role));
            Set<Group> groupsToRole = new HashSet<Group>();
            for(;groups.hasMoreElements(); ){
                Group gp = (Group) groups.nextElement();
                groupsToRole.add(new Group(gp.getName()));
                addRoleToPrincipal(gp,role);
            }
            this.roleToGroup.put(role,groupsToRole);
           
            // recover principles
            Enumeration users = r.getUsersAssignedTo(new Role(role));
            Set<Principal> usersToRole = new HashSet<Principal>();
            for(;users.hasMoreElements(); ){
                PrincipalImpl gp = (PrincipalImpl) users.nextElement();
                usersToRole.add(new PrincipalImpl(gp.getName()));
                addRoleToPrincipal(gp,role);
View Full Code Here

  // run through each of the ejb's role references, checking that the roles exist in this bundle
  for (Iterator itr = this.getEjbs().iterator(); itr.hasNext();) {
      EjbDescriptor ejbDescriptor = (EjbDescriptor) itr.next();
      for (Iterator roleRefs = ejbDescriptor.getRoleReferences().iterator(); roleRefs.hasNext();) {
    RoleReference roleReference = (RoleReference) roleRefs.next();
    Role referredRole = roleReference.getRole();
    if (!referredRole.getName().equals("")
        && !super.getRoles().contains(referredRole) ) {
     
        _logger.log(Level.FINE,localStrings.getLocalString(
         "enterprise.deployment.badrolereference",
         "Warning: Bad role reference to {0}", new Object[] {referredRole}));
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.Role

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.