Author: angela Date: Thu Oct 18 11:30:25 2007 New Revision: 586055 URL: http://svn.apache.org/viewvc?rev=586055&view=rev Log: JCR-996 Name and Path interfaces in SPI Added: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java (with props) jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java (with props) jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java (with props) jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java (with props) Modified: jackrabbit/trunk/jackrabbit-spi/pom.xml jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ChildInfo.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventFilter.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemId.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemInfo.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyId.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java Modified: jackrabbit/trunk/jackrabbit-spi/pom.xml URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/pom.xml?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/pom.xml (original) +++ jackrabbit/trunk/jackrabbit-spi/pom.xml Thu Oct 18 11:30:25 2007 @@ -58,10 +58,6 @@ - org.apache.jackrabbit - jackrabbit-jcr-commons - - javax.jcr jcr Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Batch.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import javax.jcr.ItemExistsException; import javax.jcr.PathNotFoundException; import javax.jcr.AccessDeniedException; @@ -101,7 +99,7 @@ * @see javax.jcr.Session#importXML(String, java.io.InputStream, int) * @see javax.jcr.query.Query#storeAsNode(String) */ - public void addNode(NodeId parentId, QName nodeName, QName nodetypeName, String uuid) throws RepositoryException; + public void addNode(NodeId parentId, Name nodeName, Name nodetypeName, String uuid) throws RepositoryException; /** * Add a new property to the persistent layer. @@ -130,7 +128,7 @@ * @see javax.jcr.Session#importXML(String, java.io.InputStream, int) * @see javax.jcr.query.Query#storeAsNode(String) */ - public void addProperty(NodeId parentId, QName propertyName, QValue value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, PathNotFoundException, ItemExistsException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; + public void addProperty(NodeId parentId, Name propertyName, QValue value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, PathNotFoundException, ItemExistsException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; /** * Add a new multi-valued property to the persistent layer. @@ -153,7 +151,7 @@ * @see javax.jcr.Node#setProperty(String, String[], int) * @see javax.jcr.Session#importXML(String, java.io.InputStream, int) */ - public void addProperty(NodeId parentId, QName propertyName, QValue[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, PathNotFoundException, ItemExistsException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; + public void addProperty(NodeId parentId, Name propertyName, QValue[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, PathNotFoundException, ItemExistsException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; /** * Modify the value of an existing property. @@ -232,7 +230,7 @@ * given id. * * @param nodeId NodeId identifying the node to be modified. - * @param mixinNodeTypeIds The new set of mixin types. Compared to the + * @param mixinNodeTypeNames The new set of mixin types. Compared to the * previous values this may result in both adding and/or removing mixin types. * @throws javax.jcr.nodetype.NoSuchNodeTypeException * @throws javax.jcr.version.VersionException @@ -244,7 +242,7 @@ * @see javax.jcr.Node#addMixin(String) * @see javax.jcr.Node#removeMixin(String) */ - public void setMixins(NodeId nodeId, QName[] mixinNodeTypeIds) throws RepositoryException; + public void setMixins(NodeId nodeId, Name[] mixinNodeTypeNames) throws RepositoryException; /** * Move the node identified by the given srcNodeId to the @@ -264,5 +262,5 @@ * @throws javax.jcr.RepositoryException * @see javax.jcr.Session#move(String, String) */ - public void move(NodeId srcNodeId, NodeId destParentNodeId, QName destName) throws RepositoryException; + public void move(NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws RepositoryException; } Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ChildInfo.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ChildInfo.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ChildInfo.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ChildInfo.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - /** * ChildInfo... */ @@ -28,7 +26,7 @@ * * @return The name of the child Node. */ - public QName getName(); + public Name getName(); /** * Returns the uniqueID of the child Node or null Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Event.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; -import org.apache.jackrabbit.name.Path; - /** * Event is similar to the regular JCR Event and adds additional * information about the affected item. @@ -75,7 +72,7 @@ * @return the path of the affected item. E.g. the added/removed node or the * property that was added/removed/changed. */ - public Path getQPath(); + public Path getPath(); /** * @return the id of the affected item. @@ -92,14 +89,14 @@ * this event. * @see javax.jcr.observation.ObservationManager#addEventListener */ - public QName getPrimaryNodeTypeName(); + public Name getPrimaryNodeTypeName(); /** * @return the names of the mixin types of the 'associated' node of this * event. * @see javax.jcr.observation.ObservationManager#addEventListener */ - public QName[] getMixinTypeNames(); + public Name[] getMixinTypeNames(); /** * Returns the user ID connected with this event. This is the string Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventFilter.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventFilter.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventFilter.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/EventFilter.java Thu Oct 18 11:30:25 2007 @@ -22,7 +22,7 @@ * An EventFilter is applied to the events as generated on the * repository server. Event filter instances can be created with {@link * RepositoryService#createEventFilter(SessionInfo, int, - * org.apache.jackrabbit.name.Path, boolean, String[], org.apache.jackrabbit.name.QName[], boolean)}. + * Path, boolean, String[], Name[], boolean)}. * Some repository implementations may * also support event filters that are directly instantiated by the client. */ Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/IdFactory.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; -import org.apache.jackrabbit.name.Path; - /** * IdFactory defines methods to construct new ItemIds. * This factory is intended to build ItemIds from the parameters @@ -39,7 +36,7 @@ * @param propertyName * @return a new PropertyId. */ - public PropertyId createPropertyId(NodeId parentId, QName propertyName); + public PropertyId createPropertyId(NodeId parentId, Name propertyName); /** * Creates a new NodeId from the given parent id and Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemId.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemId.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemId.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemId.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.Path; - /** * An ItemId identifies an item using a combination of unique ID * and path. There are three basic forms of an ItemId. The following Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemInfo.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemInfo.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemInfo.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/ItemInfo.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; -import org.apache.jackrabbit.name.Path; - /** * The ItemInfo is the base interface of {@link NodeInfo} * and {@link PropertyInfo}. @@ -34,11 +31,11 @@ /** * Returns the qualified representation of the item name. For the root node - * expected return value is {@link QName#ROOT}. + * expected return value is {""}"". * * @return the qualified representation of the item name. */ - public QName getQName(); + public Name getName(); /** * Returns true if this ItemInfo denotes a node, false otherwise. Added: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java?rev=586055&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java (added) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java Thu Oct 18 11:30:25 2007 @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.spi; + +import java.io.Serializable; + +/** + * A Name is a combination of a namespace URI and a local part. + * Instances of this class are used to internally represent the names of JCR + * content items and other objects within a content repository. + *

+ * A Name is immutable once created. + *

+ * The String representation of a Name object must be in the + * format "{namespaceURI}localPart". + *

+ * An implementation of the Name interface must implement the + * {@link Object#equals(Object)} method such that two Name objects are equal if + * both the namespace URI and the local part are equal. + */ +public interface Name extends Comparable, Cloneable, Serializable { + + // default namespace (empty uri) + public static final String NS_EMPTY_PREFIX = ""; + public static final String NS_DEFAULT_URI = ""; + + // reserved namespace for repository internal node types + public static final String NS_REP_PREFIX = "rep"; + public static final String NS_REP_URI = "internal"; + + // reserved namespace for items defined by built-in node types + public static final String NS_JCR_PREFIX = "jcr"; + public static final String NS_JCR_URI = "http://www.jcp.org/jcr/1.0"; + + // reserved namespace for built-in primary node types + public static final String NS_NT_PREFIX = "nt"; + public static final String NS_NT_URI = "http://www.jcp.org/jcr/nt/1.0"; + + // reserved namespace for built-in mixin node types + public static final String NS_MIX_PREFIX = "mix"; + public static final String NS_MIX_URI = "http://www.jcp.org/jcr/mix/1.0"; + + // reserved namespace used in the system view XML serialization format + public static final String NS_SV_PREFIX = "sv"; + public static final String NS_SV_URI = "http://www.jcp.org/jcr/sv/1.0"; + + // reserved namespaces that must not be redefined and should not be used + public static final String NS_XML_PREFIX = "xml"; + public static final String NS_XML_URI = "http://www.w3.org/XML/1998/namespace"; + public static final String NS_XMLNS_PREFIX = "xmlns"; + public static final String NS_XMLNS_URI = "http://www.w3.org/2000/xmlns/"; + + /** + * Empty array of Name + */ + public static final Name[] EMPTY_ARRAY = new Name[0]; + + /** + * Returns the local part of this Name object. + * + * @return local name + */ + public String getLocalName(); + + /** + * Returns the namespace URI of this Name object. + * + * @return namespace URI + */ + public String getNamespaceURI(); +} Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Name.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java?rev=586055&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java (added) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java Thu Oct 18 11:30:25 2007 @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.spi; + +/** + * NameFactory... + */ +public interface NameFactory { + + /** + * Returns a Name with the given namespace URI and + * local part and validates the given parameters. + * + * @param namespaceURI namespace uri + * @param localName local part + * @throws IllegalArgumentException if namespaceURI or + * localName is invalid. + */ + public Name create(String namespaceURI, String localName) throws IllegalArgumentException; + + /** + * Returns a Name holding the value of the specified + * string. The string must be in the format returned by the + * Name.toString() method, i.e. + *

+ * {namespaceURI}localName + * + * @param nameString a String containing the Name + * representation to be parsed. + * @return the Name represented by the argument + * @throws IllegalArgumentException if the specified string can not be parsed + * as a Name. + */ + public Name create(String nameString) throws IllegalArgumentException; +} \ No newline at end of file Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NameFactory.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/NodeInfo.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import java.util.Iterator; /** @@ -49,17 +47,17 @@ public int getIndex(); /** - * @return QName representing the name of the primary nodetype. + * @return Name representing the name of the primary nodetype. */ - public QName getNodetype(); + public Name getNodetype(); /** - * @return Array of QName representing the names of mixin nodetypes. This - * includes only explicitly assigned mixin nodetypes. It does not include + * @return Array of Names representing the names of mixin nodetypes. + * This includes only explicitly assigned mixin nodetypes. It does not include * mixin types inherited through the additon of supertypes to the primary * type hierarchy. */ - public QName[] getMixins(); + public Name[] getMixins(); /** * @return {@link PropertyId Id}s of the properties that are referencing the Added: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java?rev=586055&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java (added) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java Thu Oct 18 11:30:25 2007 @@ -0,0 +1,371 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.spi; + +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import java.io.Serializable; + +/** + * The Path interface defines the qualified representation of + * a JCR path. It consists of {@link Path.Element} objects and is immutable. + * It has the following properties: + *

+ * isAbsolute():
+ * A path is absolute if the first path element denotes the root element '/'. + *

+ * isNormalized():
+ * A path is normalized if all '.' and '..' path elements are resolved as much + * as possible. If the path is absolute it is normalized if it contains + * no such elements. For example the path '../../a' is normalized where as + * '../../b/../a/.' is not. Normalized paths never have '.' elements. + * Absolute normalized paths have no and relative normalized paths have no or + * only leading '..' elements. + *

+ * isCanonical():
+ * A path is canonical if its absolute and normalized. + *

+ * Note, that the implementation must implement the equals method such that + * two Path objects having the equal Elements + * must be equal. + */ +public interface Path extends Serializable { + + /** + * Constant representing an undefined index value + */ + public static final int INDEX_UNDEFINED = 0; + + /** + * Constant representing the default (initial) index value. + */ + public static final int INDEX_DEFAULT = 1; + + /** + * Constant defining the depth of the root path + */ + public static final int ROOT_DEPTH = 0; + + /** + * Delimiter used in order to concatenate the Path.Element objects + * upon {@link Path#getString()}. + */ + public static final char DELIMITER = '\t'; + + /** + * Tests whether this path represents the root path, i.e. "/". + * + * @return true if this path represents the root path; false otherwise. + */ + public boolean denotesRoot(); + + /** + * Tests whether this path is absolute, i.e. whether it starts with "/". + * + * @return true if this path is absolute; false otherwise. + */ + public boolean isAbsolute(); + + /** + * Tests whether this path is canonical, i.e. whether it is absolute and + * does not contain redundant elements such as "." and "..". + * + * @return true if this path is canonical; false otherwise. + * @see #isAbsolute() + */ + public boolean isCanonical(); + + /** + * Tests whether this path is normalized, i.e. whether it does not + * contain redundant elements such as "." and "..". + *

+ * Note that a normalized path can still contain ".." elements if they are + * not redundant, e.g. "../../a/b/c" would be a normalized relative path, + * whereas "../a/../../a/b/c" wouldn't (although they're semantically + * equivalent). + * + * @return true if this path is normalized; false otherwise. + * @see #getNormalizedPath() + */ + public boolean isNormalized(); + + /** + * Returns the normalized path representation of this path. This typically + * involves removing/resolving redundant elements such as "." and ".." from + * the path, e.g. "/a/./b/.." will be normalized to "/a", "../../a/b/c/.." + * will be normalized to "../../a/b", and so on. + *

+ * If the normalized path results in an empty path (eg: 'a/..') or if an + * absolute path is normalized that would result in a 'negative' path + * (eg: /a/../../) a MalformedPathException is thrown. + * + * @return a normalized path representation of this path. + * @throws RepositoryException if the path cannot be normalized. + * @see #isNormalized() + */ + public Path getNormalizedPath() throws RepositoryException; + + /** + * Returns the canonical path representation of this path. This typically + * involves removing/resolving redundant elements such as "." and ".." from + * the path. + * + * @return a canonical path representation of this path. + * @throws RepositoryException if this path can not be canonicalized + * (e.g. if it is relative). + */ + public Path getCanonicalPath() throws RepositoryException; + + /** + * Computes the relative path from this absolute path to + * other. + * + * @param other an absolute path. + * @return the relative path from this path to other + * path. + * @throws RepositoryException if either this or + * other path is not absolute. + */ + public Path computeRelativePath(Path other) throws RepositoryException; + + /** + * Returns the ancestor path of the specified relative degree. + *

+ * An ancestor of relative degree x is the path that is x + * levels up along the path. + *

+ *

+ * Note that there migth be an unexpected result if this path is not + * normalized, e.g. the ancestor of degree = 1 of the path "../.." would + * be ".." although this is not the parent of "../..". + * + * @param degree the relative degree of the requested ancestor. + * @return the ancestor path of the specified degree. + * @throws PathNotFoundException if there is no ancestor of the specified degree. + * @throws IllegalArgumentException if degree is negative. + */ + public Path getAncestor(int degree) throws IllegalArgumentException, PathNotFoundException; + + /** + * Returns the number of ancestors of this path. This is the equivalent + * of {@link #getDepth()} - 1. + *

+ * Note that the returned value might be negative if this path is not + * canonical, e.g. the depth of "../../a" is -1, its ancestor count is + * therefore -2. + * + * @return the number of ancestors of this path + * @see #getDepth() + * @see #getLength() + * @see #isCanonical() + */ + public int getAncestorCount(); + + /** + * Returns the length of this path, i.e. the number of its elements. + * Note that the root element "/" counts as a separate element, e.g. + * the length of "/a/b/c" is 4 whereas the length of "a/b/c" is 3. + *

+ * Also note that the special elements "." and ".." are not treated + * specially, e.g. both "/a/./.." and "/a/b/c" have a length of 4 + * but this value does not necessarily reflect the true hierarchy level as + * returned by {@link #getDepth()}. + * + * @return the length of this path + * @see #getDepth() + * @see #getAncestorCount() + */ + public int getLength(); + + /** + * Returns the depth of this path. The depth reflects the absolute or + * relative hierarchy level this path is representing, depending on whether + * this path is an absolute or a relative path. The depth also takes '.' + * and '..' elements into account. + *

+ * Note that the returned value might be negative if this path is not + * canonical, e.g. the depth of "../../a" is -1. + * + * @return the depth this path + * @see #getLength() + * @see #getAncestorCount() + */ + public int getDepth(); + + /** + * Determines if this path is an ancestor of the specified path, + * based on their (absolute or relative) hierarchy level as returned by + * {@link #getDepth()}. + * + * @return true if other is a descendant; + * otherwise false. + * @throws IllegalArgumentException if the given path is null + * or if not both paths are either absolute or relative. + * @throws RepositoryException if any of the path cannot be normalized. + * @see #getDepth() + */ + public boolean isAncestorOf(Path other) throws IllegalArgumentException, RepositoryException; + + /** + * Determines if this path is a descendant of the specified path, + * based on their (absolute or relative) hierarchy level as returned by + * {@link #getDepth()}. + * + * @return true if other is an ancestor; + * otherwise false + * @throws IllegalArgumentException If the given path is null. + * @throws RepositoryException if not both paths are either absolute or + * relative. + * @see #getDepth() + */ + public boolean isDescendantOf(Path other) throws IllegalArgumentException, RepositoryException; + + /** + * Returns a new Path consisting of those Path.Element objects + * between the given from, inclusive, and the given to, + * exclusive. An IllegalArgumentException is thrown if from + * is greater or equal than to or if any of both params is + * out of the possible range. A RepositoryException is thrown + * if this Path is not normalized. + * + * @param from + * @param to + * @return + * @throws IllegalArgumentException + * @throws RepositoryException If this Path is not normalized. + */ + public Path subPath(int from, int to) throws IllegalArgumentException, RepositoryException; + + /** + * Returns the elements of this path. + * + * @return the elements of this path. + */ + public Element[] getElements(); + + /** + * Returns the name element (i.e. the last element) of this path. + * + * @return the name element of this path + */ + public Element getNameElement(); + + /** + * Returns the String representation of this Path as it is used + * by {@link PathFactory#create(String)}.

+ * The String representation must consist of the String representation of + * its elements separated by {@link Path#DELIMITER}. + * + * @see Path.Element#getString() + * @return + */ + public String getString(); + + //----------------------------------------------------< inner interface >--- + /** + * Object representation of a single JCR path element. An Element + * object contains the Name and optional index of a single + * JCR path element. + *

+ * Once created, a Element object must be immutable. + *

+ * The String presentation of an Element must be in the format + * "{namespaceURI}localPart" or + * "{namespaceURI}localPart[index]" case of an index greater + * than {@link Path#INDEX_DEFAULT}. + *

+ * Note, that the implementation must implement the equals method such, that + * two Element objects having equals Names and the + * same normalized index must be equal. + */ + public interface Element extends Serializable { + + /** + * Returns the qualified name of this path element. + * + * @return qualified name + */ + public Name getName(); + + /** + * Returns the index of the element as it has been assigned upon creation. + * + * @return index of the element as it has been assigned upon creation. + */ + public int getIndex(); + + /** + * Returns the normalized index of this path element, i.e. the index + * is always equals or greater that {@link Path#INDEX_DEFAULT}. + * + * @return the normalized index. + */ + public int getNormalizedIndex(); + + /** + * Returns true if this element denotes the root element, + * otherwise returns false. + * + * @return true if this element denotes the root + * element; otherwise false + */ + public boolean denotesRoot(); + + /** + * Returns true if this element denotes the parent + * ('..') element, otherwise returns false. + * + * @return true if this element denotes the parent + * element; otherwise false + */ + public boolean denotesParent(); + + /** + * Returns true if this element denotes the current + * ('.') element, otherwise returns false. + * + * @return true if this element denotes the current + * element; otherwise false + */ + public boolean denotesCurrent(); + + /** + * Returns true if this element represents a regular name + * (i.e. neither root, '.' nor '..'), otherwise returns false. + * + * @return true if this element represents a regular name; + * otherwise false + */ + public boolean denotesName(); + + /** + * Return the String presentation of a{@link Path.Element}. It must be + * in the format "{namespaceURI}localPart" or + * "{namespaceURI}localPart[index]" in case of an index + * greater than {@link Path#INDEX_DEFAULT}. + * + * @return + */ + public String getString(); + } +} \ No newline at end of file Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/Path.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Added: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java?rev=586055&view=auto ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java (added) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java Thu Oct 18 11:30:25 2007 @@ -0,0 +1,181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.spi; + +import javax.jcr.RepositoryException; + +/** + * PathFactory... + */ +public interface PathFactory { + + /** + * Return a new Path out of the given parent path + * string and the given relative path string. If normalize is + * true, the returned path will be normalized (or + * canonicalized, if the parent path is absolute). + * + * @param parent + * @param relPath + * @param normalize + * @return + * @throws IllegalArgumentException if relPath is absolute. + * @throws RepositoryException if normalize is true but the + * created Path cannot be normalized. + */ + public Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, RepositoryException; + + /** + * Creates a new Path out of the given parent path + * string and the give name. If normalize is true, + * the returned path will be normalized (or canonicalized, if the parent + * path is absolute). Use {@link PathFactory#create(Path, Name, int, boolean)} + * in order to build a Path having an index with his name element. + * + * @param parent the parent path + * @param name the name of the new path element. + * @param normalize + * @return + * @throws RepositoryException + */ + public Path create(Path parent, Name name, boolean normalize) throws RepositoryException; + + /** + * Creates a new Path out of the given parent path + * and the give name and normalized index. See also + * {@link PathFactory#create(Path, Name, boolean)}. + * + * @param parent the parent path. + * @param name the name of the new path element. + * @param index the index of the new path element. + * @param normalize If true the Path is normalized before being returned. + * @return + * @throws IllegalArgumentException If the given index is lower than + * {@link Path#INDEX_UNDEFINED}. + * @throws RepositoryException If the normalized is + * true and the path cannot be normalized. + */ + public Path create(Path parent, Name name, int index, boolean normalize) throws IllegalArgumentException, RepositoryException; + + /** + * Creates a relative path based on a {@link Name}. + * + * @param name single {@link Name} for this relative path. + * @return the relative path created from name. + * @throws IllegalArgumentException if the name is null. + */ + public Path create(Name name) throws IllegalArgumentException; + + /** + * Creates a relative path based on a {@link Name} and a normalized index. + * Same as {@link #create(Name)} but allows to explicitely specify an + * index. + * + * @param name single {@link Name} for this relative path. + * @param index index of the single name element. + * @return the relative path created from name and normalizedIndex. + * @throws IllegalArgumentException if index is lower + * than {@link Path#INDEX_UNDEFINED} or if the name is not valid. + */ + public Path create(Name name, int index) throws IllegalArgumentException; + + /** + * Create a new Path from the given elements. + * + * @param elements + * @return the Path created from the elements. + * @throws IllegalArgumentException If the given elements are null + * or have a length of 0. + */ + public Path create(Path.Element[] elements) throws IllegalArgumentException; + + /** + * Returns a Path holding the value of the specified + * string. The string must be in the format returned by the + * Path.getString() method. + * + * @param pathString a String containing the Path + * representation to be parsed. + * @return the Path represented by the argument + * @throws IllegalArgumentException if the specified string can not be parsed + * as a Path. + * @see Path#getString() + * @see Path#DELIMITER + */ + public Path create(String pathString) throws IllegalArgumentException; + + /** + * Creates a path element with the given qualified name. + * The created path element does not contain an explicit index. + *

+ * If the specified name denotes a special path element (either + * {@link PathFactory#getParentElement()}, {@link PathFactory#getCurrentElement()} or + * {@link PathFactory#getRootElement()}) then the associated constant is returned. + * + * @param name the name of the element + * @return a path element + * @throws IllegalArgumentException if the name is null + */ + public Path.Element createElement(Name name) throws IllegalArgumentException; + + /** + * Same as {@link #createElement(Name)} except that an explicit index can be + * specified. + *

+ * Note that an IllegalArgumentException will be thrown if the specified + * name denotes a special path element (either + * {@link PathFactory#getParentElement()}, {@link PathFactory#getCurrentElement()} or + * {@link PathFactory#getRootElement()}) since an explicit index is not allowed + * in this context. + * + * @param name the name of the element + * @param index the index if the element. + * @return a path element + * @throws IllegalArgumentException if the name is null, + * if the given index is lower than {@link Path#INDEX_UNDEFINED} or if name + * denoting a special path element. + */ + public Path.Element createElement(Name name, int index) throws IllegalArgumentException; + + /** + * Return the current element. + * + * @return the current element. + */ + public Path.Element getCurrentElement(); + + /** + * Return the parent element. + * + * @return the parent element. + */ + public Path.Element getParentElement(); + + /** + * Return the root element. + * + * @return the root element. + */ + public Path.Element getRootElement(); + + /** + * Return the Path of the root node. + * + * @return the Path of the root node. + */ + public Path getRootPath(); +} \ No newline at end of file Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PathFactory.java ------------------------------------------------------------------------------ svn:keywords = author date id revision url Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyId.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyId.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyId.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/PropertyId.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - /** * PropertyId identifies a property on the SPI layer. */ @@ -31,9 +29,9 @@ public NodeId getParentId(); /** - * Returns the {@link QName name} of the property identified by this id. + * Returns the {@link Name} of the property identified by this id. * * @return The name of the property that is identified by this PropertyId. */ - public QName getQName(); + public Name getName(); } Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QItemDefinition.java Thu Oct 18 11:30:25 2007 @@ -16,13 +16,11 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import javax.jcr.nodetype.ItemDefinition; /** * QItemDefinition is the qualified SPI representation of - * an {@link ItemDefinition item definition}. It refers to QNames + * an {@link ItemDefinition item definition}. It refers to Names * only and is thus isolated from session-specific namespace mappings. * * @see javax.jcr.nodetype.ItemDefinition @@ -39,14 +37,14 @@ * * @return the name of the child item. */ - public QName getQName(); + public Name getName(); /** * Gets the name of the declaring node type. * * @return the name of the declaring node type. */ - public QName getDeclaringNodeType(); + public Name getDeclaringNodeType(); /** * Determines whether the item is 'autoCreated'. Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeDefinition.java Thu Oct 18 11:30:25 2007 @@ -16,13 +16,11 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import javax.jcr.nodetype.NodeDefinition; /** * QNodeDefinition is the qualified SPI representation of - * a {@link NodeDefinition node definition}. It refers to QNames only + * a {@link NodeDefinition node definition}. It refers to Names only * and is thus isolated from session-specific namespace mappings. * * @see javax.jcr.nodetype.NodeDefinition @@ -39,14 +37,14 @@ * * @return the name of the default primary type. */ - public QName getDefaultPrimaryType(); + public Name getDefaultPrimaryType(); /** * Returns the array of names of the required primary types. * * @return the array of names of the required primary types. */ - public QName[] getRequiredPrimaryTypes(); + public Name[] getRequiredPrimaryTypes(); /** * Reports whether this node can have same-name siblings. Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QNodeTypeDefinition.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import java.util.Collection; import javax.jcr.nodetype.NodeType; @@ -37,7 +35,7 @@ * * @return the name of the node type or null if not set. */ - public QName getQName(); + public Name getName(); /** * Returns an array containing the names of the supertypes. If no @@ -49,7 +47,7 @@ * * @return an array of supertype names */ - public QName[] getSupertypes(); + public Name[] getSupertypes(); /** * Returns the value of the mixin flag. @@ -71,7 +69,7 @@ * * @return the name of the primary item or null if not set. */ - public QName getPrimaryItemName(); + public Name getPrimaryItemName(); /** * Returns an array containing the property definitions or @@ -92,7 +90,7 @@ public QNodeDefinition[] getChildNodeDefs(); /** - * Returns a collection of node type QNames that are being + * Returns a collection of node type Names that are being * referenced by this node type definition (e.g. as supertypes, as * required/default primary types in child node definitions, as REFERENCE * value constraints in property definitions). @@ -101,7 +99,7 @@ * the declaring node type as the default primary type) are not considered * dependencies. * - * @return a collection of node type QNames + * @return a collection of node type Names */ public Collection getDependencies(); } Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValue.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.Path; -import org.apache.jackrabbit.name.QName; - import javax.jcr.RepositoryException; import javax.jcr.PropertyType; import javax.jcr.Property; @@ -27,7 +24,7 @@ /** * QValue is the qualified SPI representation of a - * {@link javax.jcr.Value jcr value}. It therefore refers to QNames + * {@link javax.jcr.Value jcr value}. It therefore refers to Names * and Paths only and is thus isolated from session-specific * namespace mappings. */ @@ -86,12 +83,12 @@ public InputStream getStream() throws RepositoryException; /** - * Returns a QName representation of this value. + * Returns a Name representation of this value. * - * @return A QName representation of this value. + * @return A Name representation of this value. * @throws RepositoryException if an error occurs. */ - public QName getQName() throws RepositoryException; + public Name getName() throws RepositoryException; /** * Returns a Calendar representation of this value. Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QValueFactory.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; -import org.apache.jackrabbit.name.Path; - import java.io.IOException; import java.io.File; import java.io.InputStream; @@ -56,10 +53,10 @@ /** * Create a new QValue with type {@link javax.jcr.PropertyType#NAME}. * - * @param value A non-null QName. + * @param value A non-null Name. * @return a new QValue. */ - public QValue create(QName value); + public QValue create(Name value); /** * Create a new QValue with type {@link javax.jcr.PropertyType#PATH}. Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryInfo.java Thu Oct 18 11:30:25 2007 @@ -16,8 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; - import javax.jcr.RangeIterator; import java.util.Map; @@ -41,9 +39,9 @@ public RangeIterator getRows(); /** - * @return an array of QName representing the column names of the query - * result. + * @return an array of Names representing the column names of + * the query result. * @see javax.jcr.query.QueryResult#getColumnNames() */ - public QName[] getColumnNames(); + public Name[] getColumnNames(); } Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/QueryResultRow.java Thu Oct 18 11:30:25 2007 @@ -41,7 +41,7 @@ * Returns an array of QValues. * * @return an array of QValues representing the values present - * in this result row (missing values are returned as null). + * in this result row. * @see javax.jcr.query.Row#getValue(String) * @see javax.jcr.query.Row#getValues() */ Modified: jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=586055&r1=586054&r2=586055&view=diff ============================================================================== --- jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java (original) +++ jackrabbit/trunk/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java Thu Oct 18 11:30:25 2007 @@ -16,9 +16,6 @@ */ package org.apache.jackrabbit.spi; -import org.apache.jackrabbit.name.QName; -import org.apache.jackrabbit.name.Path; - import javax.jcr.lock.LockException; import javax.jcr.version.VersionException; import javax.jcr.version.Version; @@ -57,7 +54,7 @@ * void RepositoryService.copy(SessionInfo sessionInfo, * String srcWorkspaceName, * NodeId srcNodeId, NodeId destParentNodeId, - * QName destName) + * Name destName) * * This method performs an immediate persistent copy of the node identified by * srcNodeId and that node's subtree to a position as child of the node @@ -68,7 +65,7 @@ * If srcWorkspaceName differs from the workspace name present with * the SessionInfo, the copy is corresponds to a copy across workspaces. * The source and destination of the copy operation are specified by - * {@link NodeId}s. The QName holds the new name in fully qualified + * {@link NodeId}s. The Name holds the new name in fully qualified * form. Taken together, this information is sufficient to completely specify * and authorize the copy operations.

* @@ -87,6 +84,22 @@ public IdFactory getIdFactory() throws RepositoryException; /** + * Return the NameFactory. + * + * @return The NameFactory. + * @throws RepositoryException If an error occurs. + */ + public NameFactory getNameFactory() throws RepositoryException; + + /** + * Return the PathFactory. + * + * @return The PathFactory. + * @throws RepositoryException If an error occurs. + */ + public PathFactory getPathFactory() throws RepositoryException; + + /** * Return the QValueFactory defined with this SPI implementation. * * @return The QValueFactory. @@ -412,7 +425,7 @@ * @throws javax.jcr.RepositoryException * @see javax.jcr.Workspace#move(String, String) */ - public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, QName destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; + public void move(SessionInfo sessionInfo, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, AccessDeniedException, UnsupportedRepositoryOperationException, RepositoryException; /** * Clone the subtree identified by the given srcNodeId @@ -441,7 +454,7 @@ * @see javax.jcr.Workspace#copy(String, String) * @see javax.jcr.Workspace#copy(String, String, String) */ - public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, QName destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException; + public void copy(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException; //------------------------------------------------------< Update, Clone >--- /** @@ -485,7 +498,7 @@ * @throws javax.jcr.RepositoryException * @see javax.jcr.Workspace#clone(String, String, String, boolean) */ - public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, QName destName, boolean removeExisting) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException; + public void clone(SessionInfo sessionInfo, String srcWorkspaceName, NodeId srcNodeId, NodeId destParentNodeId, Name destName, boolean removeExisting) throws NoSuchWorkspaceException, ConstraintViolationException, VersionException, AccessDeniedException, PathNotFoundException, ItemExistsException, LockException, UnsupportedRepositoryOperationException, RepositoryException; //------------------------------------------------------------< Locking >--- /** @@ -713,7 +726,7 @@ * @throws javax.jcr.RepositoryException * @see javax.jcr.version.VersionHistory#addVersionLabel(String, String, boolean) */ - public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, QName label, boolean moveLabel) throws VersionException, RepositoryException; + public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws VersionException, RepositoryException; /** * Remove the given version label in the persistent layer. @@ -728,7 +741,7 @@ * @throws javax.jcr.RepositoryException * @see javax.jcr.version.VersionHistory#removeVersionLabel(String) */ - public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, QName label) throws VersionException, RepositoryException; + public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws VersionException, RepositoryException; //----------------------------------------------------------< Searching >--- /** @@ -803,7 +816,7 @@ */ public EventFilter createEventFilter(SessionInfo sessionInfo, int eventTypes, Path absPath, boolean isDeep, - String[] uuid, QName[] nodeTypeName, + String[] uuid, Name[] nodeTypeName, boolean noLocal) throws UnsupportedRepositoryOperationException, RepositoryException; @@ -957,5 +970,5 @@ * @see javax.jcr.nodetype.NodeTypeManager#getPrimaryNodeTypes() * @see javax.jcr.nodetype.NodeTypeManager#getNodeType(String) */ - public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, QName[] nodetypeNames) throws RepositoryException; + public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames) throws RepositoryException; }