Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.AuthConstraintMetaData


         for (SecurityConstraintMetaData value : scs)
         {
            org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
            TransportGuaranteeType tg = value.getTransportGuarantee();
            constraint.setUserConstraint(tg.name());
            AuthConstraintMetaData acmd = value.getAuthConstraint();
            constraint.setAuthConstraint(acmd != null);
            if (acmd != null)
            {
               if (acmd.getRoleNames() != null)
                  for (String role : acmd.getRoleNames())
                  {
                     constraint.addAuthRole(role);
                  }
            }
            WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
View Full Code Here


    * @return new authentication constraint meta data
    */
   public static AuthConstraintMetaData newAuthConstraint(final List<String> roleNames,
         final SecurityConstraintMetaData securityConstraintMD)
   {
      final AuthConstraintMetaData authConstraintMD = new AuthConstraintMetaData();

      authConstraintMD.setRoleNames(roleNames);
      securityConstraintMD.setAuthConstraint(authConstraintMD);

      return authConstraintMD;
   }
View Full Code Here

     * @param securityConstraintMD security constraint meta data
     * @return new authentication constraint meta data
     */
    public static AuthConstraintMetaData newAuthConstraint(final List<String> roleNames,
            final SecurityConstraintMetaData securityConstraintMD) {
        final AuthConstraintMetaData authConstraintMD = new AuthConstraintMetaData();

        authConstraintMD.setRoleNames(roleNames);
        securityConstraintMD.setAuthConstraint(authConstraintMD);

        return authConstraintMD;
    }
View Full Code Here

        if (scs != null) {
            for (SecurityConstraintMetaData value : scs) {
                org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
                TransportGuaranteeType tg = value.getTransportGuarantee();
                constraint.setUserConstraint(tg.name());
                AuthConstraintMetaData acmd = value.getAuthConstraint();
                constraint.setAuthConstraint(acmd != null);
                if (acmd != null) {
                    if (acmd.getRoleNames() != null)
                        for (String role : acmd.getRoleNames()) {
                            constraint.addAuthRole(role);
                        }
                }
                WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
                if (wrcs != null) {
View Full Code Here

         for (SecurityConstraintMetaData value : scs)
         {
            org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
            TransportGuaranteeType tg = value.getTransportGuarantee();
            constraint.setUserConstraint(tg.name());
            AuthConstraintMetaData acmd = value.getAuthConstraint();
            constraint.setAuthConstraint(acmd != null);
            if (acmd != null)
            {
               if (acmd.getRoleNames() != null)
                  for (String role : acmd.getRoleNames())
                  {
                     constraint.addAuthRole(role);
                  }
            }
            WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
View Full Code Here

        if (scs != null) {
            for (SecurityConstraintMetaData value : scs) {
                org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
                TransportGuaranteeType tg = value.getTransportGuarantee();
                constraint.setUserConstraint(tg.name());
                AuthConstraintMetaData acmd = value.getAuthConstraint();
                constraint.setAuthConstraint(acmd != null);
                if (acmd != null) {
                    if (acmd.getRoleNames() != null)
                        for (String role : acmd.getRoleNames()) {
                            constraint.addAuthRole(role);
                        }
                }
                WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
                if (wrcs != null) {
View Full Code Here

            {
               // Only the first auth-method gives the war login-config/auth-method
               if (authMethod == null)
                  authMethod = beanAuthMethod;

               AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
               authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
               securityConstraint.setAuthConstraint(authConstraint);
            }
            // Optional user-data-constraint
            if (transportGuarantee != null)
            {
View Full Code Here

        if (scs != null) {
            for (SecurityConstraintMetaData value : scs) {
                org.apache.catalina.deploy.SecurityConstraint constraint = new org.apache.catalina.deploy.SecurityConstraint();
                TransportGuaranteeType tg = value.getTransportGuarantee();
                constraint.setUserConstraint(tg.name());
                AuthConstraintMetaData acmd = value.getAuthConstraint();
                constraint.setAuthConstraint(acmd != null);
                if (acmd != null) {
                    if (acmd.getRoleNames() != null)
                        for (String role : acmd.getRoleNames()) {
                            constraint.addAuthRole(role);
                        }
                }
                WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
                if (wrcs != null) {
View Full Code Here

                "web-resource" + count + "-name", wrmd.getWebResourceName());
         assertEquals("/resource" + count + "/*",
               "/resource" + count + "/*", wrmd.getUrlPatterns().get(0));
         count++;
      }
      AuthConstraintMetaData amd = scmd.getAuthConstraint();
      assertEquals("auth-constraint0", amd.getId());
      assertEquals("role0", amd.getRoleNames().get(0));
     
      UserDataConstraintMetaData udcmd = scmd.getUserDataConstraint();
      assertEquals(TransportGuaranteeType.NONE,udcmd.getTransportGuarantee());
   }
View Full Code Here

      sc1WRC2HttpExpected.add("OPTIONS");
      sc1WRC2HttpExpected.add("TRACE");
      sc1WRC2HttpExpected.add("GET");
      sc1WRC2HttpExpected.add("POST");
      assertEquals(sc1WRC2HttpExpected, sc1WRC2Http);
      AuthConstraintMetaData sc1AC = sc1.getAuthConstraint();
      List<String> sc1Roles = sc1AC.getRoleNames();
      assertEquals(null, sc1Roles);
      TransportGuaranteeType sc1TG = sc1.getTransportGuarantee();
      assertEquals(TransportGuaranteeType.NONE, sc1TG);
      sc1Roles = sc1.getRoleNames();
      assertEquals(0, sc1Roles.size());
      assertTrue(sc1.isExcluded());
      assertFalse(sc1.isUnchecked());
      // SC2
      SecurityConstraintMetaData sc2 = scs.get(1);
      // SC8
      SecurityConstraintMetaData sc8 = scs.get(7);
      AuthConstraintMetaData sc8AC = sc8.getAuthConstraint();
      assertEquals(null, sc8AC);
      WebResourceCollectionMetaData sc8ACWRC = sc8.getResourceCollections().get(0);
      assertEquals("/restricted/not/*", sc8ACWRC.getUrlPatterns().get(0));
      assertFalse(sc8.isExcluded());
      assertTrue(sc8.isUnchecked());
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.AuthConstraintMetaData

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.