Examples of SecurityRoleRefsMetaData


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

    * @return An empty security role refs.
    */
   @XmlTransient
   public SecurityRoleRefsMetaData getSecurityRoleRefs()
   {
      return new SecurityRoleRefsMetaData();
   }
View Full Code Here

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

   }
  
   public void testSecurityRoleRefs()
   {
      // Override
      SecurityRoleRefsMetaData overrideSecurity = new SecurityRoleRefsMetaData();
      overrideSecurity.setId("override");
      SecurityRoleRefMetaData overrideSecurityRoleRef = new SecurityRoleRefMetaData();
      overrideSecurityRoleRef.setDescriptions(new DescriptionsImpl());
      overrideSecurityRoleRef.setId("overrideId");
      overrideSecurityRoleRef.setRoleLink("overrideLink");
      overrideSecurityRoleRef.setRoleName("overrideRoleName");
      overrideSecurity.add(overrideSecurityRoleRef);
      JBossSessionBeanMetaData override = new JBossSessionBeanMetaData();
      override.setSecurityRoleRefs(overrideSecurity);
     
      // Original
      SecurityRoleRefMetaData originalSecurityRoleRef = new SecurityRoleRefMetaData();
      originalSecurityRoleRef.setDescriptions(new DescriptionsImpl());
      originalSecurityRoleRef.setId("originalId");
      originalSecurityRoleRef.setName("originalName");
      originalSecurityRoleRef.setRoleLink("originalLink");
      originalSecurityRoleRef.setRoleName("originalRoleName");
      SecurityRoleRefsMetaData originalSecurityRoleRefsMetaData = new SecurityRoleRefsMetaData();
      originalSecurityRoleRefsMetaData.setId("originalId");
      originalSecurityRoleRefsMetaData.add(originalSecurityRoleRef);
      JBossSessionBeanMetaData original = new JBossSessionBeanMetaData();
      original.setSecurityRoleRefs(originalSecurityRoleRefsMetaData);
      original.setName("original");
     
      // Merged
      JBossSessionBeanMetaData merged = new JBossSessionBeanMetaData();
      merged.merge(override, original);
      SecurityRoleRefsMetaData securityRoleRefs = merged.getSecurityRoleRefs();
      assertNotNull(securityRoleRefs);
      assertEquals(1, securityRoleRefs.size());
      assertEquals("override", securityRoleRefs.getId());
      SecurityRoleRefMetaData securityRoleRef = securityRoleRefs.get(overrideSecurityRoleRef.getKey());
      assertNotNull(securityRoleRef);
      assertEquals("overrideId", securityRoleRef.getId());
      assertEquals("overrideLink", securityRoleRef.getRoleLink());
      assertEquals("overrideRoleName", securityRoleRef.getRoleName());
   }
View Full Code Here

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

    * @return
    */
   @XmlTransient
   public SecurityRoleRefsMetaData getSecurityRoleRefs(String servletName)
   {
      SecurityRoleRefsMetaData refs = null;
      if(getServlets() != null)
      {
         ServletMetaData servlet = getServlets().get(servletName);
         if (servlet != null)
         {
View Full Code Here

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

      if(override != null && override.prePassivates != null)
         prePassivates.addAll(override.prePassivates);
      if(original != null && original.prePassivates != null)
         prePassivates.addAll(original.prePassivates);
      if(securityRoleRefs == null)
         securityRoleRefs = new SecurityRoleRefsMetaData();
      if(override != null && override.securityRoleRefs != null)
         securityRoleRefs.addAll(override.securityRoleRefs);
      if(original != null && original.securityRoleRefs != null)
         securityRoleRefs.addAll(original.securityRoleRefs);
   }
View Full Code Here

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

        return EnterpriseBeanMetaData.class;
    }

    @Override
    protected void processBeanMetaData(final EnterpriseBeanMetaData beanMetaData, final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final SecurityRoleRefsMetaData securityRoleRefs = beanMetaData.getSecurityRoleRefs();
        if (securityRoleRefs == null) {
            return;
        }
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
View Full Code Here

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

         */
        JBossServletsMetaData servletsMetaData = jbossWebMetaData.getServlets();
        for (JBossServletMetaData servletMetaData : servletsMetaData) {
            Set<String> unrefRoles = new HashSet<String>(declaredRoles);
            String servletName = servletMetaData.getName();
            SecurityRoleRefsMetaData roleRefsMetaData = servletMetaData.getSecurityRoleRefs();
            // Perform the unreferenced roles processing for every servlet name
            if (roleRefsMetaData != null) {
                for (SecurityRoleRefMetaData roleRefMetaData : roleRefsMetaData) {
                    String roleRef = roleRefMetaData.getRoleLink();
                    String roleName = roleRefMetaData.getRoleName();
View Full Code Here

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

        return EnterpriseBeanMetaData.class;
    }

    @Override
    protected void processBeanMetaData(final EnterpriseBeanMetaData beanMetaData, final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final SecurityRoleRefsMetaData securityRoleRefs = beanMetaData.getSecurityRoleRefs();
        if (securityRoleRefs == null) {
            return;
        }
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
View Full Code Here

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

                if (params != null) {
                    for (ParamValueMetaData param : params) {
                        wrapper.addInitParameter(param.getParamName(), param.getParamValue());
                    }
                }
                SecurityRoleRefsMetaData refs = value.getSecurityRoleRefs();
                if (refs != null) {
                    for (SecurityRoleRefMetaData ref : refs) {
                        wrapper.addSecurityReference(ref.getRoleName(), ref.getRoleLink());
                    }
                }
View Full Code Here

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

            }
            if (servletName == null)
                throw new IllegalStateException("servletName is null");
            String roleName = role;
            ServletMetaData servletMD = metaData.getServlets().get(servletName);
            SecurityRoleRefsMetaData roleRefs = null;
            if (servletMD != null)
                roleRefs = servletMD.getSecurityRoleRefs();
            if (roleRefs != null) {
                for (SecurityRoleRefMetaData ref : roleRefs) {
                    if (ref.getRoleLink().equals(role)) {
View Full Code Here

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

                if (params != null) {
                    for (ParamValueMetaData param : params) {
                        wrapper.addInitParameter(param.getParamName(), param.getParamValue());
                    }
                }
                SecurityRoleRefsMetaData refs = value.getSecurityRoleRefs();
                if (refs != null) {
                    for (SecurityRoleRefMetaData ref : refs) {
                        wrapper.addSecurityReference(ref.getRoleName(), ref.getRoleLink());
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.