@Override public int countSiblingsNamed( Name childName ) { return node.getChildReferences(cache).getChildCount(childName); } };
@Override public boolean continueProcessingChildren( CachedNode node, NodeCache cache ) { Name nodePrimaryType = node.getPrimaryType(cache); Set<Name> mixinTypes = node.getMixinTypes(cache); return !node.isExcludedFromSearch(cache) && !node.getKey().getWorkspaceKey().equals(systemWorkspaceKey) && !nodeTypes.isQueryable(nodePrimaryType, mixinTypes); } };
@Override public boolean continueProcessingChildren( CachedNode node, NodeCache cache ) { Name nodePrimaryType = node.getPrimaryType(cache); Set<Name> mixinTypes = node.getMixinTypes(cache); return !node.isExcludedFromSearch(cache) && !nodeTypes.isQueryable(nodePrimaryType, mixinTypes); } };
return false; if (node.isExcludedFromSearch(cache)) { return false; indexesUpdated |= indexes.add(workspaceName, node.getKey(), nodePath, node.getPrimaryType(cache), node.getMixinTypes(cache), node.getPropertiesByName(cache)); ChildReferences childRefs = node.getChildReferences(cache); ChildReference systemRef = childRefs.getChild(JcrLexicon.SYSTEM); NodeKey systemKey = systemRef != null ? systemRef.getKey() : null; for (ChildReference childRef : node.getChildReferences(cache)) { NodeKey childKey = childRef.getKey(); if (childKey.equals(systemKey)) { for (ChildReference childRef : node.getChildReferences(cache)) { NodeKey childKey = childRef.getKey(); if (node == null || node.isExcludedFromSearch(cache)) { continue; indexesUpdated |= indexes.add(workspaceName, node.getKey(), nodePath, node.getPrimaryType(cache), node.getMixinTypes(cache), node.getPropertiesByName(cache)); for (ChildReference childRef : node.getChildReferences(cache)) { queue.add(childRef.getKey());
NodeKey key = node.getKey(); List<Path> pathList = paths.get(key); if (pathList == null) { Segment nodeSegment = node.getSegment(cache); NodeKey parentKey = node.getParentKey(cache); if (parentKey == null) { pathList = Collections.singletonList(node.getPath(cache)); } else {
@Override public Property getProperty( Name name ) { // First check the removed properties ... if (removedProperties.containsKey(name)) return null; // Then check the changed properties ... Property property = changedProperties.get(name); if (property == null && raw != null) { // Check the raw property ... property = raw.getProperty(name, cache); } return property; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; return node.getName(cache); } };
@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; }
String existingUri = strings.create(existingNode.getProperty(ModeShapeLexicon.URI, system).getFirstValue()); if (newUri.equals(existingUri)) { if (existingNode != null) { Segment segment = existingNode.getSegment(system); String existingPrefix = prefixFor(segment); if (GENERATED_NAMESPACE_NODE_NAME.equals(segment.getName()) || !existingPrefix.equals(newPrefix)) {
protected ModeShapeLock( CachedNode lockNode, NodeCache cache ) { this.lockKey = lockNode.getKey(); this.lockedNodeKey = lockedNodeKeyFromLockKey(lockKey); this.workspaceName = firstString(lockNode.getProperty(ModeShapeLexicon.WORKSPACE, cache)); this.lockOwner = firstString(lockNode.getProperty(JcrLexicon.LOCK_OWNER, cache)); this.deep = firstBoolean(lockNode.getProperty(JcrLexicon.LOCK_IS_DEEP, cache)); this.sessionScoped = firstBoolean(lockNode.getProperty(ModeShapeLexicon.IS_SESSION_SCOPED, cache)); this.lockToken = firstString(lockNode.getProperty(ModeShapeLexicon.LOCK_TOKEN, cache)); this.lockingSessionId = firstString(lockNode.getProperty(ModeShapeLexicon.LOCKING_SESSION, cache)); this.expiryTime = firstDate(lockNode.getProperty(ModeShapeLexicon.EXPIRATION_DATE, cache)); }
protected Segment segment() throws RepositoryException { return node().getSegment(sessionCache()); }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(index); return node != null ? node.getKey() : null; } });
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; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; return node.getDepth(cache); } };
protected Set<NodeKey> getAdditionalParentKeys( CachedNode node, NodeCache cache ) { return node.getAdditionalParentKeys(cache); } }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(cache); }
boolean isReferenceable() throws RepositoryException { SessionCache cache = sessionCache(); NodeTypes nodeTypes = session().nodeTypes(); try { CachedNode node = node(); return nodeTypes.isReferenceable(node.getPrimaryType(cache), node.getMixinTypes(cache)); } catch (ItemNotFoundException e) { // The node has been removed, so do nothing } return false; }
@Override public boolean isExcludedFromSearch( NodeCache cache ) { Boolean isExcludedFromSearch = this.excludeFromSearch.get(); if (isExcludedFromSearch != null) { return isExcludedFromSearch; } CachedNode persistedNode = nodeInWorkspace(session(cache)); // if the node does not exist yet, it is queryable by default return persistedNode != null && persistedNode.isExcludedFromSearch(cache); }