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