securityConstraint.webResourceCollections.add(webResourceCollection);
if (transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL)) {
securityConstraint.userDataConstraint = TransportGuarantee.CONFIDENTIAL.name();
}
if (emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) {
securityConstraint.authConstraint = new AuthConstraintInfo();
} else if (rolesAllowed.length > 0) {
//When rolesAllowed.length == 0 and emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.PERMIT), no need to create the AuthConstraint object, as it means deny all
AuthConstraintInfo authConstraint = new AuthConstraintInfo();
for (String roleAllowed : rolesAllowed) {
authConstraint.roleNames.add(roleAllowed);
}
securityConstraint.authConstraint = authConstraint;
}