jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793016 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/
Date Fri, 10 Jul 2009 16:24:49 GMT
Author: jukka
Date: Fri Jul 10 16:24:49 2009
New Revision: 793016

URL: http://svn.apache.org/viewvc?rev=793016&view=rev
Log:
#0000 - JCR-1232: Merge UUID to NodeId

Replace UUID references with NodeId alternatives from o.a.j.core.version.

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/JcrVersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
Fri Jul 10 16:24:49 2009
@@ -125,7 +125,7 @@
             throws RepositoryException {
         ReadLock lock = acquireReadLock();
         try {
-            String uuid = id.getUUID().toString();
+            String uuid = id.toString();
             Name name = getName(uuid);
 
             NodeStateEx parent = getParentNode(historyRoot, uuid, null);
@@ -276,7 +276,7 @@
 
         ReadLock lock = acquireReadLock();
         try {
-            String uuid = node.getNodeId().getUUID().toString();
+            String uuid = node.getNodeId().toString();
             Name name = getName(uuid);
 
             NodeStateEx parent = getParentNode(historyRoot, uuid, null);
@@ -379,7 +379,7 @@
         WriteOperation operation = startWriteOperation();
         try {
             // create deep path
-            String uuid = node.getNodeId().getUUID().toString();
+            String uuid = node.getNodeId().toString();
             NodeStateEx parent = getParentNode(historyRoot, uuid, NameConstants.REP_VERSIONSTORAGE);
             Name name = getName(uuid);
             if (parent.hasNode(name)) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistory.java
Fri Jul 10 16:24:49 2009
@@ -18,7 +18,6 @@
 
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.uuid.UUID;
 
 import javax.jcr.version.VersionException;
 
@@ -81,11 +80,11 @@
     int getNumVersions();
 
     /**
-     * Returns the UUID of the versionable node that this history belongs to.
+     * Returns the id of the versionable node that this history belongs to.
      *
-     * @return the UUID of the versionable node.
+     * @return the id of the versionable node.
      */
-    UUID getVersionableUUID();
+    NodeId getVersionableId();
 
     /**
      * Returns a name array of all version labels that exist in this

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
Fri Jul 10 16:24:49 2009
@@ -327,8 +327,8 @@
     /**
      * {@inheritDoc}
      */
-    public UUID getVersionableUUID() {
-        return versionableId.getUUID();
+    public NodeId getVersionableId() {
+        return versionableId;
     }
 
     /**
@@ -576,7 +576,7 @@
         NodeStateEx pNode = parent.addNode(name, NameConstants.NT_VERSIONHISTORY, historyId,
true);
 
         // set the versionable uuid
-        String versionableUUID = nodeState.getNodeId().getUUID().toString();
+        String versionableUUID = nodeState.getNodeId().toString();
         pNode.setPropertyValue(NameConstants.JCR_VERSIONABLEUUID, InternalValue.create(versionableUUID));
 
         // create label node

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/JcrVersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/JcrVersionManagerImpl.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/JcrVersionManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/JcrVersionManagerImpl.java
Fri Jul 10 16:24:49 2009
@@ -301,9 +301,9 @@
         Iterator<NodeId> iter = changeSet.keySet().iterator();
         while (iter.hasNext()) {
             InternalVersion v = changeSet.remove(iter.next());
-            NodeId nodeId = new NodeId(v.getVersionHistory().getVersionableUUID());
             try {
-                NodeImpl node = session.getNodeById(nodeId);
+                NodeImpl node = session.getNodeById(
+                        v.getVersionHistory().getVersionableId());
                 InternalVersion base = ((VersionImpl) node.getBaseVersion()).getInternalVersion();
                 VersionImpl version = (VersionImpl) session.getNodeById(v.getId());
                 // if base version is newer than version, add to failed list

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/NodeStateEx.java
Fri Jul 10 16:24:49 2009
@@ -431,7 +431,7 @@
 
         NodeStateEx node = createChildNode(nodeName, nodeTypeName, id);
         if (referenceable) {
-            node.setPropertyValue(NameConstants.JCR_UUID, InternalValue.create(node.getNodeId().getUUID().toString()));
+            node.setPropertyValue(NameConstants.JCR_UUID, InternalValue.create(node.getNodeId().toString()));
         }
         return node;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionHistoryImpl.java
Fri Jul 10 16:24:49 2009
@@ -108,8 +108,7 @@
     public VersionIterator getAllLinearVersions() throws RepositoryException {
         // get base version. this can certainly be optimized
         InternalVersionHistory vh = getInternalVersionHistory();
-        NodeId id = new NodeId(vh.getVersionableUUID());
-        Node vn = session.getNodeById(id);
+        Node vn = session.getNodeById(vh.getVersionableId());
         InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion();
 
         return new VersionIteratorImpl(session, vh.getRootVersion(), base);
@@ -284,7 +283,7 @@
      * {@inheritDoc}
      */
     public String getVersionableIdentifier() throws RepositoryException {
-        return getInternalVersionHistory().getVersionableUUID().toString();
+        return getInternalVersionHistory().getVersionableId().toString();
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java?rev=793016&r1=793015&r2=793016&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionImpl.java
Fri Jul 10 16:24:49 2009
@@ -108,8 +108,7 @@
         // get base version. this can certainly be optimized
         InternalVersionHistory vh = ((VersionHistoryImpl) getContainingHistory())
                 .getInternalVersionHistory();
-        NodeId id = new NodeId(vh.getVersionableUUID());
-        Node vn = session.getNodeById(id);
+        Node vn = session.getNodeById(vh.getVersionableId());
         InternalVersion base = ((VersionImpl) vn.getBaseVersion()).getInternalVersion();
 
         InternalVersion suc = getInternalVersion().getLinearSuccessor(base);



Mime
View raw message