this.properties = cache.NO_PROPERTIES;
return;
}
// Check authorization before reading ...
Path path = getPath();
cache.authorizer.checkPermissions(path, Action.READ);
int depth = cache.getDepthForLoadingNodes();
if (depth == 1) {
// Then read the node from the store ...
org.jboss.dna.graph.Node persistentNode = cache.store.getNodeAt(getLocation());
// Check the actual location ...
Location actualLocation = persistentNode.getLocation();
if (!this.location.isSame(actualLocation)) {
// The actual location is changed, so update it ...
this.location = actualLocation;
}
// Update the persistent information ...
cache.nodeOperations.materialize(persistentNode, this);
} else {
// Then read the node from the store ...
Subgraph subgraph = cache.store.getSubgraphOfDepth(depth).at(getLocation());
Location actualLocation = subgraph.getLocation();
if (!this.location.isSame(actualLocation)) {
// The actual location is changed, so update it ...
this.location = actualLocation;
}
// Update the persistent information ...
cache.nodeOperations.materialize(subgraph.getRoot(), this);
// Now update any nodes below this node ...
for (org.jboss.dna.graph.Node persistentNode : subgraph) {
// Find the node at the path ...
Path relativePath = persistentNode.getLocation().getPath().relativeTo(path);
Node<Payload, PropertyPayload> node = cache.findNodeRelativeTo(this, relativePath);
if (!node.isLoaded()) {
// Update the persistent information ...
cache.nodeOperations.materialize(persistentNode, node);
}