WebResourceCollectionImpl[] webResourceCollections = new WebResourceCollectionImpl[webResourceCollectionNL.getLength()];
for (int j = 0; j < webResourceCollectionNL.getLength(); j++) {
WebResourceCollectionImpl webResourceCollection = new WebResourceCollectionImpl();
Element webResourceCollectionE = (Element)webResourceCollectionNL.item(j);
String webResourceName = XML.getChildElementText(webResourceCollectionE, "web-resource-name");
DescriptionSet descriptions = getDescriptions(webResourceCollectionE);
NodeList urlPatternNL = webResourceCollectionE.getElementsByTagName("url-pattern");
String[] urlPatterns = new String[urlPatternNL.getLength()];
for (int k = 0; k < urlPatternNL.getLength(); k++) {
Element urlPatternE = (Element)urlPatternNL.item(k);
urlPatterns[k] = XML.getElementText(urlPatternE);
}
NodeList httpMethodNL = webResourceCollectionE.getElementsByTagName("http-method");
String[] httpMethods = new String[httpMethodNL.getLength()];
for (int k = 0; k < httpMethodNL.getLength(); k++) {
Element httpMethodE = (Element)httpMethodNL.item(k);
httpMethods[k] = XML.getElementText(httpMethodE);
}
webResourceCollection.setWebResourceName(webResourceName);
webResourceCollection.setDescriptions(descriptions);
webResourceCollection.setUrlPatterns(urlPatterns);
webResourceCollection.setHttpMethods(httpMethods);
webResourceCollections[j] = webResourceCollection;
}
securityConstraint.setWebResourceCollections(webResourceCollections);
NodeList authConstraintNL = securityConstraintE.getElementsByTagName("auth-constraint");
if (authConstraintNL.getLength() > 0) {
Element authConstraintE = (Element)authConstraintNL.item(0);
AuthConstraintImpl authConstraint = new AuthConstraintImpl();
DescriptionSet descriptions = getDescriptions(authConstraintE);
NodeList roleNameNL = authConstraintE.getElementsByTagName("role-name");
String[] roleNames = new String[roleNameNL.getLength()];
for (int k = 0; k < roleNameNL.getLength(); k++) {
Element roleNameE = (Element)roleNameNL.item(k);
roleNames[k] = XML.getElementText(roleNameE);
}
authConstraint.setDescriptions(descriptions);
authConstraint.setRoleNames(roleNames);
securityConstraint.setAuthConstraint(authConstraint);
}
NodeList userDataConstraintNL = securityConstraintE.getElementsByTagName("user-data-constraint");
if (userDataConstraintNL.getLength() > 0) {
Element userDataConstraintE = (Element)userDataConstraintNL.item(0);
UserDataConstraintImpl userDataConstraint = new UserDataConstraintImpl();
DescriptionSet descriptions = getDescriptions(userDataConstraintE);
String transportGuarantee = XML.getChildElementText(userDataConstraintE, "transport-guarantee");
userDataConstraint.setDescriptions(descriptions);
userDataConstraint.setTransportGuarantee(transportGuarantee);
securityConstraint.setUserDataConstraint(userDataConstraint);
}