// using the parent authority and subsegment name, find the subsegment and the authority we are describing now
// we must be prepared to have null values here, since not all pipeline configurations
// may use objects from the store
SubSegment subSegment = null;
Authority authority = null;
if (parentAuthority != null) subSegment = this.store.findSubSegment(parentAuthority, subSegmentName);
if (subSegment != null) authority = this.store.getSubSegmentAuthority(subSegment);
// give subclasses a chance to init the XRD
ret = this.initXRD(
xrd,
parentAuthority,
subSegmentName,
signed);
// if a subclass returned true, it doesn't want us to do any more work
if (ret == true) {
log.debug("Subclass handled XRD completely. Returning it without any more work.");
xrds.add(xrd);
continue;
}
// check if the parent authority overrides the LOOKUP pipeline. if not, use the default.
ServerConfig serverConfig = ServerConfigFactory.getSingleton();
PipelineRegistry pipelineRegistry = (serverConfig == null) ? null : serverConfig.getPipelineRegistry();
Pipeline lookupPipeline = null;
if (this.store instanceof StoreAttributable) {
StoreAttributable storeAttributable = (StoreAttributable) this.store;
String pipelineName = storeAttributable.getAuthorityAttributes(parentAuthority).get(Pipeline.ATTRIBUTE_OVERRIDE_LOOKUP_PIPELINE);
if (pipelineRegistry != null && pipelineName != null) lookupPipeline = pipelineRegistry.getPipelineByName(pipelineName);
}
if (pipelineRegistry != null && lookupPipeline == null) lookupPipeline = pipelineRegistry.getDefaultLookupPipeline();
// execute LOOKUP pipeline
xrd = lookupPipeline.execute(
this.store,
xrd,
segment,
parentAuthority,
subSegmentName,
authority,
false);
// let our subclasses finish the XRD before we append it to the XRDS
if (xrd != null) {
this.finishXRD(
xrd,
parentAuthority,
subSegment,
authority,
signed);
}
// if we were not able to get a XRD, that's ok if we found at least one before
// (we are not necessarily authoritative for the whole query)
if (xrd == null) {
if (i > 0) {
break;
} else {
xrds.add(makeNotFoundXrd(subSegmentName));
break;
}
}
// authority becomes the parent authority for the next subsegment
parentAuthority = authority;
if (subSegment != null) setParentQueryName(subSegment.getName());
// append XRD to the XRDS
xrds.add(xrd);
} catch (Exception ex) {