@Override public void nextRow() { NodeKey key = keys.next(); current = cache.getNode(key); }
@Override public void nextRow() { NodeKey key = keys.next(); current = cache.getNode(key); }
@Override public void nextRow() { NodeKey key = keys.next(); current = cache.getNode(key); Float score = scores.next(); this.score = score != null ? score.floatValue() : 1.0f; }
@Override public void nextRow() { NodeKey key = keys.next(); current = cache.getNode(key); Float score = scores.next(); this.score = score != null ? score.floatValue() : 1.0f; }
@Override public String toString() { StringBuilder sb = new StringBuilder("(nodes from ").append(cache); // Compute the path ... sb.append(" under ").append(cache.getNode(startingNode).getPath(cache)); if (filter != null) sb.append(" satisfying ").append(filter); sb.append(")"); return sb.toString(); }
protected CachedNode getNodeAtPath( Path path, NodeCache cache ) { CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) { ChildReference childRef = node.getChildReferences(cache).getChild(segment); if (childRef == null) return null; node = cache.getNode(childRef); } return node; }
protected CachedNode getNodeAtPath( Path path, NodeCache cache ) { CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) { ChildReference childRef = node.getChildReferences(cache).getChild(segment); if (childRef == null) return null; node = cache.getNode(childRef); } return node; }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); while (node != null) { NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) return false; if (ancestorKey.equals(parentKey)) return true; // Don't have to check the additional parents since we only find shared nodes in the original location ... node = cache.getNode(parentKey); } return false; }
public CachedNode node( NodeKey key ) { CachedNode node = cache.getNode(key); if (node == null) { throw new NodeNotFoundException(key); } return node; }
@Override public boolean isCurrentRowValid( Batch batch ) { CachedNode node = batch.getNode(index); while (node != null) { NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) return false; if (ancestorKey.equals(parentKey)) return true; // Don't have to check the additional parents since we only find shared nodes in the original location ... node = cache.getNode(parentKey); } return false; }
String unlock( JcrSession session, NodeKey lockedNodeKey ) throws LockException { ModeShapeLock existing = locksByNodeKey.remove(lockedNodeKey); if (existing == null) { NodeCache cache = session.cache(); String location = session.stringFactory().create(cache.getNode(lockedNodeKey).getPath(cache)); throw new LockException(JcrI18n.notLocked.text(location)); } unlock(session, Collections.singleton(existing)); return existing.getLockToken(); }
String unlock( JcrSession session, NodeKey lockedNodeKey ) throws LockException { ModeShapeLock existing = locksByNodeKey.remove(lockedNodeKey); if (existing == null) { NodeCache cache = session.cache(); String location = session.stringFactory().create(cache.getNode(lockedNodeKey).getPath(cache)); throw new LockException(JcrI18n.notLocked.text(location)); } unlock(session, Collections.singleton(existing)); return existing.getLockToken(); }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) return null; CachedNode parent = cache.getNode(parentKey); if (parent == null) return null; Path parentPath = parent.getPath(cache); if (trace) NodeSequence.LOGGER.trace("Extracting parent path from {0}: {1}", node.getPath(cache), parentPath); return parentPath; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) return null; CachedNode parent = cache.getNode(parentKey); if (parent == null) return null; Path parentPath = parent.getPath(cache); if (trace) NodeSequence.LOGGER.trace("Extracting parent path from {0}: {1}", node.getPath(cache), parentPath); return parentPath; }
protected void findAllNodesAtOrBelow( NodeKey key, Set<NodeKey> foundKeys ) { CachedNode node = cache.getNode(key); assertThat(node, is(notNullValue())); foundKeys.add(key); Iterator<NodeKey> iter = node.getChildReferences(cache).getAllKeys(); while (iter.hasNext()) { findAllNodesAtOrBelow(iter.next(), foundKeys); } }
private static int countAllNodesBelow( NodeKey nodeKey, NodeCache cache ) throws RepositoryException { CachedNode node = cache.getNode(nodeKey); if (node.isExcludedFromSearch(cache)) return 0; int result = 1; ChildReferences childReferences = node.getChildReferences(cache); for (Iterator<NodeKey> nodeKeyIterator = childReferences.getAllKeys(); nodeKeyIterator.hasNext();) { NodeKey childKey = nodeKeyIterator.next(); result += countAllNodesBelow(childKey, cache); } return result; }
private ModeShapeLock throwAlreadyLocked(JcrSession session, ModeShapeLock existing) throws LockException { NodeCache cache = session.cache(); CachedNode locked = cache.getNode(existing.getLockedNodeKey()); String lockedPath = session.stringFactory().create(locked.getPath(cache)); throw new LockException(JcrI18n.alreadyLocked.text(lockedPath)); }
private ModeShapeLock throwAlreadyLocked(JcrSession session, ModeShapeLock existing) throws LockException { NodeCache cache = session.cache(); CachedNode locked = cache.getNode(existing.getLockedNodeKey()); String lockedPath = session.stringFactory().create(locked.getPath(cache)); throw new LockException(JcrI18n.alreadyLocked.text(lockedPath)); }
protected void reindexSystemContent() { RepositoryCache repoCache = runningState.repositoryCache(); String workspaceName = repoCache.getSystemWorkspaceName(); NodeCache systemWorkspaceCache = repoCache.getWorkspaceCache(workspaceName); CachedNode systemNode = systemWorkspaceCache.getNode(repoCache.getSystemKey()); if (reindexContent(workspaceName, systemWorkspaceCache, systemNode, Integer.MAX_VALUE, true, getIndexWriter())) { commitChanges(workspaceName); } }