protected CachedNode parent( WorkspaceCache cache ) { NodeKey parentKey = getParentKey(cache); if (parentKey == null) { return null; } CachedNode parent = cache.getNode(parentKey); if (parent == null) { throw new NodeNotFoundException(parentKey); } return parent; }
protected CachedNode parent( WorkspaceCache cache ) { NodeKey parentKey = getParentKey(cache); if (parentKey == null) { return null; } CachedNode parent = cache.getNode(parentKey); if (parent == null) { throw new NodeNotFoundException(parentKey); } return parent; }
public CachedNode node( NodeKey key ) { CachedNode node = cache.getNode(key); if (node == null) { throw new NodeNotFoundException(key); } return node; }
@Override public int getDepth( NodeCache cache ) throws NodeNotFoundException { WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { // This is not the root, so get our parent's depth and add 1 ... return parent.getDepth(cache) + 1; } // make sure that this isn't a node which has been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return 0; }
@Override public int getDepth( NodeCache cache ) throws NodeNotFoundException { WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { // This is not the root, so get our parent's depth and add 1 ... return parent.getDepth(cache) + 1; } // make sure that this isn't a node which has been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return 0; }
@Override public int getDepth( NodeCache cache ) throws NodeNotFoundException { AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { // This is not the root, so get our parent's depth and add 1 ... return parent.getDepth(cache) + 1; } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return 0; }
@Override public int getDepth( NodeCache cache ) throws NodeNotFoundException { AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { // This is not the root, so get our parent's depth and add 1 ... return parent.getDepth(cache) + 1; } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return 0; }
throw new NodeNotFoundException(childKey);
@Override public void renameChild( SessionCache cache, NodeKey key, Name newName ) { WritableSessionCache session = writableSession(cache); session.assertInSession(this); ChildReferences references = getChildReferences(session); if (!references.hasChild(key)) throw new NodeNotFoundException(key); // We need a mutable node in the session for the child, so that we can find changes in the parent ... cache.mutable(key); // If the node was previously appended ... MutableChildReferences appended = this.appended.get(); if (appended != null && appended.hasChild(key)) { // Just remove and re-add with the new name ... appended.remove(key); appended.append(key, newName); } else { // Now perform the rename ... changedChildren.renameTo(key, newName); } }
if (nextNode != null) { before = references.getChild(nextNode); if (before == null) throw new NodeNotFoundException(key); if (toBeMoved == null) throw new NodeNotFoundException(key); if (changedChildren.inserted(key) == null) {
@Override public void renameChild( SessionCache cache, NodeKey key, Name newName ) { WritableSessionCache session = writableSession(cache); session.assertInSession(this); ChildReferences references = getChildReferences(session); if (!references.hasChild(key)) throw new NodeNotFoundException(key); // We need a mutable node in the session for the child, so that we can find changes in the parent ... cache.mutable(key); // If the node was previously appended ... MutableChildReferences appended = this.appended.get(); if (appended != null && appended.hasChild(key)) { // Just remove and re-add with the new name ... appended.remove(key); appended.append(key, newName); } else { // Now perform the rename ... changedChildren.renameTo(key, newName); } }
if (nextNode != null) { before = references.getChild(nextNode); if (before == null) throw new NodeNotFoundException(key); if (toBeMoved == null) throw new NodeNotFoundException(key); if (changedChildren.inserted(key) == null) {
@Override public Path getPath( NodeCache cache ) { WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { Path parentPath = parent.getPath(wsCache); return wsCache.pathFactory().create(parentPath, getSegment(wsCache)); } // check that the node hasn't been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return wsCache.rootPath(); }
@Override public Path getPath( NodeCache cache ) { WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { Path parentPath = parent.getPath(wsCache); return wsCache.pathFactory().create(parentPath, getSegment(wsCache)); } // check that the node hasn't been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return wsCache.rootPath(); }
@Override public Path getPath( PathCache pathCache ) throws NodeNotFoundException { NodeCache cache = pathCache.getCache(); WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { Path parentPath = pathCache.getPath(parent); return wsCache.pathFactory().create(parentPath, getSegment(wsCache)); } // check that the node hasn't been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return wsCache.rootPath(); }
@Override public Path getPath( NodeCache cache ) { AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { Path parentPath = parent.getPath(session); return session.pathFactory().create(parentPath, getSegment(session, parent)); } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return session.rootPath(); }
@Override public Path getPath( NodeCache cache ) { AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { Path parentPath = parent.getPath(session); return session.pathFactory().create(parentPath, getSegment(session, parent)); } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return session.rootPath(); }
@Override public Path getPath( PathCache pathCache ) throws NodeNotFoundException { NodeCache cache = pathCache.getCache(); WorkspaceCache wsCache = workspaceCache(cache); CachedNode parent = parent(wsCache); if (parent != null) { Path parentPath = pathCache.getPath(parent); return wsCache.pathFactory().create(parentPath, getSegment(wsCache)); } // check that the node hasn't been removed in the meantime if (wsCache.getNode(key) == null) { throw new NodeNotFoundException(key); } // This is the root node ... return wsCache.rootPath(); }
@Override public Path getPath( PathCache pathCache ) throws NodeNotFoundException { NodeCache cache = pathCache.getCache(); AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { Path parentPath = pathCache.getPath(parent); return session.pathFactory().create(parentPath, getSegment(session, parent)); } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return session.rootPath(); }
@Override public Path getPath( PathCache pathCache ) throws NodeNotFoundException { NodeCache cache = pathCache.getCache(); AbstractSessionCache session = session(cache); CachedNode parent = parent(session); if (parent != null) { Path parentPath = pathCache.getPath(parent); return session.pathFactory().create(parentPath, getSegment(session, parent)); } // make sure that this isn't a node which has been removed in the meantime CachedNode persistedNode = workspace(cache).getNode(key); if (persistedNode == null) { throw new NodeNotFoundException(key); } // This is the root node ... return session.rootPath(); }