private boolean hasSNS(NodeId nodeId) { if (nodeId != null) { Path path = ConsolidatingChangeLog.getPath(nodeId); return path != null && path.getIndex() > 1; } return false; } }
private boolean hasSNS(NodeId nodeId) { if (nodeId != null) { Path path = ConsolidatingChangeLog.getPath(nodeId); return path != null && path.getIndex() > 1; } return false; } }
/** * {@inheritDoc} */ public void writePathElement(Path path) throws JournalException { writeQName(path.getName()); writeInt(path.getIndex()); }
/** * {@inheritDoc} */ public void writePathElement(Path path) throws JournalException { writeQName(path.getName()); writeInt(path.getIndex()); }
public SessionMoveOperation( PathResolver resolver, String srcAbsPath, String destAbsPath) throws RepositoryException { this.srcAbsPath = srcAbsPath; this.srcPath = getAbsolutePath(resolver, srcAbsPath); this.destAbsPath = destAbsPath; this.destPath = getAbsolutePath(resolver, destAbsPath); if (destPath.getIndex() != Path.INDEX_UNDEFINED) { // subscript in name element String msg = destAbsPath + ": invalid destination path (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } if (srcPath.isAncestorOf(destPath)) { throw new RepositoryException( "Destination path " + destAbsPath + " cannot be descendant of source path " + srcAbsPath + " in a move operation."); } }
public SessionMoveOperation( PathResolver resolver, String srcAbsPath, String destAbsPath) throws RepositoryException { this.srcAbsPath = srcAbsPath; this.srcPath = getAbsolutePath(resolver, srcAbsPath); this.destAbsPath = destAbsPath; this.destPath = getAbsolutePath(resolver, destAbsPath); if (destPath.getIndex() != Path.INDEX_UNDEFINED) { // subscript in name element String msg = destAbsPath + ": invalid destination path (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } if (srcPath.isAncestorOf(destPath)) { throw new RepositoryException( "Destination path " + destAbsPath + " cannot be descendant of source path " + srcAbsPath + " in a move operation."); } }
/** * * @param srcPath * @param destPath * @param srcMgrProvider */ AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider) throws RepositoryException { NodeState srcItemState = getNodeState(srcPath, srcMgrProvider.getHierarchyManager()); this.srcState = srcItemState; this.destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager()); // check for illegal index present in destination path int index = destPath.getIndex(); if (index != Path.INDEX_UNDEFINED) { // subscript in name element String msg = "invalid destination path (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } this.destName = destPath.getName(); this.srcWorkspaceName = srcWorkspaceName; // NOTE: affected-states only needed for transient modifications }
/** * * @param srcPath * @param destPath * @param srcMgrProvider */ AbstractCopy(Path srcPath, Path destPath, String srcWorkspaceName, ManagerProvider srcMgrProvider, ManagerProvider destMgrProvider) throws RepositoryException { NodeState srcItemState = getNodeState(srcPath, srcMgrProvider.getHierarchyManager()); this.srcState = srcItemState; this.destParentState = getNodeState(destPath.getAncestor(1), destMgrProvider.getHierarchyManager()); // check for illegal index present in destination path int index = destPath.getIndex(); if (index != Path.INDEX_UNDEFINED) { // subscript in name element String msg = "invalid destination path (subscript in name element is not allowed)"; log.debug(msg); throw new RepositoryException(msg); } this.destName = destPath.getName(); this.srcWorkspaceName = srcWorkspaceName; // NOTE: affected-states only needed for transient modifications }
/** * Returns the <code>Path</code> of this event. * * @return path or <code>null</code> when no path is associated with the event * @throws RepositoryException if the path can't be constructed */ public Path getQPath() throws RepositoryException { try { Path parent = eventState.getParentPath(); Path child = eventState.getChildRelPath(); if (parent == null || child == null) { // an event without associated path information return null; } else { int index = child.getIndex(); if (index > 0) { return PathFactoryImpl.getInstance().create(parent, child.getName(), index, false); } else { return PathFactoryImpl.getInstance().create(parent, child.getName(), false); } } } catch (MalformedPathException e) { String msg = "internal error: malformed path for event"; log.debug(msg); throw new RepositoryException(msg, e); } }
/** * Returns the <code>Path</code> of this event. * * @return path or <code>null</code> when no path is associated with the event * @throws RepositoryException if the path can't be constructed */ public Path getQPath() throws RepositoryException { try { Path parent = eventState.getParentPath(); Path child = eventState.getChildRelPath(); if (parent == null || child == null) { // an event without associated path information return null; } else { int index = child.getIndex(); if (index > 0) { return PathFactoryImpl.getInstance().create(parent, child.getName(), index, false); } else { return PathFactoryImpl.getInstance().create(parent, child.getName(), false); } } } catch (MalformedPathException e) { String msg = "internal error: malformed path for event"; log.debug(msg); throw new RepositoryException(msg, e); } }
int ind = destPath.getIndex(); if (ind > 0) {
int ind = destPath.getIndex(); if (ind > 0) {
public final Path resolve(Path relative) { if (relative.isAbsolute()) { return relative; } else if (relative.getLength() > 1) { Path first = relative.getFirstElements(); Path last = relative.getLastElement(); return resolve(first).resolve(last); } else if (relative.denotesCurrent()) { return new CurrentPath(this); } else if (relative.denotesParent()) { return new ParentPath(this); } else if (relative.denotesName()) { return new NamePath(this, relative.getName(), relative.getIndex()); } else { throw new IllegalArgumentException( "Unknown path type: " + relative); } }
public final Path resolve(Path relative) { if (relative.isAbsolute()) { return relative; } else if (relative.getLength() > 1) { Path first = relative.getFirstElements(); Path last = relative.getLastElement(); return resolve(first).resolve(last); } else if (relative.denotesCurrent()) { return new CurrentPath(this); } else if (relative.denotesParent()) { return new ParentPath(this); } else if (relative.denotesName()) { return new NamePath(this, relative.getName(), relative.getIndex()); } else { throw new IllegalArgumentException( "Unknown path type: " + relative); } }
if (nodePath.getIndex() != Path.INDEX_UNDEFINED) { String msg = "Illegal subscript specified: " + relPath; log.debug(msg);
if (nodePath.getIndex() != Path.INDEX_UNDEFINED) { String msg = "Illegal subscript specified: " + relPath; log.debug(msg);
if (p.getIndex() == Path.INDEX_UNDEFINED && thisState.hasPropertyName(p.getName())) { return new PropertyId(thisState.getNodeId(), p.getName());
if (p.getIndex() == Path.INDEX_UNDEFINED && thisState.hasPropertyName(p.getName())) { return new PropertyId(thisState.getNodeId(), p.getName());
if (!path.denotesName() || path.getIndex() != Path.INDEX_UNDEFINED) { throw new RepositoryException( "Invalid last path element for adding node "
if (!path.denotesName() || path.getIndex() != Path.INDEX_UNDEFINED) { throw new RepositoryException( "Invalid last path element for adding node "