jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1158405 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Date Tue, 16 Aug 2011 18:06:31 GMT
Author: mduerig
Date: Tue Aug 16 18:06:30 2011
New Revision: 1158405

URL: http://svn.apache.org/viewvc?rev=1158405&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1158405&r1=1158404&r2=1158405&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Tue Aug 16 18:06:30 2011
@@ -348,9 +348,8 @@ public class RepositoryServiceImpl exten
                 if (info == null) {
                     throw new PathNotFoundException(path.toString());
                 }
-                else {
-                    return Iterators.singleton(info);
-                }
+
+                return Iterators.singleton(info);
             }
             else {
                 return buildItemInfos(path, json, readFromDataStore);
@@ -361,36 +360,30 @@ public class RepositoryServiceImpl exten
         }
     }
 
-    public NodeInfo getNodeInfo(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException
{
+    public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId)
throws RepositoryException {
         try {
             String wspName = sessionInfo.getWorkspaceName();
-            Path path = getPath(nodeId);
+            Path path = getPath(parentId);
             String mkPath = Paths.pathToString(wspName, path);
             String rev = microKernel.getHeadRevision();
 
-            NodeInfo info = null;
-            if (microKernel.nodeExists(mkPath, rev)) {
-                String json = microKernel.getNodes(mkPath, rev);
-                info = buildNodeInfo(path, json, readFromDataStore);
+            if (!microKernel.nodeExists(mkPath, rev)) {
+                throw new PathNotFoundException(path.toString());
             }
 
+            String json = microKernel.getNodes(mkPath, rev);
+            NodeInfo info = buildNodeInfo(path, json, readFromDataStore);
             if (info == null) {
                 throw new PathNotFoundException(path.toString());
             }
-            else {
-                return info;
-            }
+
+            return info.getChildInfos();
         }
         catch (MicroKernelException e) {
             throw new RepositoryException(e.getMessage(), e);
         }
     }
 
-    public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId)
throws RepositoryException {
-        NodeInfo nodeInfo = getNodeInfo(sessionInfo, parentId);
-        return nodeInfo.getChildInfos();
-    }
-
     public Iterator<PropertyId> getReferences(SessionInfo sessionInfo, NodeId nodeId,
Name propertyName, boolean weakReferences)
             throws RepositoryException {
 



Mime
View raw message