}
}
private void processSecurityConstraints() {
for (Enumeration e = this.config.elements(Constants.SECURITY_CONSTRAINT); e.hasMoreElements();) {
XMLTree scTree = (XMLTree) e.nextElement();
SecurityConstraint sc = (SecurityConstraint) this.factory.createDescriptor(SecurityConstraint.class);
for (Enumeration ee = scTree.elements(Constants.WEB_RESOURCE_COLLECTION); ee.hasMoreElements();) {
XMLTree wrcTree = (XMLTree) ee.nextElement();
WebResourceCollection wrc = (WebResourceCollection) this.factory.createDescriptor(WebResourceCollection.class);
wrc.setName(wrcTree.getFirstElement(Constants.WEB_RESOURCE_NAME).getValue());
if (wrcTree.getFirstElement(Constants.DESCRIPTION) != null) {
wrc.setDescription(wrcTree.getFirstElement(Constants.DESCRIPTION).getValue());
}
for (Enumeration eee = wrcTree.elements(Constants.URL_PATTERN); eee.hasMoreElements();) {
XMLTree upTree = (XMLTree) eee.nextElement();
wrc.addUrlPattern(upTree.getValue());
}
for (Enumeration eee = wrcTree.elements(Constants.HTTP_METHOD); eee.hasMoreElements();) {
XMLTree hmTree = (XMLTree) eee.nextElement();
wrc.addHttpMethod(hmTree.getValue());
}
sc.addWebResourceCollection(wrc);
}
XMLTree acTree = scTree.getFirstElement(Constants.AUTH_CONSTRAINT);
if (acTree != null) {
AuthorizationConstraint ac = (AuthorizationConstraint) this.factory.createDescriptor(AuthorizationConstraint.class);
if (acTree.getFirstElement(Constants.DESCRIPTION) != null) {
ac.setDescription(acTree.getFirstElement(Constants.DESCRIPTION).getValue());
for (Enumeration eeee = acTree.elements(Constants.ROLE_NAME); eeee.hasMoreElements();) {
XMLTree roleNameTree = (XMLTree) eeee.nextElement();
SecurityRole sr = (SecurityRole) this.factory.createDescriptor(SecurityRole.class);
sr.setName(roleNameTree.getValue());
ac.addSecurityRole(sr);
}
}
sc.setAuthorizationConstraint(ac);
}
XMLTree udcTree = scTree.getFirstElement(Constants.USERDATA_CONSTRAINT);
if (udcTree != null) {
UserDataConstraint udc = (UserDataConstraint) this.factory.createDescriptor(UserDataConstraint.class);
if (udcTree.getFirstElement(Constants.DESCRIPTION) != null) {
udc.setDescription(udcTree.getFirstElement(Constants.DESCRIPTION).getValue());
}
udc.setTransportGuarantee(udcTree.getFirstElement(Constants.TRANSPORT_GUARANTEE).getValue());
sc.setUserDataConstraint(udc);
}
this.webApplicationDescriptor.addSecurityConstraint(sc);
}
}