request.setCachePolicy(getDefaultCachePolicy());
Location actualLocation = request.at();
int numMerged = 0;
while (projectedRequest != null) {
VerifyNodeExistsRequest readFromSource = (VerifyNodeExistsRequest)projectedRequest.getRequest();
if (readFromSource.hasError()) {
projectedRequest = projectedRequest.next();
continue;
}
if (readFromSource.isCancelled()) {
request.cancel();
return;
}
// Make sure we have an actual location ...
Location sourceLocation = readFromSource.getActualLocationOfNode();
actualLocation = determineActualLocation(actualLocation, sourceLocation, projectedRequest.getProjection());
if (sourceLocation.hasIdProperties()) {
// Accumulate the identification properties ...
for (Property propertyInSource : sourceLocation.getIdProperties()) {
Name name = propertyInSource.getName();
Property existing = actualLocation.getIdProperty(name);
if (existing != null) {
// Merge the property values ...
propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
}
actualLocation = actualLocation.with(propertyInSource);
}
}
setCacheableInfo(request, readFromSource.getCachePolicy());
projectedRequest = projectedRequest.next();
++numMerged;
}
if (numMerged == 0) {
// No source requests had results ...