Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.SecurityRolesMetaData


   {
      JBossAssemblyDescriptorMetaData assemblyDescriptor = getJBossMetaDataWithCheck().getAssemblyDescriptor();
      if (assemblyDescriptor == null)
         return null;
     
      SecurityRolesMetaData securityRolesMetaData = assemblyDescriptor.getSecurityRoles();
      return securityRolesMetaData != null ? securityRolesMetaData.getPrincipalVersusRolesMap() : null;
   }
View Full Code Here


      assertMyMDB(metaData.getEnterpriseBean("MailMDB"));

      JBossAssemblyDescriptorMetaData assembly = metaData.getAssemblyDescriptor();

      // @DeclareRoles
      SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
      assertNotNull(securityRoles);
      assertEquals(2, securityRoles.size());
      SecurityRoleMetaData role1 = securityRoles.get("Role1");
      assertNotNull(role1);
      assertEquals("Role1", role1.getRoleName());
      SecurityRoleMetaData role2 = securityRoles.get("Role2");
      assertNotNull(role2);
      assertEquals("Role2", role2.getRoleName());

      // @DenyAll
      // cls.getDeclaredMethods is un-ordered, so we must use bestMatch
View Full Code Here

      assertNotNull("no application exceptions defined", assembly.getApplicationExceptions());
      assertEquals(1, assembly.getApplicationExceptions().size());
      //System.out.println(assembly.getContainerTransactionsByEjbName("MyStatelessBean"));

      // @DeclareRoles
      SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
      assertNotNull(securityRoles);
      assertEquals(2, securityRoles.size());
      SecurityRoleMetaData role1 = securityRoles.get("Role1");
      assertNotNull(role1);
      assertEquals("Role1", role1.getRoleName());
      SecurityRoleMetaData role2 = securityRoles.get("Role2");
      assertNotNull(role2);
      assertEquals("Role2", role2.getRoleName());

      // @DenyAll
      // cls.getDeclaredMethods is un-ordered, so we must use bestMatch
View Full Code Here

      assertEquals(expected, icons.value());
   }

   protected void assertSecurityRoles(Ear5xMetaData ear)
   {
      SecurityRolesMetaData roles = ear.getSecurityRoles();
      assertEquals("There are 2 roles", 2, roles.size());
      SecurityRoleMetaData role0 = roles.get("role0");
      assertEquals("security-role0", role0.getId());
      assertEquals("role0", role0.getName());
      assertEquals("The 0 security role", role0.getDescriptions().value()[0].value());
      SecurityRoleMetaData role1 = roles.get("role1");
      assertEquals("security-role1", role1.getId());
      assertEquals("role1", role1.getName());
      assertEquals("The 1 security role", role1.getDescriptions().value()[0].value());
   }
View Full Code Here

     
      if(override != null && override.runAsIdentity!= null)
         setRunAsIdentity(override.runAsIdentity);

      if(securityRoles == null)
         securityRoles = new SecurityRolesMetaData();
      SecurityRolesMetaData overrideRoles = null;
      SecurityRolesMetaData originalRoles = null;
      if(override != null)
         overrideRoles = override.getSecurityRoles();
      if(original != null)
         originalRoles = original.getSecurityRoles();
      securityRoles.merge(overrideRoles, originalRoles);
View Full Code Here

      assertNotNull(servlet);
      RunAsMetaData runAs = servlet.getRunAs();
      assertNotNull(runAs);
      assertEquals("InternalUser", runAs.getRoleName());
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = merged.getSecurityRoles();
      assertNotNull(securityRoles);
      assertEquals(2, securityRoles.size());
      SecurityRoleMetaData role1 = securityRoles.get("Role1");
      assertNotNull(role1);
      assertEquals("Role1", role1.getRoleName());
      SecurityRoleMetaData role2 = securityRoles.get("Role2");
      assertNotNull(role2);
      assertEquals("Role2", role2.getRoleName());
      // @PostConstruct
      assertEquals("setUp", metaData.getPostConstructs().get(0).getMethodName());
      // @PreDestroy
View Full Code Here

      assertNotNull(servlet);
      RunAsMetaData runAs = servlet.getRunAs();
      assertNotNull(runAs);
      assertEquals("InternalUser", runAs.getRoleName());
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = metaData.getSecurityRoles();
      assertNotNull(securityRoles);
      assertEquals(2, securityRoles.size());
      SecurityRoleMetaData role1 = securityRoles.get("Role1");
      assertNotNull(role1);
      assertEquals("Role1", role1.getRoleName());
      SecurityRoleMetaData role2 = securityRoles.get("Role2");
      assertNotNull(role2);
      assertEquals("Role2", role2.getRoleName());
   }
View Full Code Here

         overrideModules = override.getModules();
      if(original != null)
         originalModules = original.getModules();
      modules.merge(overrideModules, originalModules);

      SecurityRolesMetaData securityRolesMetaData = null;
      SecurityRolesMetaData overrideSecurityRolesMetaData = null;
      if (original != null)
         securityRolesMetaData = original.getSecurityRoles();
      if(override != null)
         overrideSecurityRolesMetaData = override.getSecurityRoles();
      if(securityRoles == null)
         securityRoles = new SecurityRolesMetaData();
      securityRoles.merge(overrideSecurityRolesMetaData, securityRolesMetaData);
   }
View Full Code Here

         {
            WebServiceDeclaration container = it.next();
            RolesAllowed anRolesAllowed = container.getAnnotation(RolesAllowed.class);
            if (anRolesAllowed != null)
            {
               SecurityRolesMetaData securityRoles = webApp.getSecurityRoles();
               for (String roleName : anRolesAllowed.value())
               {
                  SecurityRoleMetaData role = new SecurityRoleMetaData();
                  role.setRoleName(roleName);
                  securityRoles.add(role);
               }
            }
         }
      }
   }
View Full Code Here

   {
      JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
      IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
      if (assemblyDescriptor != null)
      {
         SecurityRolesMetaData securityRoles = assemblyDescriptor.getSecurityRoles();
         if (securityRoles != null)
            webApp.setSecurityRoles(securityRoles);
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.SecurityRolesMetaData

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.