@Override public Path getAbsolutePath() { return node.getPath(nodeCache); } };
@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(); }
public Path getPath( CachedNode node ) { NodeKey key = node.getKey(); Path path = paths.get(key); if (path == null) { path = node.getPath(this); paths.put(key, path); // even if null } return path; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; Path path = node.getPath(cache); if (trace) NodeSequence.LOGGER.trace("Extracting path from {0}", path); return path; }
private Path path( String workspaceName, NodeKey key ) { NodeCache cache = repo.getWorkspaceCache(workspaceName); return cache.getNode(key).getPath(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; }
@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 Path path() throws ItemNotFoundException, InvalidItemStateException { return node().getPath(sessionCache()); }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; Name name = node.getName(cache); if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name); return name; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; Name name = node.getName(cache); if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name); return name; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); String name = node.getName(cache).getLocalName(); if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name); return name; }
protected final String readableLocation( CachedNode node ) { try { return stringFactory().create(node.getPath(cache)); } catch (Throwable t) { return node.getKey().toString(); } }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); if (node == null) return null; NodeKey parentKey = node.getParentKey(cache); if (trace) NodeSequence.LOGGER.trace("Extracting parent key from {0}: {1}", node.getPath(cache), parentKey); return parentKey != null ? parentKey.toString() : null; }
@Override public Object getValueInRow( RowAccessor row ) { CachedNode node = row.getNode(indexInRow); String name = node.getName(cache).getLocalName(); if (trace) NodeSequence.LOGGER.trace("Extracting name from {0}: {1}", node.getPath(cache), name); return name; }
protected final String readableLocation( CachedNode node ) { try { return stringFactory().create(node.getPath(cache)); } catch (Throwable t) { return node.getKey().toString(); } }
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; if (trace) NodeSequence.LOGGER.trace("Extracting node key from {0}: {1}", node.getPath(cache), node.getKey()); return node.getKey().toString(); }
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)); }