XRD xrd = tmpXRDS.getDescriptorAt(d);
xrdsOut.add(xrd);
// status is not success
ServerStatus sstat = xrd.getServerStatus();
Status stat;
if (sstat == null) {
// compatibility: if no ServerStatus, look for Status
stat = xrd.getStatus();
if (stat != null) {
xrd.setServerStatus(new ServerStatus(stat.getCode(), stat.getText()));
}
}
else {
stat = new Status(sstat.getCode(), sstat.getText());
xrd.setStatus(stat);
}
if (stat == null)
throw makeResolutionException(xrdsOut, query, Status.INVALID_XRDS, "Missing ServerStatus or Status element in XRD");
if (!stat.getCode().equals(Status.SUCCESS)) {
throw new PartialResolutionException(xrdsOut);
}
// check the basic properties of the descriptor
if (!xrd.isValid()) {
xrd.setStatus(new Status(Status.UNEXPECTED_RESPONSE, "XRD is not valid (stale?)"));
throw new PartialResolutionException(xrdsOut);
}
if (flags.isCid()) {
Status parentStatus = parent.getStatus();
Status s = xrd.getStatus();
String parentCIDStat = parentStatus.getCID();
if (parentCIDStat.equals(Status.CID_FAILED)) {
s.setCID(Status.CID_FAILED);
}
else {
s.setCID(verifyCID(prevXRD, xrd));
}
}
// if we need to do trusted resolution checking
if (flags.isSaml())