jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r592359 - in /jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml: ./ nodetype/
Date Tue, 06 Nov 2007 10:23:00 GMT
Author: mreutegg
Date: Tue Nov  6 02:22:59 2007
New Revision: 592359

URL: http://svn.apache.org/viewvc?rev=592359&view=rev
Log:
JCR-1204: Redesign SPI observation
- modules in sandbox

Modified:
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLIdFactory.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLItemInfo.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeId.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeInfo.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeId.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeInfo.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPropertyInfo.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLRepositoryService.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQItemDefinition.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeDefinition.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeTypeDefinition.java
    jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQPropertyDefinition.java

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLIdFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLIdFactory.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLIdFactory.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLIdFactory.java
Tue Nov  6 02:22:59 2007
@@ -16,11 +16,12 @@
  */
 package org.apache.jackrabbit.spi.xml;
 
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 
 public class XMLIdFactory implements IdFactory {
 
@@ -52,9 +53,9 @@
         }
     }
 
-    public PropertyId createPropertyId(NodeId id, QName name) {
+    public PropertyId createPropertyId(NodeId id, Name name) {
         try {
-            if (QName.JCR_PRIMARYTYPE.equals(name)) {
+            if (NameConstants.JCR_PRIMARYTYPE.equals(name)) {
                 return new XMLPrimaryTypeId(id);
             } else {
                 return ((XMLNodeId) id).getPropertyId(name);

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLItemInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLItemInfo.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLItemInfo.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLItemInfo.java
Tue Nov  6 02:22:59 2007
@@ -16,10 +16,10 @@
  */
 package org.apache.jackrabbit.spi.xml;
 
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.spi.ItemInfo;
 import org.apache.jackrabbit.spi.NodeId;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 
 public class XMLItemInfo implements ItemInfo {
 
@@ -44,7 +44,7 @@
         return id.getParentId();
     }
 
-    public QName getQName() {
+    public Name getName() {
         return id.getName();
     }
 

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeId.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeId.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeId.java
Tue Nov  6 02:22:59 2007
@@ -20,18 +20,27 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.ChildInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
+import org.apache.jackrabbit.name.NameFactoryImpl;
+import org.apache.jackrabbit.name.PathFactoryImpl;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import javax.jcr.RepositoryException;
+
 public class XMLNodeId implements NodeId, PropertyId, ChildInfo {
 
+    private static final NameFactory NAME_FACTORY = NameFactoryImpl.getInstance();
+
+    private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
+
     private final Node node;
 
     public XMLNodeId(Node node) {
@@ -66,7 +75,7 @@
 
     public XMLNodeId getNodeId(Path path) {
         Node current = node;
-        Path.PathElement[] elements = path.getElements();
+        Path.Element[] elements = path.getElements();
         for (int i = 0; i < elements.length; i++) {
             if (elements[i].denotesRoot()) {
                 current = node;
@@ -79,7 +88,7 @@
             } else if (elements[i].denotesCurrent()) {
                 // do nothing
             } else {
-                QName name = elements[i].getName();
+                Name name = elements[i].getName();
                 int index = elements[i].getNormalizedIndex();
                 NodeList nodes = current.getChildNodes();
                 for (int j = 0; index > 0 && j < nodes.getLength(); j++) {
@@ -99,9 +108,9 @@
         return new XMLNodeId(current);
     }
 
-    public XMLNodeId getPropertyId(QName name) {
+    public XMLNodeId getPropertyId(Name name) {
         String uri = name.getNamespaceURI();
-        if (QName.NS_DEFAULT_URI.equals(uri)) {
+        if (Name.NS_DEFAULT_URI.equals(uri)) {
             uri = null;
         }
 
@@ -132,14 +141,14 @@
                 Path parentPath = new XMLNodeId(parent).getPath();
                 int index = getIndex();
                 if (index > 0) {
-                    return Path.create(parentPath, getName(), index, false);
+                    return PATH_FACTORY.create(parentPath, getName(), index, false);
                 } else {
-                    return Path.create(parentPath, getName(), false);
+                    return PATH_FACTORY.create(parentPath, getName(), false);
                 }
             } else {
-                return Path.ROOT;
+                return PATH_FACTORY.getRootPath();
             }
-        } catch (MalformedPathException e) {
+        } catch (RepositoryException e) {
             throw new IllegalStateException("Invalid path: " + e.getMessage());
         }
     }
@@ -179,18 +188,14 @@
         }
     }
 
-    public QName getName() {
+    public Name getName() {
         if (node.getParentNode() == null) {
-            return new QName(QName.NS_DEFAULT_URI, "");
+            return NAME_FACTORY.create(Name.NS_DEFAULT_URI, "");
         } else if (node.getNamespaceURI() == null) {
-            return new QName(QName.NS_DEFAULT_URI, node.getLocalName());
+            return NAME_FACTORY.create(Name.NS_DEFAULT_URI, node.getLocalName());
         } else {
-            return new QName(node.getNamespaceURI(), node.getLocalName());
+            return NAME_FACTORY.create(node.getNamespaceURI(), node.getLocalName());
         }
-    }
-
-    public QName getQName() {
-        return getName();
     }
 
     //--------------------------------------------------------------< Object >

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeInfo.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeInfo.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLNodeInfo.java
Tue Nov  6 02:22:59 2007
@@ -16,10 +16,11 @@
  */
 package org.apache.jackrabbit.spi.xml;
 
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameConstants;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.NodeInfo;
 import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.spi.Name;
 
 import java.util.Iterator;
 
@@ -39,12 +40,12 @@
         return id.getIndex();
     }
 
-    public QName[] getMixins() {
-        return QName.EMPTY_ARRAY;
+    public Name[] getMixins() {
+        return Name.EMPTY_ARRAY;
     }
 
-    public QName getNodetype() {
-        return QName.NT_UNSTRUCTURED;
+    public Name getNodetype() {
+        return NameConstants.NT_UNSTRUCTURED;
     }
 
     public Iterator getPropertyIds() {

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeId.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeId.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeId.java
Tue Nov  6 02:22:59 2007
@@ -16,14 +16,20 @@
  */
 package org.apache.jackrabbit.spi.xml;
 
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.PropertyId;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.PathFactory;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.name.PathFactoryImpl;
+
+import javax.jcr.RepositoryException;
 
 public class XMLPrimaryTypeId implements PropertyId {
 
+    private static final PathFactory PATH_FACTORY = PathFactoryImpl.getInstance();
+
     private final NodeId parent;
 
     public XMLPrimaryTypeId(NodeId parent) {
@@ -36,8 +42,8 @@
         return parent;
     }
 
-    public QName getQName() {
-        return QName.JCR_PRIMARYTYPE;
+    public Name getName() {
+        return NameConstants.JCR_PRIMARYTYPE;
     }
 
     public boolean denotesNode() {
@@ -46,8 +52,8 @@
 
     public Path getPath() {
         try {
-            return Path.create(parent.getPath(), getQName(), false);
-        } catch (MalformedPathException e) {
+            return PATH_FACTORY.create(parent.getPath(), getName(), false);
+        } catch (RepositoryException e) {
             throw new IllegalStateException("Invalid path: " + this);
         }
     }

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeInfo.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeInfo.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPrimaryTypeInfo.java
Tue Nov  6 02:22:59 2007
@@ -17,15 +17,17 @@
 package org.apache.jackrabbit.spi.xml;
 
 import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
 
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.PropertyInfo;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.value.QValueFactoryImpl;
+import org.apache.jackrabbit.name.NameConstants;
 
 public class XMLPrimaryTypeInfo implements PropertyInfo {
 
@@ -54,8 +56,8 @@
         return id.getParentId();
     }
 
-    public QName getQName() {
-        return QName.JCR_PRIMARYTYPE;
+    public Name getName() {
+        return NameConstants.JCR_PRIMARYTYPE;
     }
 
     public int getType() {
@@ -64,7 +66,11 @@
 
     public QValue[] getValues() {
         QValueFactory factory = QValueFactoryImpl.getInstance();
-        return new QValue[] { factory.create(QName.NT_UNSTRUCTURED) };
+        try {
+            return new QValue[] { factory.create(NameConstants.NT_UNSTRUCTURED) };
+        } catch (RepositoryException e) {
+            throw new IllegalStateException("Invalid name: " + NameConstants.NT_UNSTRUCTURED);
+        }
     }
 
     public boolean isMultiValued() {

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPropertyInfo.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPropertyInfo.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPropertyInfo.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLPropertyInfo.java
Tue Nov  6 02:22:59 2007
@@ -17,6 +17,7 @@
 package org.apache.jackrabbit.spi.xml;
 
 import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.spi.PropertyId;
 import org.apache.jackrabbit.spi.PropertyInfo;
@@ -42,7 +43,11 @@
 
     public QValue[] getValues() {
         QValueFactory factory = QValueFactoryImpl.getInstance();
-        return new QValue[] { factory.create(id.getValue(), getType()) };
+        try {
+            return new QValue[] { factory.create(id.getValue(), getType()) };
+        } catch (RepositoryException e) {
+            throw new IllegalStateException("Invalid values: " + this);
+        }
     }
 
     public boolean isMultiValued() {

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLRepositoryService.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLRepositoryService.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/XMLRepositoryService.java
Tue Nov  6 02:22:59 2007
@@ -49,8 +49,9 @@
 import javax.jcr.version.VersionException;
 
 import org.apache.jackrabbit.core.nodetype.ItemDef;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameConstants;
+import org.apache.jackrabbit.name.NameFactoryImpl;
+import org.apache.jackrabbit.name.PathFactoryImpl;
 import org.apache.jackrabbit.spi.Batch;
 import org.apache.jackrabbit.spi.EventBundle;
 import org.apache.jackrabbit.spi.EventFilter;
@@ -68,6 +69,11 @@
 import org.apache.jackrabbit.spi.QueryInfo;
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.SessionInfo;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Subscription;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
@@ -90,41 +96,41 @@
         this.document = document;
         this.types = types;
         this.nodeDefinition =
-            getNodeDefinition(QName.NT_UNSTRUCTURED, ItemDef.ANY_NAME);
+            getNodeDefinition(NameConstants.NT_UNSTRUCTURED, ItemDef.ANY_NAME);
         this.primaryTypeDefinition =
-            getPropertyDefinition(QName.NT_BASE, QName.JCR_PRIMARYTYPE);
+            getPropertyDefinition(NameConstants.NT_BASE, NameConstants.JCR_PRIMARYTYPE);
         this.propertyDefinition =
-            getPropertyDefinition(QName.NT_UNSTRUCTURED, ItemDef.ANY_NAME);
+            getPropertyDefinition(NameConstants.NT_UNSTRUCTURED, ItemDef.ANY_NAME);
     }
 
-    private QNodeTypeDefinition getNodeTypeDefinition(QName name)
+    private QNodeTypeDefinition getNodeTypeDefinition(Name name)
             throws RepositoryException {
         for (int i = 0; i < types.length; i++) {
-            if (name.equals(types[i].getQName())) {
+            if (name.equals(types[i].getName())) {
                 return types[i];
             }
         }
         throw new IllegalStateException("Node type not found: " + name);
     }
 
-    private QNodeDefinition getNodeDefinition(QName type, QName name)
+    private QNodeDefinition getNodeDefinition(Name type, Name name)
             throws RepositoryException {
         QNodeDefinition[] nodes =
             getNodeTypeDefinition(type).getChildNodeDefs();
         for (int i = 0; i < nodes.length; i++) {
-            if (name.equals(nodes[i].getQName())) {
+            if (name.equals(nodes[i].getName())) {
                 return nodes[i];
             }
         }
         throw new RepositoryException("Node definition not found: " + name);
     }
 
-    private QPropertyDefinition getPropertyDefinition(QName type, QName name)
+    private QPropertyDefinition getPropertyDefinition(Name type, Name name)
             throws RepositoryException {
         QPropertyDefinition[] properties =
             getNodeTypeDefinition(type).getPropertyDefs();
         for (int i = 0; i < properties.length; i++) {
-            if (name.equals(properties[i].getQName())
+            if (name.equals(properties[i].getName())
                     && !properties[i].isMultiple()) {
                 return properties[i];
             }
@@ -191,19 +197,19 @@
      */
     public Map getRegisteredNamespaces(SessionInfo session) {
         Map namespaces = new HashMap();
-        namespaces.put(QName.NS_EMPTY_PREFIX, QName.NS_DEFAULT_URI);
-        namespaces.put(QName.NS_JCR_PREFIX, QName.NS_JCR_URI);
-        namespaces.put(QName.NS_MIX_PREFIX, QName.NS_MIX_URI);
-        namespaces.put(QName.NS_NT_PREFIX, QName.NS_NT_URI);
-        namespaces.put(QName.NS_SV_PREFIX, QName.NS_SV_URI);
-        namespaces.put(QName.NS_XML_PREFIX, QName.NS_XML_URI);
+        namespaces.put(Name.NS_EMPTY_PREFIX, Name.NS_DEFAULT_URI);
+        namespaces.put(Name.NS_JCR_PREFIX, Name.NS_JCR_URI);
+        namespaces.put(Name.NS_MIX_PREFIX, Name.NS_MIX_URI);
+        namespaces.put(Name.NS_NT_PREFIX, Name.NS_NT_URI);
+        namespaces.put(Name.NS_SV_PREFIX, Name.NS_SV_URI);
+        namespaces.put(Name.NS_XML_PREFIX, Name.NS_XML_URI);
         Set uris = new HashSet(namespaces.values());
 
         Element root = document.getDocumentElement();
         NamedNodeMap attributes = root.getAttributes();
         for (int i = 0; i < attributes.getLength(); i++) {
             Node attribute = attributes.item(i);
-            if (QName.NS_XMLNS_URI.equals(attribute.getNamespaceURI())
+            if (Name.NS_XMLNS_URI.equals(attribute.getNamespaceURI())
                     && !uris.contains(attribute.getNodeValue())) {
                 String prefix = attribute.getLocalName();
                 for (int j = 2; namespaces.containsKey(prefix); j++) {
@@ -265,6 +271,14 @@
         return new XMLIdFactory(new XMLNodeId(document));
     }
 
+    public NameFactory getNameFactory() throws RepositoryException {
+        return NameFactoryImpl.getInstance();
+    }
+
+    public PathFactory getPathFactory() throws RepositoryException {
+        return PathFactoryImpl.getInstance();
+    }
+
     public PropertyInfo getPropertyInfo(SessionInfo session, PropertyId id)
             throws RepositoryException {
         try {
@@ -307,7 +321,7 @@
      * @see org.apache.jackrabbit.spi.RepositoryService#addVersionLabel(org.apache.jackrabbit.spi.SessionInfo,
org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName,
boolean)
      */
     public void addVersionLabel(SessionInfo sessionInfo,
-            NodeId versionHistoryId, NodeId versionId, QName label,
+            NodeId versionHistoryId, NodeId versionId, Name label,
             boolean moveLabel) throws VersionException, RepositoryException {
         // TODO Auto-generated method stub
 
@@ -347,7 +361,7 @@
      * @see org.apache.jackrabbit.spi.RepositoryService#clone(org.apache.jackrabbit.spi.SessionInfo,
java.lang.String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName,
boolean)
      */
     public void clone(SessionInfo sessionInfo, String srcWorkspaceName,
-            NodeId srcNodeId, NodeId destParentNodeId, QName destName,
+            NodeId srcNodeId, NodeId destParentNodeId, Name destName,
             boolean removeExisting) throws NoSuchWorkspaceException,
             ConstraintViolationException, VersionException,
             AccessDeniedException, PathNotFoundException, ItemExistsException,
@@ -361,7 +375,7 @@
      * @see org.apache.jackrabbit.spi.RepositoryService#copy(org.apache.jackrabbit.spi.SessionInfo,
java.lang.String, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
      */
     public void copy(SessionInfo sessionInfo, String srcWorkspaceName,
-            NodeId srcNodeId, NodeId destParentNodeId, QName destName)
+            NodeId srcNodeId, NodeId destParentNodeId, Name destName)
             throws NoSuchWorkspaceException, ConstraintViolationException,
             VersionException, AccessDeniedException, PathNotFoundException,
             ItemExistsException, LockException,
@@ -375,7 +389,7 @@
      */
     public EventFilter createEventFilter(SessionInfo sessionInfo,
             int eventTypes, Path absPath, boolean isDeep, String[] uuid,
-            QName[] nodeTypeName, boolean noLocal)
+            Name[] nodeTypeName, boolean noLocal)
             throws UnsupportedRepositoryOperationException, RepositoryException {
         // TODO Auto-generated method stub
         return null;
@@ -408,16 +422,42 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.jackrabbit.spi.RepositoryService#getEvents(org.apache.jackrabbit.spi.SessionInfo,
long, org.apache.jackrabbit.spi.EventFilter[])
+     * @see org.apache.jackrabbit.spi.RepositoryService#getEvents(Subscription subscription,
long)
      */
-    public EventBundle[] getEvents(SessionInfo sessionInfo, long timeout,
-            EventFilter[] filters) throws RepositoryException,
+    public EventBundle[] getEvents(Subscription subscription, long timeout)
+            throws RepositoryException,
             UnsupportedRepositoryOperationException, InterruptedException {
         // TODO Auto-generated method stub
         return null;
     }
 
     /* (non-Javadoc)
+     * @see org.apache.jackrabbit.spi.RepositoryService#createSubscription(SessionInfo, EventFilter[])
+     */
+    public Subscription createSubscription(SessionInfo sessionInfo,
+                                           EventFilter[] filters)
+            throws UnsupportedRepositoryOperationException, RepositoryException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jackrabbit.spi.RepositoryService#updateEventFilters(Subscription,
EventFilter[])
+     */
+    public void updateEventFilters(Subscription subscription,
+                                   EventFilter[] filters)
+            throws RepositoryException {
+        // TODO Auto-generated method stub
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jackrabbit.spi.RepositoryService#dispose(Subscription)
+     */
+    public void dispose(Subscription subscription) throws RepositoryException {
+        // TODO Auto-generated method stub
+    }
+
+    /* (non-Javadoc)
      * @see org.apache.jackrabbit.spi.RepositoryService#getLockInfo(org.apache.jackrabbit.spi.SessionInfo,
org.apache.jackrabbit.spi.NodeId)
      */
     public LockInfo getLockInfo(SessionInfo sessionInfo, NodeId nodeId)
@@ -484,7 +524,7 @@
      * @see org.apache.jackrabbit.spi.RepositoryService#move(org.apache.jackrabbit.spi.SessionInfo,
org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
      */
     public void move(SessionInfo sessionInfo, NodeId srcNodeId,
-            NodeId destParentNodeId, QName destName)
+            NodeId destParentNodeId, Name destName)
             throws ItemExistsException, PathNotFoundException,
             VersionException, ConstraintViolationException, LockException,
             AccessDeniedException, UnsupportedRepositoryOperationException,
@@ -543,7 +583,7 @@
      * @see org.apache.jackrabbit.spi.RepositoryService#removeVersionLabel(org.apache.jackrabbit.spi.SessionInfo,
org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.spi.NodeId, org.apache.jackrabbit.name.QName)
      */
     public void removeVersionLabel(SessionInfo sessionInfo,
-            NodeId versionHistoryId, NodeId versionId, QName label)
+            NodeId versionHistoryId, NodeId versionId, Name label)
             throws VersionException, RepositoryException {
         // TODO Auto-generated method stub
 
@@ -614,13 +654,13 @@
     /* (non-Javadoc)
      * @see org.apache.jackrabbit.spi.RepositoryService#getQNodeTypeDefinitions(org.apache.jackrabbit.spi.SessionInfo,
QName[])
      */
-    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, QName[] qNames) throws
RepositoryException {
+    public Iterator getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] qNames) throws
RepositoryException {
         List l = new ArrayList();
         List qNameList = Arrays.asList(qNames);
         for (int i = 0; i < types.length && !qNameList.isEmpty(); i++) {
-            if (qNameList.contains(types[i].getQName())) {
+            if (qNameList.contains(types[i].getName())) {
                 l.add(types[i]);
-                qNameList.remove(types[i].getQName());
+                qNameList.remove(types[i].getName());
             }
         }
         if (!qNameList.isEmpty()) {

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQItemDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQItemDefinition.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQItemDefinition.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQItemDefinition.java
Tue Nov  6 02:22:59 2007
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.spi.xml.nodetype;
 
 import org.apache.jackrabbit.core.nodetype.ItemDef;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.QItemDefinition;
+import org.apache.jackrabbit.spi.Name;
 
 public class XMLQItemDefinition implements QItemDefinition {
 
@@ -38,7 +38,7 @@
         return def.definesResidual();
     }
 
-    public QName getDeclaringNodeType() {
+    public Name getDeclaringNodeType() {
         return def.getDeclaringNodeType();
     }
 
@@ -46,7 +46,7 @@
         return def.getOnParentVersion();
     }
 
-    public QName getQName() {
+    public Name getName() {
         return def.getName();
     }
 

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeDefinition.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeDefinition.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeDefinition.java
Tue Nov  6 02:22:59 2007
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.spi.xml.nodetype;
 
 import org.apache.jackrabbit.core.nodetype.NodeDef;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.QNodeDefinition;
+import org.apache.jackrabbit.spi.Name;
 
 public class XMLQNodeDefinition extends XMLQItemDefinition
         implements QNodeDefinition {
@@ -36,11 +36,11 @@
         return def.allowsSameNameSiblings();
     }
 
-    public QName getDefaultPrimaryType() {
+    public Name getDefaultPrimaryType() {
         return def.getDefaultPrimaryType();
     }
 
-    public QName[] getRequiredPrimaryTypes() {
+    public Name[] getRequiredPrimaryTypes() {
         return def.getRequiredPrimaryTypes();
     }
 

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeTypeDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeTypeDefinition.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeTypeDefinition.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQNodeTypeDefinition.java
Tue Nov  6 02:22:59 2007
@@ -21,10 +21,10 @@
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.PropDef;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
+import org.apache.jackrabbit.spi.Name;
 
 public class XMLQNodeTypeDefinition implements QNodeTypeDefinition {
 
@@ -49,7 +49,7 @@
         return def.getDependencies();
     }
 
-    public QName getPrimaryItemName() {
+    public Name getPrimaryItemName() {
         return def.getPrimaryItemName();
     }
 
@@ -62,11 +62,11 @@
         return definitions;
     }
 
-    public QName getQName() {
+    public Name getName() {
         return def.getName();
     }
 
-    public QName[] getSupertypes() {
+    public Name[] getSupertypes() {
         return def.getSupertypes();
     }
 

Modified: jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQPropertyDefinition.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQPropertyDefinition.java?rev=592359&r1=592358&r2=592359&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQPropertyDefinition.java
(original)
+++ jackrabbit/sandbox/jackrabbit-spi-xml/src/main/java/org/apache/jackrabbit/spi/xml/nodetype/XMLQPropertyDefinition.java
Tue Nov  6 02:22:59 2007
@@ -16,17 +16,12 @@
  */
 package org.apache.jackrabbit.spi.xml.nodetype;
 
-import java.util.Calendar;
-
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.core.nodetype.PropDef;
 import org.apache.jackrabbit.core.nodetype.ValueConstraint;
-import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QValueFactory;
@@ -44,23 +39,21 @@
 
     private QValue getQValue(InternalValue value) throws RepositoryException {
         QValueFactory factory = QValueFactoryImpl.getInstance();
-        Object object = value.internalValue();
         switch (value.getType()) {
         case PropertyType.BINARY:
-            return factory.create(
-                    ((BLOBFileValue) object).getString(), PropertyType.BINARY);
+            return factory.create(value.getString(), PropertyType.BINARY);
         case PropertyType.DATE:
-            return factory.create((Calendar) object);
+            return factory.create(value.getDate());
         case PropertyType.NAME:
-            return factory.create((QName) object);
+            return factory.create(value.getQName());
         case PropertyType.PATH:
-            return factory.create((Path) object);
+            return factory.create(value.getPath());
         case PropertyType.REFERENCE:
         case PropertyType.BOOLEAN:
         case PropertyType.DOUBLE:
         case PropertyType.LONG:
         case PropertyType.STRING:
-            return factory.create(object.toString(), value.getType());
+            return factory.create(value.getString(), value.getType());
         }
         throw new RepositoryException("Unknown value type: " + value.getType());
     }



Mime
View raw message