public NodeKey systemKey() { if (systemKey == null) { // This is idempotent, so no need to lock CachedNode rootNode = system.getNode(system.getRootKey()); ChildReference systemRef = rootNode.getChildReferences(system).getChild(JcrLexicon.SYSTEM); systemKey = systemRef.getKey(); } return systemKey; }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
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; }
public NodeKey nodeTypesKey() { if (nodeTypesKey == null) { // This is idempotent, so no need to lock CachedNode systemNode = systemNode(); ChildReference nodeTypesRef = systemNode.getChildReferences(system).getChild(JcrLexicon.NODE_TYPES); nodeTypesKey = nodeTypesRef.getKey(); } return nodeTypesKey; }
protected MutableCachedNode createNode( SessionCache session, MutableCachedNode parent, String id, Name name, Name primaryType, Property... properties ) { NodeKey key = session.getRootKey().withId(id); return parent.createChild(session, key, name, propFactory.create(JcrLexicon.PRIMARY_TYPE, primaryType), properties); }
@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; }
@Override public int countSiblingsNamed( Name childName ) { return node.getChildReferences(cache).getChildCount(childName); } };
public CachedNode node( NodeKey key ) { CachedNode node = cache.getNode(key); if (node == null) { throw new NodeNotFoundException(key); } return node; }
public NodeKey systemKey() { if (systemKey == null) { // This is idempotent, so no need to lock CachedNode rootNode = system.getNode(system.getRootKey()); ChildReference systemRef = rootNode.getChildReferences(system).getChild(JcrLexicon.SYSTEM); systemKey = systemRef.getKey(); } return systemKey; }
public NodeKey indexesKey() { if (indexesKey == null) { // This is idempotent, so no need to lock CachedNode systemNode = systemNode(); ChildReference nodeTypesRef = systemNode.getChildReferences(system).getChild(ModeShapeLexicon.INDEXES); indexesKey = nodeTypesRef.getKey(); } return indexesKey; }
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 MutableCachedNode createNode( SessionCache session, MutableCachedNode parent, String id, Name name, Name primaryType, Property... properties ) { NodeKey key = session.getRootKey().withId(id); return parent.createChild(session, key, name, propFactory.create(JcrLexicon.PRIMARY_TYPE, primaryType), properties); }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
@Override public int countSiblingsNamed( Name childName ) { return node.getChildReferences(cache).getChildCount(childName); } };
private CachedNode getSystemNode( SessionCache systemSession ) { CachedNode systemRoot = systemSession.getNode(systemSession.getRootKey()); ChildReference systemNodeRef = systemRoot.getChildReferences(systemSession).getChild(JcrLexicon.SYSTEM); assert systemNodeRef != null; return systemSession.getNode(systemNodeRef.getKey()); }
public NodeKey versionStorageKey() { if (versionStorageKey == null) { // This is idempotent, so no need to lock CachedNode systemNode = systemNode(); ChildReference locksRef = systemNode.getChildReferences(system).getChild(JcrLexicon.VERSION_STORAGE); versionStorageKey = locksRef.getKey(); } return versionStorageKey; }
private CachedNode getSystemNode( SessionCache systemSession ) { CachedNode systemRoot = systemSession.getNode(systemSession.getRootKey()); ChildReference systemNodeRef = systemRoot.getChildReferences(systemSession).getChild(JcrLexicon.SYSTEM); assert systemNodeRef != null; return systemSession.getNode(systemNodeRef.getKey()); }
public NodeKey indexesKey() { if (indexesKey == null) { // This is idempotent, so no need to lock CachedNode systemNode = systemNode(); ChildReference nodeTypesRef = systemNode.getChildReferences(system).getChild(ModeShapeLexicon.INDEXES); indexesKey = nodeTypesRef.getKey(); } return indexesKey; }
public NodeKey versionStorageKey() { if (versionStorageKey == null) { // This is idempotent, so no need to lock CachedNode systemNode = systemNode(); ChildReference locksRef = systemNode.getChildReferences(system).getChild(JcrLexicon.VERSION_STORAGE); versionStorageKey = locksRef.getKey(); } return versionStorageKey; }