private SecurityConstraint createSecurityConstraint ( SecurityMetadata securityMetadataFromDD , List < WebResourceCollection > webResourceCollections , HttpConstraintElement httpConstraint , boolean fromHttpConstraint ) { List < String > roles = createRoles ( httpConstraint ) ; List < String > allRoles = securityMetadataFromDD . getRoles ( ) ; for ( String role : roles ) { if ( ! allRoles . contains ( role ) ) { allRoles . add ( role ) ; } } boolean sslRequired = isSSLRequired ( httpConstraint ) ; boolean accessPrecluded = isAccessPrecluded ( httpConstraint ) ; boolean accessUncovered = isAccessUncovered ( httpConstraint ) ; return new SecurityConstraint ( webResourceCollections , roles , sslRequired , accessPrecluded , fromHttpConstraint , accessUncovered ) ; }
Creates a security constraint from the given web resource collections url patterns and HttpConstraint element .