Package org.jboss.metadata.web.spec

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


   </security-constraint>
   */
   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);
      sc2.setAuthConstraint(ac);
      UserDataConstraintMetaData udc = new UserDataConstraintMetaData();
      udc.setTransportGuarantee(TransportGuaranteeType.CONFIDENTIAL);
      sc2.setUserDataConstraint(udc);
      securityContraints.add(sc2);
   }
View Full Code Here


            if (securityContraints == null)
            {
               securityContraints = new ArrayList<SecurityConstraintMetaData>();
               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);
            if (Boolean.TRUE.equals(secureWSDLAccess))
            {
               httpMethods.add("GET");
            }
            httpMethods.add("POST");

            // Optional auth-constraint
            if (beanAuthMethod != null)
            {
               // 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)
            {
               UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
               userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
               securityConstraint.setUserDataConstraint(userDataConstraint);
            }
         }
      }

      // Optional login-config/auth-method
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                        .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                        .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                        .getWebResourceCollections(securityConstraint);
View Full Code Here

                if (hasAuthMethod || hasTransportGuarantee) {
                    final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                            .getSecurityConstraints(jbossWebMD);

                    // security-constraint
                    final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                            .newSecurityConstraint(securityConstraints);

                    // web-resource-collection
                    final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                            .getWebResourceCollections(securityConstraint);
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                        .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                        .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                        .getWebResourceCollections(securityConstraint);
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                .getWebResourceCollections(securityConstraint);
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                .getWebResourceCollections(securityConstraint);
View Full Code Here

     *
     * @param securityConstraintsMD security constraints meta data
     * @return new security constraing meta data
     */
    public static SecurityConstraintMetaData newSecurityConstraint(final List<SecurityConstraintMetaData> securityConstraintsMD) {
        final SecurityConstraintMetaData securityConstraintMD = new SecurityConstraintMetaData();

        securityConstraintsMD.add(securityConstraintMD);

        return securityConstraintMD;
    }
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                .getWebResourceCollections(securityConstraint);
View Full Code Here

            if (ejbEndpoint instanceof HttpEndpoint && (hasAuthMethod || hasTransportGuarantee)) {
                final List<SecurityConstraintMetaData> securityConstraints = WebMetaDataHelper
                        .getSecurityConstraints(jbossWebMD);

                // security-constraint
                final SecurityConstraintMetaData securityConstraint = WebMetaDataHelper
                        .newSecurityConstraint(securityConstraints);

                // web-resource-collection
                final WebResourceCollectionsMetaData webResourceCollections = WebMetaDataHelper
                        .getWebResourceCollections(securityConstraint);
View Full Code Here

TOP

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

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.