ReadNodeRequest readFromSource = (ReadNodeRequest)sourceRequest;
Location sourceLocation = readFromSource.getActualLocationOfNode();
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);
}
}
// Make sure we have an actual location ...
actualLocation = determineActualLocation(actualLocation, sourceLocation, projection);
if (federatedPath == null) federatedPath = actualLocation.getPath();
// Add all the children from the source ...
for (Location childInSource : readFromSource.getChildren()) {
request.addChild(getChildLocationWithCorrectSnsIndex(childInSource,
federatedPath,
childSnsIndexes,
projection));
}
// Add all the properties ...
for (Property propertyInSource : readFromSource.getProperties()) {
Name name = propertyInSource.getName();
Property existing = properties.get(name);
if (existing != null) {
// Merge the property values ...
propertyInSource = merge(existing, propertyInSource, propertyFactory, true);
}