@Override public boolean isExternal( NodeCache cache) { return !getKey().getSourceKey().equals(cache.getRootKey().getSourceKey()); }
@Override public boolean isExternal( NodeCache cache ) { return !getKey().getSourceKey().equals(cache.getRootKey().getSourceKey()); }
@Override public boolean isExternal( NodeCache cache ) { return !getKey().getSourceKey().equals(cache.getRootKey().getSourceKey()); }
@Override public boolean isExternal( NodeCache cache) { return !getKey().getSourceKey().equals(cache.getRootKey().getSourceKey()); }
public CachedNode rootNode() { return node(cache.getRootKey()); }
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; }
NodeKey key = cache.getRootKey().withId(identifier); CachedNode node = cache.getNode(key); if (node != null && nodeFilter.includeNode(node, cache)) {
NodeKey key = cache.getRootKey().withId(identifier); CachedNode node = cache.getNode(key); if (node != null && nodeFilter.includeNode(node, cache)) {
if (node != null) startingNode = node.getKey(); } else { startingNode = cache.getRootKey();
if (node != null) startingNode = node.getKey(); } else { startingNode = cache.getRootKey();
private static void initNodesCount() throws RepositoryException { JcrSession session = repository.login(); try { NodeCache systemSession = repository.createSystemSession(session.context(), true); totalSystemNodeCount = countAllNodesBelow(systemSession.getRootKey(), systemSession) - 1; // not root totalNodeCount = totalSystemNodeCount + TOTAL_NON_SYSTEM_NODE_COUNT; } finally { session.logout(); } }
@Test public void shouldLoadChildrenReferencesWhenBackedByMultipleBlocks() { CachedNode root = cache.getNode(cache.getRootKey()); CachedNode childB = cache.getNode(root.getChildReferences(cache).getChild(name("childB"))); ChildReferences refs = childB.getChildReferences(cache); assertThat(refs, is(notNullValue())); assertThat(refs.size(), is(2L)); Iterator<ChildReference> iter = refs.iterator(); ChildReference childC = refs.getChild(name("childC")); ChildReference childD = refs.getChild(name("childD")); assertThat(childC.getKey().toString(), is("source1works1-childC")); assertThat(childD.getKey().toString(), is("source1works1-childD")); assertThat(iter.next(), is(childC)); // from first block assertThat(iter.next(), is(childD)); // from second block assertThat(iter.hasNext(), is(false)); }
@Test public void shouldLoadRootNodeIntoCache() { CachedNode node = cache.getNode(cache.getRootKey()); assertThat(node, is(notNullValue())); assertThat(node.getKey(), is(cache.getRootKey())); assertThat(node.getPath(cache).isRoot(), is(true)); assertThat(node.getName(cache).getLocalName().length(), is(0));
@Test public void shouldNavigateFromRootToSystemNode() { CachedNode node = cache.getNode(cache.getRootKey()); ChildReference systemRef = node.getChildReferences(cache).getChild(JcrLexicon.SYSTEM);
if (workspaceCache != null) { CachedNode node = workspaceCache.getNode(workspaceCache.getRootKey()); if (!path.isRoot()) { for (Segment segment : path) {
CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) {
CachedNode node = cache.getNode(cache.getRootKey()); for (Segment segment : path) {
CachedNode rootNode = workspaceCache.getNode(workspaceCache.getRootKey()); logger.debug("Starting reindex of workspace '{0}' content in '{1}' repository.", runningState.name(), workspaceName); if (reindexContent(workspaceName, workspaceCache, rootNode, Integer.MAX_VALUE, false, indexes)) {
CachedNode rootNode = workspaceCache.getNode(workspaceCache.getRootKey()); logger.debug("Starting reindex of workspace '{0}' content in '{1}' repository.", runningState.name(), workspaceName); if (reindexContent(workspaceName, workspaceCache, rootNode, Integer.MAX_VALUE, false, indexes)) {