Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.WebResourceCollectionImpl


                    (SecurityConstraintImpl)scEnum.nextElement();

                Set wrcSet = sc.getWebResourceCollectionSet();
                Iterator wrcIt = wrcSet.iterator();
                while (wrcIt.hasNext()) {
                    WebResourceCollectionImpl wrc =
                        (WebResourceCollectionImpl)wrcIt.next();

                    // show list of methods for this collection
                    Enumeration methEnum = wrc.getHttpMethods();
                    StringBuffer sbm = new StringBuffer();
                    while (methEnum.hasMoreElements()) {
                        sbm.append(methEnum.nextElement());
                        sbm.append(" ");
                    }
                    logger.finest("     Using method: "+sbm.toString());

                    // and then list of url patterns
                    Enumeration urlEnum = wrc.getUrlPatterns();
                    while (urlEnum.hasMoreElements()) {
                        logger.finest("       "+
                                      urlEnum.nextElement().toString());
                    }
                } // end res.collection iterator
View Full Code Here


            EmptyRoleSemantic emptyRoleSemantic,
            TransportGuarantee transportGuarantee,
            String httpMethod) {

        SecurityConstraint securityConstraint = new SecurityConstraintImpl();
        WebResourceCollectionImpl webResourceColl = new WebResourceCollectionImpl();
        securityConstraint.addWebResourceCollection(webResourceColl);
        for (String urlPattern : urlPatterns) {
            webResourceColl.addUrlPattern(urlPattern);
        }

        AuthorizationConstraintImpl ac = null;
        if (rolesAllowed != null && rolesAllowed.length > 0) {
            if (emptyRoleSemantic ==  EmptyRoleSemantic.DENY) {
                 throw new IllegalArgumentException(localStrings.getLocalString(
                        "enterprise.deployment.annotation.handlers.denyWithRolesAllowed",
                        "One cannot specify DENY with an non-empty array of rolesAllowed in @ServletSecurity / ServletSecurityElement"));
            }

            ac = new AuthorizationConstraintImpl();
            for (String roleName : rolesAllowed) {
                Role role = new Role(roleName);
                webBundleDesc.addRole(role);
                ac.addSecurityRole(roleName);
            }
        } else if (emptyRoleSemantic == EmptyRoleSemantic.PERMIT) {
            // ac is null
        } else { // DENY
            ac = new AuthorizationConstraintImpl();
        }
        securityConstraint.setAuthorizationConstraint(ac);

        UserDataConstraint udc = new UserDataConstraintImpl();
        udc.setTransportGuarantee(
                ((transportGuarantee == TransportGuarantee.CONFIDENTIAL) ?
                UserDataConstraint.CONFIDENTIAL_TRANSPORT :
                UserDataConstraint.NONE_TRANSPORT));
        securityConstraint.setUserDataConstraint(udc);

        if (httpMethod != null) {
            webResourceColl.addHttpMethod(httpMethod);
        }

        webBundleDesc.addSecurityConstraint(securityConstraint);

        return securityConstraint;
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.WebResourceCollectionImpl

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.