Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.AuthorizationConstraintImpl


                                      urlEnum.nextElement().toString());
                    }
                } // end res.collection iterator

                // show roles which apply to above set of collections
                AuthorizationConstraintImpl authCons =
                 (AuthorizationConstraintImpl)sc.getAuthorizationConstraint();
                Enumeration rolesEnum = authCons.getSecurityRoles();
                StringBuffer rsb = new StringBuffer();
                rsb.append("     Accessible by roles: ");
                while (rolesEnum.hasMoreElements()) {
                    SecurityRole sr = (SecurityRole)rolesEnum.nextElement();
                    rsb.append(sr.getName());
View Full Code Here


                wrcNode.writeDescriptor(myNode, WebTagNames.WEB_RESOURCE_COLLECTION,
                    (WebResourceCollectionImpl) webResources.nextElement());
        }
       
        // auth-constaint?
        AuthorizationConstraintImpl aci = (AuthorizationConstraintImpl) descriptor.getAuthorizationConstraint();
        if (aci!=null) {
            AuthConstraintNode acNode = new AuthConstraintNode();
            acNode.writeDescriptor(myNode, WebTagNames.AUTH_CONSTRAINT, aci);
        }
       
View Full Code Here

        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(
View Full Code Here

                wrcNode.writeDescriptor(myNode, WebTagNames.WEB_RESOURCE_COLLECTION,
                    (WebResourceCollectionImpl) webResource);
        }
       
        // auth-constaint?
        AuthorizationConstraintImpl aci = (AuthorizationConstraintImpl) descriptor.getAuthorizationConstraint();
        if (aci!=null) {
            AuthConstraintNode acNode = new AuthConstraintNode();
            acNode.writeDescriptor(myNode, WebTagNames.AUTH_CONSTRAINT, aci);
        }
       
View Full Code Here

                        logger.finest("       "+ urlPattern);
                    }
                } // end res.collection iterator

                // show roles which apply to above set of collections
                AuthorizationConstraintImpl authCons =
                 (AuthorizationConstraintImpl)sc.getAuthorizationConstraint();
                Enumeration rolesEnum = authCons.getSecurityRoles();
                StringBuffer rsb = new StringBuffer();
                rsb.append("     Accessible by roles: ");
                while (rolesEnum.hasMoreElements()) {
                    SecurityRole sr = (SecurityRole)rolesEnum.nextElement();
                    rsb.append(sr.getName());
View Full Code Here

TOP

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

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.