Package org.jboss.metadata.web.spec

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


                  for (String role : acmd.getRoleNames())
                  {
                     constraint.addAuthRole(role);
                  }
            }
            WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
            if (wrcs != null)
            {
               for (WebResourceCollectionMetaData wrc : wrcs)
               {
                  org.apache.catalina.deploy.SecurityCollection collection2 = new org.apache.catalina.deploy.SecurityCollection();
View Full Code Here


                    if (acmd.getRoleNames() != null)
                        for (String role : acmd.getRoleNames()) {
                            constraint.addAuthRole(role);
                        }
                }
                WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
                if (wrcs != null) {
                    for (WebResourceCollectionMetaData wrc : wrcs) {
                        org.apache.catalina.deploy.SecurityCollection collection2 = new org.apache.catalina.deploy.SecurityCollection();
                        collection2.setName(wrc.getName());
                        List<String> methods = wrc.getHttpMethods();
View Full Code Here

            JSESecurityMetaData current = new JSESecurityMetaData();
            unifiedsecurityMetaData.add(current);

            current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());

            WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
            for (WebResourceCollectionMetaData webResource : resources)
            {
               JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
               for (String currentPattern : webResource.getUrlPatterns())
               {
View Full Code Here

               jbwmd.setSecurityContraints(securityContraints);
            }
            SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
            securityContraints.add(securityConstraint);
           
            WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
            if (resourceCollections == null)
            {
               resourceCollections = new WebResourceCollectionsMetaData();
               securityConstraint.setResourceCollections(resourceCollections);
            }
            WebResourceCollectionMetaData resourceCollection = new WebResourceCollectionMetaData();
            resourceCollections.add(resourceCollection);
           
            resourceCollection.setWebResourceName(ejbName);
            resourceCollection.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
            ArrayList<String> httpMethods = new ArrayList<String>();
            resourceCollection.setHttpMethods(httpMethods);
View Full Code Here

                    if (acmd.getRoleNames() != null)
                        for (String role : acmd.getRoleNames()) {
                            constraint.addAuthRole(role);
                        }
                }
                WebResourceCollectionsMetaData wrcs = value.getResourceCollections();
                if (wrcs != null) {
                    for (WebResourceCollectionMetaData wrc : wrcs) {
                        org.apache.catalina.deploy.SecurityCollection collection2 = new org.apache.catalina.deploy.SecurityCollection();
                        collection2.setName(wrc.getName());
                        List<String> methods = wrc.getHttpMethods();
View Full Code Here

     *
     * @param jseSecurityMD universal JSE security meta data model
     * @param securityConstraintMD security constraint meta data
     */
    private void setWebResources(final JSESecurityMetaData jseSecurityMD, final SecurityConstraintMetaData securityConstraintMD) {
        final WebResourceCollectionsMetaData webResources = securityConstraintMD.getResourceCollections();

        for (final WebResourceCollectionMetaData webResourceMD : webResources) {
            final JSEResourceCollection jseResource = jseSecurityMD.addWebResource(webResourceMD.getName());

            for (final String webResourceUrlPatterns : webResourceMD.getUrlPatterns()) {
View Full Code Here

   private void assertNormalSecurityConstraint(SecurityConstraintMetaData scmd)
   {  
      assertFalse(scmd.isExcluded());
      assertFalse(scmd.isUnchecked());
      assertEquals("security-constraint0-display-name",scmd.getDisplayName());
      WebResourceCollectionsMetaData wrcmd = scmd.getResourceCollections();
      assertEquals(2, wrcmd.size());
      int count = 0;
      for(WebResourceCollectionMetaData wrmd: wrcmd)
      {
         assertEquals(wrmd.getId(), "web-resource-collection" + count, wrmd.getId());
         assertEquals(wrmd.getWebResourceName(),
View Full Code Here

      WebMetaData webApp = unmarshal();
      List<SecurityConstraintMetaData> scs = webApp.getSecurityContraints();
      assertEquals(8, scs.size());
      // SC1
      SecurityConstraintMetaData sc1 = scs.get(0);
      WebResourceCollectionsMetaData sc1WRC = sc1.getResourceCollections();
      assertEquals(2, sc1WRC.size());
      WebResourceCollectionMetaData sc1WRC1 = sc1WRC.get(0);
      assertEquals(Collections.emptyList(), sc1WRC1.getHttpMethods());
      List<String> sc1WRC1URLs = sc1WRC1.getUrlPatterns();
      assertEquals(4, sc1WRC1URLs.size());
      assertEquals("/excluded/*", sc1WRC1URLs.get(0));
      assertEquals("/restricted/get-only/excluded/*", sc1WRC1URLs.get(1));
      assertEquals("/restricted/post-only/excluded/*", sc1WRC1URLs.get(2));
      assertEquals("/restricted/any/excluded/*", sc1WRC1URLs.get(3));
      WebResourceCollectionMetaData sc1WRC2 = sc1WRC.get(1);
      List<String> sc1WRC2URLs =  sc1WRC2.getUrlPatterns();
      assertEquals(1, sc1WRC2URLs.size());
      assertEquals("/restricted/*", sc1WRC2URLs.get(0));
      List<String> sc1WRC2Http = sc1WRC2.getHttpMethods();
      ArrayList<String> sc1WRC2HttpExpected = new ArrayList<String>();
View Full Code Here

               jbwmd.setSecurityContraints(securityContraints);
            }
            SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
            securityContraints.add(securityConstraint);
           
            WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
            if (resourceCollections == null)
            {
               resourceCollections = new WebResourceCollectionsMetaData();
               securityConstraint.setResourceCollections(resourceCollections);
            }
            WebResourceCollectionMetaData resourceCollection = new WebResourceCollectionMetaData();
            resourceCollections.add(resourceCollection);
           
            resourceCollection.setWebResourceName(ejbName);
            resourceCollection.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
            ArrayList<String> httpMethods = new ArrayList<String>();
            resourceCollection.setHttpMethods(httpMethods);
View Full Code Here

            JSESecurityMetaData current = new JSESecurityMetaData();
            unifiedsecurityMetaData.add(current);

            current.setTransportGuarantee(securityMetaData.getTransportGuarantee().name());

            WebResourceCollectionsMetaData resources = securityMetaData.getResourceCollections();
            for (WebResourceCollectionMetaData webResource : resources)
            {
               JSEResourceCollection currentResource = current.addWebResource(webResource.getName());
               for (String currentPattern : webResource.getUrlPatterns())
               {
View Full Code Here

TOP

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

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.