ArrayList selectedSvcs = selectServices(xrd.getServices(), sepType, path, sepMediaType);
if (selectedSvcs.size() == 0) {
// do reference processing
ArrayList refs = xrd.getPrioritizedRefs();
if (refs.size() == 0) {
Status s = new Status(Status.SEP_NOT_FOUND, "Requested service endpoint not found.");
xrdsOut.getFinalXRD().setStatus(s);
throw new PartialResolutionException(xrdsOut);
}
if (maxFollowRefs >= 0 && state.getNumRefsFollowed() >= maxFollowRefs) {
Status s = new Status(Status.LIMIT_EXCEEDED, "Maximum number of references exceeded");
xrdsOut.getFinalXRD().setStatus(s);
throw new PartialResolutionException(xrdsOut);
}
// we have some references, let's process it
for (int i = 0; i < refs.size(); i++) {
Ref r = (Ref)refs.get(i);
XRI refXRI = null;
try {
refXRI = new XRI(r.getValue());
}
catch (XRIParseException e) {
log.warn("resolveAuthSegment - Invalid ref encountered: " + e.getMessage());
// bail out if this is the last segment
if (i == refs.size()) {
Status s = new Status(Status.SEP_NOT_FOUND, "Invalid ref encountered: " + e.getMessage());
xrdsOut.getFinalXRD().setStatus(s);
throw new PartialResolutionException(xrdsOut);
}
else // try next one
continue;