Package org.jboss.metadata.web.spec

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


   {
      // security-constraint/ display-name = RestrictedGetSC
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("RestrictedGetSC");
      // web-resource-collection/web-resource-name = Restricted Access - Post Only
      WebResourceCollectionMetaData wrc1 = new WebResourceCollectionMetaData();
      wrc1.setName("Restricted Access - Post Only");
      sc1.getResourceCollections().add(wrc1);

      // All Access
      wrc1.getUrlPatterns().add("/restricted/post-only/*");
      wrc1.getHttpMethods().add("POST");

      // auth-constraint/role-name = GetRole
      AuthConstraintMetaData ac1 = new AuthConstraintMetaData();
      ac1.getRoleNames().add("PostRole");
      sc1.setAuthConstraint(ac1);
View Full Code Here


   {
      // security-constraint/ display-name = ExcludedPostSC
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("ExcludedPostSC");
      // web-resource-collection/web-resource-name = Restricted Access - Post Only
      WebResourceCollectionMetaData wrc1 = new WebResourceCollectionMetaData();
      wrc1.setName("Restricted Access - Post Only");
      sc1.getResourceCollections().add(wrc1);

      // All Access
      wrc1.getUrlPatterns().add("/restricted/post-only/*");
      wrc1.getHttpMethods().add("DELETE");
      wrc1.getHttpMethods().add("PUT");
      wrc1.getHttpMethods().add("HEAD");
      wrc1.getHttpMethods().add("OPTIONS");
      wrc1.getHttpMethods().add("TRACE");
      wrc1.getHttpMethods().add("GET");

      // <auth-constraint />
      AuthConstraintMetaData excluded = new AuthConstraintMetaData();
      sc1.setAuthConstraint(excluded);

View Full Code Here

   {
      // security-constraint/ display-name = RestrictedAnySC
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("RestrictedAnySC");
      // web-resource-collection/web-resource-name = Restricted Access - Any
      WebResourceCollectionMetaData wrc1 = new WebResourceCollectionMetaData();
      wrc1.setName("Restricted Access - Any");
      sc1.getResourceCollections().add(wrc1);

      // All Access
      wrc1.getUrlPatterns().add("/restricted/any/*");
      wrc1.getHttpMethods().add("DELETE");
      wrc1.getHttpMethods().add("PUT");
      wrc1.getHttpMethods().add("HEAD");
      wrc1.getHttpMethods().add("OPTIONS");
      wrc1.getHttpMethods().add("TRACE");
      wrc1.getHttpMethods().add("GET");
      wrc1.getHttpMethods().add("POST");

      // auth-constraint/role-name = GetRole
      AuthConstraintMetaData ac1 = new AuthConstraintMetaData();
      ac1.getRoleNames().add("GetRole");
      ac1.getRoleNames().add("PostRole");
View Full Code Here

   {
      // security-constraint/ display-name = UnrestrictedSC
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("UnrestrictedSC");
      // web-resource-collection/web-resource-name = Restricted Access - Any
      WebResourceCollectionMetaData wrc1 = new WebResourceCollectionMetaData();
      wrc1.setName("Restricted Access - Any");
      sc1.getResourceCollections().add(wrc1);

      // All Access
      wrc1.getUrlPatterns().add("/restricted/not/*");
      wrc1.getHttpMethods().add("DELETE");
      wrc1.getHttpMethods().add("PUT");
      wrc1.getHttpMethods().add("HEAD");
      wrc1.getHttpMethods().add("OPTIONS");
      wrc1.getHttpMethods().add("TRACE");
      wrc1.getHttpMethods().add("GET");
      wrc1.getHttpMethods().add("POST");

      // auth-constraint/role-name = unchecked
      sc1.setAuthConstraint(null);

      // user-data-constraint/transport-guarantee
View Full Code Here

   private void addSC(List<SecurityConstraintMetaData> securityContraints)
   {
      // security-constraint/ display-name = excluded
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("excluded");
      WebResourceCollectionMetaData wrcex = new WebResourceCollectionMetaData();
      wrcex.setName("excluded");
      sc1.getResourceCollections().add(wrcex);
      // web-resource-collection/web-resource-name = No Access
      wrcex.getUrlPatterns().add("/excluded/*");
      wrcex.getUrlPatterns().add("/restricted/get-only/excluded/*");
      wrcex.getUrlPatterns().add("/restricted/post-only/excluded/*");
      wrcex.getUrlPatterns().add("/restricted/any/excluded/*");
      wrcex.getUrlPatterns().add("/excluded/*");

      // web-resource-collection/web-resource-name = No Access
      WebResourceCollectionMetaData wrcna = new WebResourceCollectionMetaData();
      wrcna.setName("No Access");
      sc1.getResourceCollections().add(wrcna);
      wrcna.getUrlPatterns().add("/restricted/*");
      wrcna.getHttpMethods().add("DELETE");
      wrcna.getHttpMethods().add("PUT");
      wrcna.getHttpMethods().add("HEAD");
      wrcna.getHttpMethods().add("OPTIONS");
      wrcna.getHttpMethods().add("TRACE");
      wrcna.getHttpMethods().add("GET");
      wrcna.getHttpMethods().add("POST");

      AuthConstraintMetaData excluded = new AuthConstraintMetaData();
      sc1.setAuthConstraint(excluded);
      UserDataConstraintMetaData none = new UserDataConstraintMetaData();
      none.setTransportGuarantee(TransportGuaranteeType.NONE);
      sc1.setUserDataConstraint(none);

      // security-constraint/ display-name = unchecked
      SecurityConstraintMetaData sc2 = new SecurityConstraintMetaData();
      sc1.setDisplayName("unchecked");
      WebResourceCollectionMetaData wrcun = new WebResourceCollectionMetaData();
      wrcun.setName("Unchecked");
      sc2.getResourceCollections().add(wrcun);
      wrcun.getUrlPatterns().add("/unchecked/*");
      wrcun.getUrlPatterns().add("/restricted/not/*");
      wrcun.getHttpMethods().add("DELETE");
      wrcun.getHttpMethods().add("PUT");
      wrcun.getHttpMethods().add("HEAD");
      wrcun.getHttpMethods().add("OPTIONS");
      wrcun.getHttpMethods().add("TRACE");
      wrcun.getHttpMethods().add("GET");
      wrcun.getHttpMethods().add("POST");

      // no auth-constraint
      sc2.setAuthConstraint(null);
      // user-data-constraint/transport-guarantee
      sc2.setUserDataConstraint(none);
View Full Code Here

   {
      // security-constraint/ display-name = SC1
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("SC1");
      // web-resource-collection/web-resource-name = Excluded
      WebResourceCollectionMetaData wrc1 = new WebResourceCollectionMetaData();
      wrc1.setName("Excluded");
      sc1.getResourceCollections().add(wrc1);
      wrc1.getUrlPatterns().add("/restricted/post-only/excluded/*");
      wrc1.getUrlPatterns().add("/*");

      // <auth-constraint />
      AuthConstraintMetaData excluded = new AuthConstraintMetaData();
      sc1.setAuthConstraint(excluded);

      // user-data-constraint/transport-guarantee
      UserDataConstraintMetaData none = new UserDataConstraintMetaData();
      none.setTransportGuarantee(TransportGuaranteeType.NONE);
      sc1.setUserDataConstraint(none);
      securityContraints.add(sc1);

      SecurityConstraintMetaData sc2 = new SecurityConstraintMetaData();
      sc2.setDisplayName("SC2");
      // web-resource-collection/web-resource-name = Restricted POST
      WebResourceCollectionMetaData wrc2 = new WebResourceCollectionMetaData();
      wrc2.setName("Restricted POST");
      sc2.getResourceCollections().add(wrc2);
      wrc2.getUrlPatterns().add("/restricted/post-only/*");
      wrc2.getHttpMethods().add("POST");
      AuthConstraintMetaData ac2 = new AuthConstraintMetaData();
      ac2.getRoleNames().add("PostRole");
      sc2.setAuthConstraint(ac2);
      sc2.setUserDataConstraint(none);
      securityContraints.add(sc2);

      SecurityConstraintMetaData sc3 = new SecurityConstraintMetaData();
      sc3.setDisplayName("SC3");
      // web-resource-collection/web-resource-name = Excluded POST
      WebResourceCollectionMetaData wrc3 = new WebResourceCollectionMetaData();
      wrc3.setName("Excluded POST");
      wrc3.getUrlPatterns().add("/restricted/post-only/*");
      wrc3.getHttpMethods().add("DELETE");
      wrc3.getHttpMethods().add("PUT");
      wrc3.getHttpMethods().add("HEAD");
      wrc3.getHttpMethods().add("OPTIONS");
      wrc3.getHttpMethods().add("TRACE");
      wrc3.getHttpMethods().add("GET");
      sc3.setAuthConstraint(excluded);
      sc3.setUserDataConstraint(none);
      securityContraints.add(sc3);
   }
View Full Code Here

       </user-data-constraint>
   </security-constraint>
   */
   private void addSC(SecurityConstraintMetaData securityContraints)
   {
      WebResourceCollectionMetaData wsmd = new WebResourceCollectionMetaData();
      securityContraints.getResourceCollections().add(wsmd);
      // web-resource-collection/web-resource-name = exact, get method, roleA
      wsmd.setName("SSL Only");
      wsmd.getUrlPatterns().add("/*");
      // A null set of roles is unchecked
      securityContraints.getAuthConstraint().setRoleNames(null);
      UserDataConstraintMetaData udc = new UserDataConstraintMetaData();
      udc.setTransportGuarantee(TransportGuaranteeType.CONFIDENTIAL);
      securityContraints.setUserDataConstraint(udc);
View Full Code Here

   private void addSC1(List securityContraints)
   {
      // security-constraint/ display-name = SC1
      SecurityConstraintMetaData sc1 = new SecurityConstraintMetaData();
      sc1.setDisplayName("SC1");
      WebResourceCollectionMetaData wrcsc1c1 = new WebResourceCollectionMetaData();
      wrcsc1c1.setName("sc1.c1");
      sc1.getResourceCollections().add(wrcsc1c1);

      // web-resource-collection/web-resource-name = sc1.c1
      wrcsc1c1.getUrlPatterns().add("/a/*");
      wrcsc1c1.getUrlPatterns().add("/b/*");
      wrcsc1c1.getUrlPatterns().add("/a");
      wrcsc1c1.getUrlPatterns().add("/b");
      wrcsc1c1.getHttpMethods().add("DELETE");
      wrcsc1c1.getHttpMethods().add("PUT");

      WebResourceCollectionMetaData wrcsc1c2 = new WebResourceCollectionMetaData();
      wrcsc1c2.setName("sc1.c2");
      sc1.getResourceCollections().add(wrcsc1c2);
      wrcsc1c2.getUrlPatterns().add("*.asp");

      sc1.setAuthConstraint(new AuthConstraintMetaData());
      assertTrue(sc1.isExcluded());
      securityContraints.add(sc1);
   }
View Full Code Here

   private void addSC2(List securityContraints)
   {
      // security-constraint/ display-name = SC2
      SecurityConstraintMetaData sc2 = new SecurityConstraintMetaData();
      sc2.setDisplayName("SC2");
      WebResourceCollectionMetaData wrcsc2c1 = new WebResourceCollectionMetaData();
      wrcsc2c1.setName("sc2.c1");
      sc2.getResourceCollections().add(wrcsc2c1);

      // web-resource-collection/web-resource-name = sc2.c1
      wrcsc2c1.getUrlPatterns().add("/a/*");
      wrcsc2c1.getUrlPatterns().add("/b/*");
      wrcsc2c1.getHttpMethods().add("GET");

      // web-resource-collection/web-resource-name = sc2.c2
      WebResourceCollectionMetaData wrcsc2c2 = new WebResourceCollectionMetaData();
      wrcsc2c2.setName("sc2.c2");
      sc2.getResourceCollections().add(wrcsc2c2);
      wrcsc2c2.getUrlPatterns().add("/b/*");
      wrcsc2c2.getHttpMethods().add("POST");

      AuthConstraintMetaData ac = new AuthConstraintMetaData();
      ArrayList<String> roles = new ArrayList<String>();
      roles.add("R1");
      ac.setRoleNames(roles);
View Full Code Here

            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);
            if (Boolean.TRUE.equals(secureWSDLAccess))
            {
               httpMethods.add("GET");
            }
            httpMethods.add("POST");
View Full Code Here

TOP

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

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.