summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-19 20:58:48 (EST)
committerEike Stepper2008-01-19 20:58:48 (EST)
commitac374ed1a0af94a25fc0971287e94f0d790c6558 (patch)
treedc8c3c45215e0c7ae81db28ce2774e9f8d4fe384
parent7a75c19c087b681357b2bc245d14d6685554b37f (diff)
downloadcdo-ac374ed1a0af94a25fc0971287e94f0d790c6558.zip
cdo-ac374ed1a0af94a25fc0971287e94f0d790c6558.tar.gz
cdo-ac374ed1a0af94a25fc0971287e94f0d790c6558.tar.bz2
[215900] Provide internal API for CDORevisionImpl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215900
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ToOneReferenceMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalClassMapping.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreChunkReader.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java63
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/VerifyRevisionIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java27
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java12
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java20
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java27
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java68
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java18
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/collection/MoveableArrayList.java69
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/MoveableList.java11
43 files changed, 381 insertions, 269 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
index 66b387a..c1096e8 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IAttributeMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.net4j.db.ddl.IDBField;
@@ -23,7 +23,7 @@ public interface IAttributeMapping extends IFeatureMapping
{
public IDBField getField();
- public void appendValue(StringBuilder builder, CDORevisionImpl revision);
+ public void appendValue(StringBuilder builder, InternalCDORevision revision);
- public void extractValue(ResultSet resultSet, int column, CDORevisionImpl revision);
+ public void extractValue(ResultSet resultSet, int column, InternalCDORevision revision);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
index a2b8d76..876d895 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -40,13 +40,13 @@ public interface IClassMapping
public IReferenceMapping getReferenceMapping(CDOFeature feature);
- public void writeRevision(IDBStoreWriter storeWriter, CDORevisionImpl revision);
+ public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision);
- public void readRevision(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk);
+ public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk);
- public void readRevisionByTime(IDBStoreReader storeReader, CDORevisionImpl revision, long timeStamp,
+ public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
int referenceChunk);
- public void readRevisionByVersion(IDBStoreReader storeReader, CDORevisionImpl revision, int version,
+ public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
int referenceChunk);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
index 846ed51..7ce7136 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IReferenceMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.server.IStoreChunkReader.Chunk;
import org.eclipse.net4j.db.ddl.IDBTable;
@@ -24,9 +24,9 @@ public interface IReferenceMapping extends IFeatureMapping
{
public IDBTable getTable();
- public void writeReference(IDBStoreWriter storeWriter, CDORevisionImpl revision);
+ public void writeReference(IDBStoreWriter storeWriter, InternalCDORevision revision);
- public void readReference(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk);
+ public void readReference(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk);
public void readChunks(IDBStoreChunkReader chunkReader, List<Chunk> chunks, String string);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
index 9f6b4f2..c3fc6a8 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/AttributeMapping.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
@@ -40,20 +40,20 @@ public abstract class AttributeMapping extends FeatureMapping implements IAttrib
return field;
}
- public void appendValue(StringBuilder builder, CDORevisionImpl revision)
+ public void appendValue(StringBuilder builder, InternalCDORevision revision)
{
IDBAdapter dbAdapter = getDBAdapter();
Object value = getRevisionValue(revision);
dbAdapter.appendValue(builder, field, value);
}
- protected Object getRevisionValue(CDORevisionImpl revision)
+ protected Object getRevisionValue(InternalCDORevision revision)
{
CDOFeature feature = getFeature();
return revision.getValue(feature);
}
- public void extractValue(ResultSet resultSet, int column, CDORevisionImpl revision)
+ public void extractValue(ResultSet resultSet, int column, InternalCDORevision revision)
{
try
{
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
index 32e452c..9dc8a49 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOType;
@@ -138,7 +138,7 @@ public abstract class ClassMapping implements IClassMapping
}
}
- protected void appendRevisionInfos(StringBuilder builder, CDORevisionImpl revision, boolean full)
+ protected void appendRevisionInfos(StringBuilder builder, InternalCDORevision revision, boolean full)
{
builder.append(revision.getID().getValue());
builder.append(", ");
@@ -436,7 +436,7 @@ public abstract class ClassMapping implements IClassMapping
protected abstract boolean hasFullRevisionInfo();
- public void writeRevision(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
if (revision.getVersion() >= 2 && hasFullRevisionInfo())
{
@@ -454,7 +454,7 @@ public abstract class ClassMapping implements IClassMapping
}
}
- protected void writeRevisedRow(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ protected void writeRevisedRow(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
StringBuilder builder = new StringBuilder();
builder.append("UPDATE ");
@@ -474,7 +474,7 @@ public abstract class ClassMapping implements IClassMapping
sqlUpdate(storeWriter, builder.toString());
}
- protected void writeAttributes(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ protected void writeAttributes(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
StringBuilder builder = new StringBuilder();
builder.append("INSERT INTO ");
@@ -492,7 +492,7 @@ public abstract class ClassMapping implements IClassMapping
sqlUpdate(storeWriter, builder.toString());
}
- protected void writeReferences(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ protected void writeReferences(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
for (IReferenceMapping referenceMapping : referenceMappings)
{
@@ -500,13 +500,13 @@ public abstract class ClassMapping implements IClassMapping
}
}
- public void readRevision(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk)
+ public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
{
String where = CDODBSchema.ATTRIBUTES_REVISED + "=0";
readRevision(storeReader, revision, where, true, referenceChunk);
}
- public void readRevisionByTime(IDBStoreReader storeReader, CDORevisionImpl revision, long timeStamp,
+ public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
int referenceChunk)
{
StringBuilder where = new StringBuilder();
@@ -523,15 +523,15 @@ public abstract class ClassMapping implements IClassMapping
readRevision(storeReader, revision, where.toString(), true, referenceChunk);
}
- public void readRevisionByVersion(IDBStoreReader storeReader, CDORevisionImpl revision, int version,
+ public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
int referenceChunk)
{
String where = CDODBSchema.ATTRIBUTES_VERSION + "=" + version;
readRevision(storeReader, revision, where, false, referenceChunk);
}
- protected void readRevision(IDBStoreReader storeReader, CDORevisionImpl revision, String where, boolean readVersion,
- int referenceChunk)
+ protected void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, String where,
+ boolean readVersion, int referenceChunk)
{
if (attributeMappings != null)
{
@@ -544,7 +544,8 @@ public abstract class ClassMapping implements IClassMapping
}
}
- protected void readAttributes(IDBStoreReader storeReader, CDORevisionImpl revision, String where, boolean readVersion)
+ protected void readAttributes(IDBStoreReader storeReader, InternalCDORevision revision, String where,
+ boolean readVersion)
{
long id = revision.getID().getValue();
StringBuilder builder = new StringBuilder(readVersion ? selectPrefixWithVersion : selectPrefix);
@@ -600,7 +601,7 @@ public abstract class ClassMapping implements IClassMapping
}
}
- protected void readReferences(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk)
+ protected void readReferences(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
{
for (IReferenceMapping referenceMapping : referenceMappings)
{
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
index 6798dc4..f1cad8a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
@@ -17,7 +17,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassRefImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOTypeImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -25,6 +25,7 @@ import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.server.IPackageManager;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IRevisionManager;
@@ -227,7 +228,7 @@ public class DBStoreReader extends DBStoreAccessor implements IDBStoreReader
IRevisionManager revisionManager = getStore().getRepository().getRevisionManager();
CDOClassImpl cdoClass = getObjectType(id);
- CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.create(revisionManager, cdoClass, id);
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
@@ -244,7 +245,7 @@ public class DBStoreReader extends DBStoreAccessor implements IDBStoreReader
IRevisionManager revisionManager = getStore().getRepository().getRevisionManager();
CDOClassImpl cdoClass = getObjectType(id);
- CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.create(revisionManager, cdoClass, id);
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
@@ -261,7 +262,7 @@ public class DBStoreReader extends DBStoreAccessor implements IDBStoreReader
IRevisionManager revisionManager = getStore().getRepository().getRevisionManager();
CDOClassImpl cdoClass = getObjectType(id);
- CDORevisionImpl revision = new CDORevisionImpl(revisionManager, cdoClass, id);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.create(revisionManager, cdoClass, id);
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
index fa849c1..4d935bb 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassProxy;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.db.IClassMapping;
@@ -162,14 +162,14 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
type, packageURI, classifierID, many, containment, idx);
}
- public void writeRevision(CDORevisionImpl revision)
+ public void writeRevision(InternalCDORevision revision)
{
if (TRACER.isEnabled())
{
TRACER.format("Inserting revision: {0}", revision);
}
- CDOClassImpl cdoClass = revision.getCDOClass();
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
mapping.writeRevision(this, revision);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
index eac046b..d0afc74 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalClassMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
@@ -32,7 +32,7 @@ public class HorizontalClassMapping extends ClassMapping
}
@Override
- public void writeRevision(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
super.writeRevision(storeWriter, revision);
if (revision.getVersion() == 1)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
index 66042d4..b370dbe 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/NoClassMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
@@ -77,20 +77,20 @@ public class NoClassMapping implements IClassMapping
return null;
}
- public void writeRevision(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
}
- public void readRevision(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk)
+ public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
{
}
- public void readRevisionByTime(IDBStoreReader storeReader, CDORevisionImpl revision, long timeStamp,
+ public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
int referenceChunk)
{
}
- public void readRevisionByVersion(IDBStoreReader storeReader, CDORevisionImpl revision, int version,
+ public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
int referenceChunk)
{
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
index c648576..a2679de 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java
@@ -11,8 +11,7 @@
package org.eclipse.emf.cdo.server.internal.db;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -32,6 +31,7 @@ import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.collection.MoveableList;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -73,7 +73,7 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
return table;
}
- public void writeReference(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ public void writeReference(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
long source = revision.getID().getValue();
int version = revision.getVersion();
@@ -96,14 +96,17 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
}
}
- public void readReference(IDBStoreReader storeReader, CDORevisionImpl revision, int referenceChunk)
+ public void readReference(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
{
- MoveableList list = revision.getList(getFeature());
+ MoveableList<Object> list = revision.getList(getFeature());
CDOID source = revision.getID();
int version = revision.getVersion();
String sql = createSelect(source, version, null);
- if (TRACER.isEnabled()) TRACER.trace(sql);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace(sql);
+ }
ResultSet resultSet = null;
try
@@ -118,7 +121,7 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
// TODO Optimize this?
while (resultSet.next())
{
- list.add(CDORevisionImpl.UNINITIALIZED);
+ list.add(InternalCDORevision.UNINITIALIZED);
}
}
catch (SQLException ex)
@@ -138,7 +141,10 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
int version = chunkReader.getRevision().getVersion();
String sql = createSelect(source, version, where);
- if (TRACER.isEnabled()) TRACER.trace(sql);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace(sql);
+ }
ResultSet resultSet = null;
try
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ToOneReferenceMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ToOneReferenceMapping.java
index fecb477..e2819f7 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ToOneReferenceMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ToOneReferenceMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -25,7 +25,7 @@ public class ToOneReferenceMapping extends AttributeMapping.AMObject
}
@Override
- protected Long getRevisionValue(CDORevisionImpl revision)
+ protected Long getRevisionValue(InternalCDORevision revision)
{
CDOID id = (CDOID)super.getRevisionValue(revision);
return id.getValue();
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalClassMapping.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalClassMapping.java
index ff6a8d3..f4aa2b2 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalClassMapping.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/VerticalClassMapping.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.server.db.IClassMapping;
import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
@@ -61,7 +61,7 @@ public class VerticalClassMapping extends ClassMapping
}
@Override
- public void writeRevision(IDBStoreWriter storeWriter, CDORevisionImpl revision)
+ public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
{
super.writeRevision(storeWriter, revision);
if (superMappings != null)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
index d80ab49..707baec 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreAccessor.java
@@ -12,13 +12,14 @@
package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreChunkReader;
import org.eclipse.emf.cdo.server.IStoreReader;
@@ -82,9 +83,10 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
public CDORevision readRevision(CDOID id, int referenceChunk)
{
- CDORevisionImpl storeRevision = (CDORevisionImpl)getStore().getRevision(id);
+ InternalCDORevision storeRevision = (InternalCDORevision)getStore().getRevision(id);
// IRevisionManager revisionManager = getStore().getRepository().getRevisionManager();
- // CDORevisionImpl newRevision = new CDORevisionImpl(revisionManager, storeRevision.getCDOClass(), storeRevision
+ // InternalCDORevision newRevision = new InternalCDORevision(revisionManager, storeRevision.getCDOClass(),
+ // storeRevision
// .getID());
// newRevision.setResourceID(storeRevision.getResourceID());
//
@@ -93,7 +95,7 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
// if (feature.isMany())
// {
// newRevision.setListSize(feature, storeRevision.getList(feature).size());
- // MoveableList list = newRevision.getList(feature);
+ // MoveableList<Object> list = newRevision.getList(feature);
// int size = referenceChunk == CDORevision.UNCHUNKED ? list.size() : referenceChunk;
// for (int i = 0; i < size; i++)
// {
@@ -130,7 +132,7 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
{
}
- public void writeRevision(CDORevisionImpl revision)
+ public void writeRevision(InternalCDORevision revision)
{
newRevisions.add(revision);
}
@@ -138,8 +140,8 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
@Override
public void writeRevisionDelta(CDORevisionDeltaImpl delta)
{
- CDORevisionImpl revision = (CDORevisionImpl)getStore().getRevision(delta.getID());
- CDORevisionImpl newRevision = new CDORevisionImpl(revision);
+ InternalCDORevision revision = (InternalCDORevision)getStore().getRevision(delta.getID());
+ InternalCDORevision newRevision = (InternalCDORevision)CDORevisionUtil.copy(revision);
delta.apply(newRevision);
newRevisions.add(newRevision);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreChunkReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreChunkReader.java
index c1900d7..2b45843 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreChunkReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStoreChunkReader.java
@@ -11,7 +11,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -36,7 +36,7 @@ public class MEMStoreChunkReader extends StoreChunkReader
for (Chunk chunk : chunks)
{
int startIndex = chunk.getStartIndex();
- CDORevisionImpl revision = (CDORevisionImpl)store.getRevision(getRevision().getID());
+ InternalCDORevision revision = (InternalCDORevision)store.getRevision(getRevision().getID());
for (int i = 0; i < chunk.size(); i++)
{
Object object = revision.get(getFeature(), startIndex + i);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java
index 0436818..78d779f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -103,7 +103,7 @@ public class NOOPStoreAccessor extends StoreAccessor implements IStoreReader, IS
{
}
- public void writeRevision(CDORevisionImpl revision)
+ public void writeRevision(InternalCDORevision revision)
{
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
index e8e790e..94c5113 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java
@@ -15,14 +15,14 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOPathFeatureImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IRevisionManager;
import org.eclipse.emf.cdo.server.IStoreChunkReader;
@@ -30,6 +30,7 @@ import org.eclipse.emf.cdo.server.IStoreReader;
import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IStoreChunkReader.Chunk;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.eclipse.net4j.util.transaction.ITransaction;
import org.eclipse.net4j.util.transaction.ITransactionalOperation;
@@ -57,7 +58,7 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
return repository;
}
- public void addRevision(ITransaction<IStoreWriter> storeTransaction, CDORevisionImpl revision)
+ public void addRevision(ITransaction<IStoreWriter> storeTransaction, InternalCDORevision revision)
{
storeTransaction.execute(new AddRevisionOperation(revision));
}
@@ -79,51 +80,51 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
}
@Override
- protected CDORevisionImpl verifyRevision(CDORevisionImpl revision, int referenceChunk)
+ protected InternalCDORevision verifyRevision(InternalCDORevision revision, int referenceChunk)
{
IStoreReader storeReader = null;
revision = super.verifyRevision(revision, referenceChunk);
if (repository.isVerifyingRevisions())
{
storeReader = StoreUtil.getReader();
- revision = storeReader.verifyRevision(revision);
+ revision = (InternalCDORevision)storeReader.verifyRevision(revision);
}
ensureChunks(revision, referenceChunk, storeReader);
return revision;
}
- protected void ensureChunks(CDORevisionImpl revision, int referenceChunk, IStoreReader storeReader)
+ protected void ensureChunks(InternalCDORevision revision, int referenceChunk, IStoreReader storeReader)
{
- CDOClassImpl cdoClass = revision.getCDOClass();
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
CDOFeatureImpl[] features = cdoClass.getAllFeatures();
for (int i = 0; i < features.length; i++)
{
CDOFeatureImpl feature = features[i];
if (feature.isReference() && feature.isMany())
{
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
int chunkEnd = Math.min(referenceChunk, list.size());
storeReader = ensureChunk(revision, feature, storeReader, list, 0, chunkEnd);
}
}
}
- public IStoreReader ensureChunk(CDORevisionImpl revision, CDOFeature feature, int chunkStart, int chunkEnd)
+ public IStoreReader ensureChunk(InternalCDORevision revision, CDOFeature feature, int chunkStart, int chunkEnd)
{
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
chunkEnd = Math.min(chunkEnd, list.size());
return ensureChunk(revision, feature, StoreUtil.getReader(), list, chunkStart, chunkEnd);
}
- protected IStoreReader ensureChunk(CDORevisionImpl revision, CDOFeature feature, IStoreReader storeReader,
- MoveableList list, int chunkStart, int chunkEnd)
+ protected IStoreReader ensureChunk(InternalCDORevision revision, CDOFeature feature, IStoreReader storeReader,
+ MoveableList<Object> list, int chunkStart, int chunkEnd)
{
IStoreChunkReader chunkReader = null;
int fromIndex = -1;
for (int j = chunkStart; j < chunkEnd; j++)
{
- if (list.get(j) == CDORevisionImpl.UNINITIALIZED)
+ if (list.get(j) == InternalCDORevision.UNINITIALIZED)
{
if (fromIndex == -1)
{
@@ -201,34 +202,34 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
}
@Override
- protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk)
+ protected InternalCDORevision loadRevision(CDOID id, int referenceChunk)
{
IStoreReader storeReader = StoreUtil.getReader();
- return (CDORevisionImpl)storeReader.readRevision(id, referenceChunk);
+ return (InternalCDORevision)storeReader.readRevision(id, referenceChunk);
}
@Override
- protected CDORevisionImpl loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
+ protected InternalCDORevision loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
{
IStoreReader storeReader = StoreUtil.getReader();
- return (CDORevisionImpl)storeReader.readRevisionByTime(id, referenceChunk, timeStamp);
+ return (InternalCDORevision)storeReader.readRevisionByTime(id, referenceChunk, timeStamp);
}
@Override
- protected CDORevisionImpl loadRevisionByVersion(CDOID id, int referenceChunk, int version)
+ protected InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version)
{
IStoreReader storeReader = StoreUtil.getReader();
- return (CDORevisionImpl)storeReader.readRevisionByVersion(id, referenceChunk, version);
+ return (InternalCDORevision)storeReader.readRevisionByVersion(id, referenceChunk, version);
}
@Override
- protected List<CDORevisionImpl> loadRevisions(Collection<CDOID> ids, int referenceChunk)
+ protected List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk)
{
IStoreReader storeReader = StoreUtil.getReader();
- List<CDORevisionImpl> revisions = new ArrayList<CDORevisionImpl>();
+ List<InternalCDORevision> revisions = new ArrayList<InternalCDORevision>();
for (CDOID id : ids)
{
- CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevision(id, referenceChunk);
+ InternalCDORevision revision = (InternalCDORevision)storeReader.readRevision(id, referenceChunk);
revisions.add(revision);
}
@@ -236,13 +237,13 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
}
@Override
- protected List<CDORevisionImpl> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
+ protected List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
{
IStoreReader storeReader = StoreUtil.getReader();
- List<CDORevisionImpl> revisions = new ArrayList<CDORevisionImpl>();
+ List<InternalCDORevision> revisions = new ArrayList<InternalCDORevision>();
for (CDOID id : ids)
{
- CDORevisionImpl revision = (CDORevisionImpl)storeReader.readRevisionByTime(id, referenceChunk, timeStamp);
+ InternalCDORevision revision = (InternalCDORevision)storeReader.readRevisionByTime(id, referenceChunk, timeStamp);
revisions.add(revision);
}
@@ -268,9 +269,9 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
*/
private final class AddRevisionOperation implements ITransactionalOperation<IStoreWriter>
{
- private CDORevisionImpl revision;
+ private InternalCDORevision revision;
- private AddRevisionOperation(CDORevisionImpl revision)
+ private AddRevisionOperation(InternalCDORevision revision)
{
this.revision = revision;
}
@@ -303,7 +304,7 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
{
private CDORevisionDeltaImpl revisionDelta;
- private CDORevisionImpl dirtyRevision = null;
+ private InternalCDORevision dirtyRevision = null;
private AddRevisionDeltaOperation(CDORevisionDeltaImpl revisionDelta)
{
@@ -319,14 +320,14 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
}
else
{
- CDORevisionImpl oldRevision = getRevisionByVersion(revisionDelta.getID(), CDORevision.UNCHUNKED, revisionDelta
- .getOriginVersion(), true);
+ InternalCDORevision oldRevision = getRevisionByVersion(revisionDelta.getID(), CDORevision.UNCHUNKED,
+ revisionDelta.getOriginVersion(), true);
if (oldRevision == null)
{
throw new IllegalStateException("Can not retrieve origin revision");
}
- dirtyRevision = new CDORevisionImpl(oldRevision);
+ dirtyRevision = (InternalCDORevision)CDORevisionUtil.copy(oldRevision);
revisionDelta.apply(dirtyRevision);
// Can throw an exception if duplicate
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
index 94ca116..1cbbe21 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java
@@ -15,7 +15,7 @@ import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDOIDProvider;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.internal.server.protocol.CDOServerProtocol;
import org.eclipse.emf.cdo.internal.server.protocol.InvalidationNotification;
@@ -192,11 +192,11 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
/**
* TODO I can't see how recursion is controlled/limited
*/
- public void collectContainedRevisions(CDORevisionImpl revision, int referenceChunk, Set<CDOID> revisions,
- List<CDORevisionImpl> additionalRevisions)
+ public void collectContainedRevisions(InternalCDORevision revision, int referenceChunk, Set<CDOID> revisions,
+ List<InternalCDORevision> additionalRevisions)
{
RevisionManager revisionManager = getSessionManager().getRepository().getRevisionManager();
- CDOClassImpl cdoClass = revision.getCDOClass();
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
CDOFeatureImpl[] features = cdoClass.getAllFeatures();
for (int i = 0; i < features.length; i++)
{
@@ -209,7 +209,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
CDOID id = (CDOID)value;
if (!id.isNull() && !revisions.contains(id))
{
- CDORevisionImpl containedRevision = revisionManager.getRevision(id, referenceChunk);
+ InternalCDORevision containedRevision = revisionManager.getRevision(id, referenceChunk);
revisions.add(id);
additionalRevisions.add(containedRevision);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
index a04a30f..bcd46b2 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java
@@ -11,10 +11,11 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreAccessor;
import org.eclipse.emf.cdo.server.IView;
@@ -81,9 +82,9 @@ public class StoreAccessor implements IStoreAccessor
return null;
}
- public CDORevisionImpl verifyRevision(CDORevisionImpl revision)
+ public InternalCDORevision verifyRevision(CDORevision revision)
{
- return revision;
+ return (InternalCDORevision)revision;
}
public CDOID primeNewObject(CDOClass cdoClass)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
index 47379d6..a281b2b 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java
@@ -14,7 +14,7 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.internal.server.PackageManager;
import org.eclipse.emf.cdo.internal.server.Repository;
@@ -29,6 +29,7 @@ import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackageManager;
import org.eclipse.emf.cdo.protocol.model.core.CDOCorePackage;
import org.eclipse.emf.cdo.protocol.model.resource.CDOResourcePackage;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.server.IStore;
import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IView;
@@ -59,9 +60,9 @@ public class CommitTransactionIndication extends CDOServerIndication
private CDOPackageImpl[] newPackages;
- private CDORevisionImpl[] newResources;
+ private InternalCDORevision[] newResources;
- private CDORevisionImpl[] newObjects;
+ private InternalCDORevision[] newObjects;
private CDORevisionDeltaImpl[] dirtyObjects;
@@ -204,7 +205,8 @@ public class CommitTransactionIndication extends CDOServerIndication
return newPackages;
}
- private CDORevisionImpl[] readNewResources(ExtendedDataInputStream in, IStoreWriter storeWriter) throws IOException
+ private InternalCDORevision[] readNewResources(ExtendedDataInputStream in, IStoreWriter storeWriter)
+ throws IOException
{
int size = in.readInt();
if (PROTOCOL.isEnabled())
@@ -215,7 +217,7 @@ public class CommitTransactionIndication extends CDOServerIndication
return readRevisions(in, storeWriter, size);
}
- private CDORevisionImpl[] readNewObjects(ExtendedDataInputStream in, IStoreWriter storeWriter) throws IOException
+ private InternalCDORevision[] readNewObjects(ExtendedDataInputStream in, IStoreWriter storeWriter) throws IOException
{
int size = in.readInt();
if (PROTOCOL.isEnabled())
@@ -247,14 +249,14 @@ public class CommitTransactionIndication extends CDOServerIndication
return deltas;
}
- private CDORevisionImpl[] readRevisions(ExtendedDataInputStream in, IStoreWriter storeWriter, int size)
+ private InternalCDORevision[] readRevisions(ExtendedDataInputStream in, IStoreWriter storeWriter, int size)
throws IOException
{
RevisionManager revisionManager = sessionPackageManager.getRepository().getRevisionManager();
- CDORevisionImpl[] revisions = new CDORevisionImpl[size];
+ InternalCDORevision[] revisions = new InternalCDORevision[size];
for (int i = 0; i < size; i++)
{
- revisions[i] = new CDORevisionImpl(in, revisionManager, transactionPackageManager);
+ revisions[i] = (InternalCDORevision)CDORevisionUtil.read(in, revisionManager, transactionPackageManager);
mapTemporaryID(revisions[i], storeWriter);
}
@@ -267,10 +269,10 @@ public class CommitTransactionIndication extends CDOServerIndication
sessionPackageManager.addPackages(storeTransaction, newPackages);
}
- private void addRevisions(ITransaction<IStoreWriter> storeTransaction, CDORevisionImpl[] revisions)
+ private void addRevisions(ITransaction<IStoreWriter> storeTransaction, InternalCDORevision[] revisions)
{
RevisionManager revisionManager = getRevisionManager();
- for (CDORevisionImpl revision : revisions)
+ for (InternalCDORevision revision : revisions)
{
revision.setCreated(timeStamp);
revision.adjustReferences(idMappings);
@@ -289,7 +291,7 @@ public class CommitTransactionIndication extends CDOServerIndication
}
}
- private void mapTemporaryID(CDORevisionImpl revision, IStoreWriter storeWriter)
+ private void mapTemporaryID(InternalCDORevision revision, IStoreWriter storeWriter)
{
CDOID oldID = revision.getID();
if (oldID.isTemporary())
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
index c125246..33373d8 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java
@@ -13,8 +13,7 @@ package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassRefImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
@@ -24,6 +23,7 @@ import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
@@ -60,32 +60,47 @@ public class LoadChunkIndication extends CDOReadIndication
protected void indicating(ExtendedDataInputStream in) throws IOException
{
id = CDOIDImpl.read(in);
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read revision ID: {0}", id);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read revision ID: {0}", id);
+ }
version = in.readInt();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read revision version: {0}", version);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read revision version: {0}", version);
+ }
CDOClassRef classRef = new CDOClassRefImpl(in, null);
int featureID = in.readInt();
CDOClass cdoClass = classRef.resolve(getPackageManager());
feature = cdoClass.lookupFeature(featureID);
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read feature: {0}", feature);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read feature: {0}", feature);
+ }
fromIndex = in.readInt();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read fromIndex: {0}", fromIndex);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read fromIndex: {0}", fromIndex);
+ }
toIndex = in.readInt();
- if (PROTOCOL.isEnabled()) PROTOCOL.format("Read toIndex: {0}", toIndex);
+ if (PROTOCOL.isEnabled())
+ {
+ PROTOCOL.format("Read toIndex: {0}", toIndex);
+ }
}
@Override
protected void responding(ExtendedDataOutputStream out) throws IOException
{
- CDORevisionImpl revision = getRevisionManager().getRevisionByVersion(id, 0, version);
+ InternalCDORevision revision = getRevisionManager().getRevisionByVersion(id, 0, version);
getRevisionManager().ensureChunk(revision, feature, fromIndex, toIndex + 1);
Session session = getSession();
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
for (int i = fromIndex; i <= toIndex; i++)
{
CDOIDImpl.write(out, session.provideCDOID(list.get(i)));
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
index 934c24d..b1a5ed4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByTimeIndication.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
@@ -48,7 +48,7 @@ public class LoadRevisionByTimeIndication extends LoadRevisionIndication
}
@Override
- protected CDORevisionImpl getRevision(CDOID cdoID)
+ protected InternalCDORevision getRevision(CDOID cdoID)
{
return getRevisionManager().getRevisionByTime(cdoID, referenceChunk, timeStamp);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java
index 4edaa8d..4e1fad3 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionByVersionIndication.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
@@ -49,7 +49,7 @@ public class LoadRevisionByVersionIndication extends LoadRevisionIndication
}
@Override
- protected CDORevisionImpl getRevision(CDOID id)
+ protected InternalCDORevision getRevision(CDOID id)
{
return getRevisionManager().getRevisionByVersion(id, referenceChunk, version);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
index c99b480..19b336d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java
@@ -11,8 +11,7 @@
package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.internal.server.Session;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
@@ -23,6 +22,7 @@ import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
@@ -115,7 +115,7 @@ public class LoadRevisionIndication extends CDOReadIndication
protected void responding(ExtendedDataOutputStream out) throws IOException
{
Session session = getSession();
- List<CDORevisionImpl> additionalRevisions = new ArrayList<CDORevisionImpl>();
+ List<InternalCDORevision> additionalRevisions = new ArrayList<InternalCDORevision>();
Set<CDOID> revisionIDs = new HashSet<CDOID>();
if (PROTOCOL.isEnabled())
{
@@ -136,13 +136,13 @@ public class LoadRevisionIndication extends CDOReadIndication
PROTOCOL.format("Collecting more revisions based on rules");
}
- CDORevisionImpl revisionContext = getRevision(contextID);
+ InternalCDORevision revisionContext = getRevision(contextID);
collectRevisions(revisionContext, revisionIDs, additionalRevisions, visitedFetchRules);
}
for (CDOID id : ids)
{
- CDORevisionImpl revision = getRevision(id);
+ InternalCDORevision revision = getRevision(id);
revision.write(out, session, referenceChunk);
if (loadRevisionCollectionChunkSize > 0)
{
@@ -157,20 +157,20 @@ public class LoadRevisionIndication extends CDOReadIndication
}
out.writeInt(additionalSize);
- for (CDORevisionImpl revision : additionalRevisions)
+ for (InternalCDORevision revision : additionalRevisions)
{
revision.write(out, session, referenceChunk);
}
}
- protected CDORevisionImpl getRevision(CDOID id)
+ protected InternalCDORevision getRevision(CDOID id)
{
RevisionManager revisionManager = getRevisionManager();
return revisionManager.getRevision(id, referenceChunk);
}
- private void collectRevisions(CDORevisionImpl revision, Set<CDOID> revisions,
- List<CDORevisionImpl> additionalRevisions, Set<CDOFetchRule> visitedFetchRules)
+ private void collectRevisions(InternalCDORevision revision, Set<CDOID> revisions,
+ List<InternalCDORevision> additionalRevisions, Set<CDOFetchRule> visitedFetchRules)
{
getSession().collectContainedRevisions(revision, referenceChunk, revisions, additionalRevisions);
CDOFetchRule fetchRule = fetchRules.get(revision.getCDOClass());
@@ -186,7 +186,7 @@ public class LoadRevisionIndication extends CDOReadIndication
{
if (feature.isMany())
{
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
int toIndex = Math.min(loadRevisionCollectionChunkSize, list.size()) - 1;
for (int i = 0; i <= toIndex; i++)
{
@@ -196,7 +196,7 @@ public class LoadRevisionIndication extends CDOReadIndication
CDOID id = (CDOID)value;
if (!id.isNull() && !revisions.contains(id))
{
- CDORevisionImpl containedRevision = revisionManager.getRevision(id, referenceChunk);
+ InternalCDORevision containedRevision = revisionManager.getRevision(id, referenceChunk);
revisions.add(containedRevision.getID());
additionalRevisions.add(containedRevision);
collectRevisions(containedRevision, revisions, additionalRevisions, visitedFetchRules);
@@ -212,7 +212,7 @@ public class LoadRevisionIndication extends CDOReadIndication
CDOID id = (CDOID)value;
if (!id.isNull() && !revisions.contains(id))
{
- CDORevisionImpl containedRevision = revisionManager.getRevision(id, referenceChunk);
+ InternalCDORevision containedRevision = revisionManager.getRevision(id, referenceChunk);
revisions.add(containedRevision.getID());
additionalRevisions.add(containedRevision);
collectRevisions(containedRevision, revisions, additionalRevisions, visitedFetchRules);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/VerifyRevisionIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/VerifyRevisionIndication.java
index 14368c1..e89e2e3 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/VerifyRevisionIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/VerifyRevisionIndication.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.cdo.internal.server.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.server.RevisionManager;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
@@ -56,7 +56,7 @@ public class VerifyRevisionIndication extends CDOReadIndication
int version = in.readInt();
if (PROTOCOL.isEnabled()) PROTOCOL.format("Read ID and version: {0}v{1}", id, version);
- CDORevisionImpl revision = revisionManager.getRevisionByVersion(id, 0, version);
+ InternalCDORevision revision = revisionManager.getRevisionByVersion(id, 0, version);
timeStamps[i] = revision.getRevised();
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
index c47ca15..0494775 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
@@ -11,7 +11,6 @@
package org.eclipse.emf.cdo.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.server.StoreUtil;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -62,5 +61,5 @@ public interface IStoreReader extends IStoreAccessor
public String readResourcePath(CDOID id);
- public CDORevisionImpl verifyRevision(CDORevisionImpl revision);
+ public CDORevision verifyRevision(CDORevision revision);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
index c9f5d61..ef9cc19 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java
@@ -15,7 +15,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassProxy;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
@@ -46,7 +46,7 @@ public interface IStoreWriter extends IStoreReader
public CDOID primeNewObject(CDOClass cdoClass);
- public void writeRevision(CDORevisionImpl revision);
+ public void writeRevision(InternalCDORevision revision);
public void writeRevisionDelta(CDORevisionDeltaImpl delta);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
index fdf23ed..f3fc3ba 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaTest.java
@@ -11,14 +11,16 @@
**************************************************************************/
package org.eclipse.emf.cdo.tests;
+import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOListFeatureDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOAddFeatureDelta;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOClearFeatureDelta;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
@@ -31,8 +33,6 @@ import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model1.SalesOrder;
import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.emf.internal.cdo.InternalCDOObject;
-
import junit.framework.Assert;
/**
@@ -56,11 +56,11 @@ public class RevisionDeltaTest extends AbstractCDOTest
company1.getCategories().add(category1);
company1.setName("TEST");
- CDORevisionImpl rev1 = getCopyCDORevision(company1);
+ InternalCDORevision rev1 = getCopyCDORevision(company1);
// Test simple attributes
company1.setName("TEST3");
- CDORevisionImpl rev2 = getCopyCDORevision(company1);
+ InternalCDORevision rev2 = getCopyCDORevision(company1);
CDORevisionDelta revisionDelta = rev2.compare(rev1);
assertEquals(1, revisionDelta.getFeatureDeltas().size());
@@ -69,7 +69,7 @@ public class RevisionDeltaTest extends AbstractCDOTest
// Test List clear
company1.getCategories().clear();
- CDORevisionImpl rev3 = getCopyCDORevision(company1);
+ InternalCDORevision rev3 = getCopyCDORevision(company1);
CDORevisionDelta revisionDelta3 = rev3.compare(rev2);
assertEquals(1, revisionDelta3.getFeatureDeltas().size());
@@ -84,7 +84,7 @@ public class RevisionDeltaTest extends AbstractCDOTest
Category category = Model1Factory.eINSTANCE.createCategory();
company1.getCategories().add(category);
}
- CDORevisionImpl rev4 = getCopyCDORevision(company1);
+ InternalCDORevision rev4 = getCopyCDORevision(company1);
CDORevisionDelta revisionDelta4 = rev4.compare(rev3);
assertEquals(1, revisionDelta4.getFeatureDeltas().size());
@@ -152,6 +152,7 @@ public class RevisionDeltaTest extends AbstractCDOTest
transaction.close();
session.close();
}
+
/**
* CDOView.getRevision() does not work for transactions/dirty objects (INVALID)
*
@@ -165,24 +166,24 @@ public class RevisionDeltaTest extends AbstractCDOTest
Customer customer = Model1Factory.eINSTANCE.createCustomer();
resource.getContents().add(customer);
-
-
+
SalesOrder salesOrder = Model1Factory.eINSTANCE.createSalesOrder();
resource.getContents().add(salesOrder);
customer.getSalesOrders().add(salesOrder);
customer.getSalesOrders().add(salesOrder);
transaction.commit();
-
+
customer.getSalesOrders().add(salesOrder);
customer.getSalesOrders().clear();
customer.getSalesOrders().add(salesOrder);
-
+
transaction.commit();
transaction.close();
session.close();
}
- private CDORevisionImpl getCopyCDORevision(Object object)
+
+ private InternalCDORevision getCopyCDORevision(Object object)
{
- return new CDORevisionImpl((CDORevisionImpl)((InternalCDOObject)object).cdoRevision());
+ return (InternalCDORevision)CDORevisionUtil.copy(((CDOObject)object).cdoRevision());
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
index 599d481..965c3ea 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
@@ -331,9 +331,9 @@ public final class EMFUtil
// }
}
- // public static List<Change> analyzeListDifferences(CDORevisionImpl
+ // public static List<Change> analyzeListDifferences(InternalCDORevision
// oldRevision,
- // CDORevisionImpl newRevision, CDOFeatureImpl feature)
+ // InternalCDORevision newRevision, CDOFeatureImpl feature)
// {
// if (!feature.isMany())
// {
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
index 59865b4..dfa70ae 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAuditImpl.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOAudit;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
@@ -42,11 +42,11 @@ public class CDOAuditImpl extends CDOViewImpl implements CDOAudit
}
@Override
- public CDORevisionImpl getRevision(CDOID id)
+ public InternalCDORevision getRevision(CDOID id)
{
CDOSessionImpl session = getSession();
CDORevisionResolver revisionManager = session.getRevisionManager();
- return (CDORevisionImpl)revisionManager.getRevisionByTime(id, session.getReferenceChunkSize(), timeStamp);
+ return (InternalCDORevision)revisionManager.getRevisionByTime(id, session.getReferenceChunkSize(), timeStamp);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index 0034da3..fdf4cf7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOType;
@@ -64,7 +64,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
private CDOResourceImpl resource;
- private CDORevisionImpl revision;
+ private InternalCDORevision revision;
public CDOLegacyImpl()
{
@@ -76,7 +76,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
return state;
}
- public CDORevisionImpl cdoRevision()
+ public InternalCDORevision cdoRevision()
{
return revision;
}
@@ -139,7 +139,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
TRACER.format("Setting revision: {0}", revision);
}
- this.revision = (CDORevisionImpl)revision;
+ this.revision = (InternalCDORevision)revision;
}
public void cdoInternalSetResource(CDOResource resource)
@@ -166,8 +166,8 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
transferInstanceToRevision();
CDORevisionManagerImpl revisionManager = view.getSession().getRevisionManager();
- CDORevisionImpl revision = cdoRevision();
- CDORevisionImpl originRevision = revisionManager.getRevisionByVersion(revision.getID(), CDORevision.UNCHUNKED,
+ InternalCDORevision revision = cdoRevision();
+ InternalCDORevision originRevision = revisionManager.getRevisionByVersion(revision.getID(), CDORevision.UNCHUNKED,
revision.getVersion() - 1, false);
CDOTransactionImpl transaction = cdoView().toTransaction();
@@ -262,7 +262,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
}
// Handle values
- CDOClassImpl cdoClass = revision.getCDOClass();
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
CDOFeatureImpl[] features = cdoClass.getAllFeatures();
for (int i = 0; i < features.length; i++)
{
@@ -335,7 +335,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.In
transferContainmentToInstance(view);
// Handle values
- CDOClassImpl cdoClass = revision.getCDOClass();
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
CDOFeatureImpl[] features = cdoClass.getAllFeatures();
for (CDOFeatureImpl feature : features)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index f5ff62a..6fe9675 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -62,7 +62,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
private CDOResourceImpl resource;
- private CDORevisionImpl revision;
+ private InternalCDORevision revision;
public CDOObjectImpl()
{
@@ -80,7 +80,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
return state;
}
- public CDORevisionImpl cdoRevision()
+ public InternalCDORevision cdoRevision()
{
return revision;
}
@@ -155,7 +155,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
TRACER.format("Setting revision: {0}", revision);
}
- this.revision = (CDORevisionImpl)revision;
+ this.revision = (InternalCDORevision)revision;
}
public void cdoInternalSetView(CDOView view)
@@ -496,7 +496,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
CDOViewImpl view = (CDOViewImpl)cdoObject.cdoView();
- CDORevisionImpl revision = (CDORevisionImpl)cdoObject.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)cdoObject.cdoRevision();
revision.setVersion(1);
revision.setContainerID(eContainer == null ? CDOID.NULL : ((CDOObjectImpl)eContainer).cdoID());
revision.setContainingFeatureID(eContainerFeatureID);
@@ -520,7 +520,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
@SuppressWarnings("unchecked")
- private static void finalizeRevisionFeature(CDOViewImpl view, CDORevisionImpl revision, int i, Object setting,
+ private static void finalizeRevisionFeature(CDOViewImpl view, InternalCDORevision revision, int i, Object setting,
EStructuralFeature eFeature, Object[] eSettings)
{
CDOFeatureImpl cdoFeature = ModelUtil.getCDOFeature(eFeature, view.getSession().getPackageManager());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
index 4308a08..dec00c2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectMerger.java
@@ -12,8 +12,9 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOState;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionMerger;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
/**
@@ -27,7 +28,7 @@ public class CDOObjectMerger extends CDORevisionMerger
public void merge(InternalCDOObject object, CDORevisionDelta delta)
{
- CDORevisionImpl revision = new CDORevisionImpl((CDORevisionImpl)object.cdoRevision());
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.copy(object.cdoRevision());
revision.setTransactional();
object.cdoInternalSetRevision(revision);
object.cdoInternalSetState(CDOState.DIRTY);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
index eccf56c..8983667 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDORevisionManagerImpl.java
@@ -12,9 +12,8 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDORevisionManager;
import org.eclipse.emf.cdo.analyzer.CDOFetchRuleManager;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionResolverImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
@@ -30,6 +29,7 @@ import org.eclipse.emf.internal.cdo.protocol.LoadRevisionRequest;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.internal.util.om.trace.PerfTracer;
import org.eclipse.net4j.signal.failover.IFailOverStrategy;
+import org.eclipse.net4j.util.collection.MoveableList;
import java.util.ArrayList;
import java.util.Collection;
@@ -59,7 +59,7 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
public CDOID resolveReferenceProxy(CDOReferenceProxy referenceProxy)
{
// Get proxy values
- CDORevisionImpl revision = (CDORevisionImpl)referenceProxy.getRevision();
+ InternalCDORevision revision = (InternalCDORevision)referenceProxy.getRevision();
CDOFeature feature = referenceProxy.getFeature();
int accessIndex = referenceProxy.getIndex();
@@ -71,7 +71,7 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
chunkSize = Integer.MAX_VALUE;
}
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
int size = list.size();
int fromIndex = accessIndex;
int toIndex = accessIndex;
@@ -210,36 +210,36 @@ public class CDORevisionManagerImpl extends CDORevisionResolverImpl implements C
}
@Override
- protected CDORevisionImpl loadRevision(CDOID id, int referenceChunk)
+ protected InternalCDORevision loadRevision(CDOID id, int referenceChunk)
{
return send(new LoadRevisionRequest(session.getChannel(), id, referenceChunk)).get(0);
}
@Override
- protected CDORevisionImpl loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
+ protected InternalCDORevision loadRevisionByTime(CDOID id, int referenceChunk, long timeStamp)
{
return send(new LoadRevisionByTimeRequest(session.getChannel(), id, referenceChunk, timeStamp)).get(0);
}
@Override
- protected CDORevisionImpl loadRevisionByVersion(CDOID id, int referenceChunk, int version)
+ protected InternalCDORevision loadRevisionByVersion(CDOID id, int referenceChunk, int version)
{
return send(new LoadRevisionByVersionRequest(session.getChannel(), id, referenceChunk, version)).get(0);
}
@Override
- protected List<CDORevisionImpl> loadRevisions(Collection<CDOID> ids, int referenceChunk)
+ protected List<InternalCDORevision> loadRevisions(Collection<CDOID> ids, int referenceChunk)
{
return send(new LoadRevisionRequest(session.getChannel(), ids, referenceChunk));
}
@Override
- protected List<CDORevisionImpl> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
+ protected List<InternalCDORevision> loadRevisionsByTime(Collection<CDOID> ids, int referenceChunk, long timeStamp)
{
return send(new LoadRevisionByTimeRequest(session.getChannel(), ids, referenceChunk, timeStamp));
}
- private List<CDORevisionImpl> send(LoadRevisionRequest request)
+ private List<InternalCDORevision> send(LoadRevisionRequest request)
{
try
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index c583440..23ae830 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -15,10 +15,10 @@ import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.CDOUtil;
@@ -192,14 +192,14 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
public void reload(InternalCDOObject... objects)
{
Map<CDOID, InternalCDOObject> ids = new HashMap<CDOID, InternalCDOObject>();
- List<CDORevisionImpl> revisions = new ArrayList<CDORevisionImpl>();
- List<CDORevisionImpl> revised = new ArrayList<CDORevisionImpl>();
+ List<InternalCDORevision> revisions = new ArrayList<InternalCDORevision>();
+ List<InternalCDORevision> revised = new ArrayList<InternalCDORevision>();
for (InternalCDOObject object : objects)
{
CDOState state = object.cdoState();
if (state != CDOState.NEW && state != CDOState.CONFLICT)
{
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
if (revision.isCurrent())
{
revisions.add(revision);
@@ -226,7 +226,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
}
revisions.addAll(revised);
- for (CDORevisionImpl revision : revisions)
+ for (InternalCDORevision revision : revisions)
{
InternalCDOObject object = ids.get(revision.getID());
if (TRACER.isEnabled())
@@ -329,7 +329,8 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
changeState(object, CDOState.PREPARED_ATTACH);
// Create new revision
- CDORevisionImpl revision = new CDORevisionImpl(revisionManager, (CDOClassImpl)object.cdoClass(), id);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil
+ .create(revisionManager, object.cdoClass(), id);
revision.setVersion(-1);
revision.setResourceID(data.resource.cdoID());
object.cdoInternalSetRevision(revision);
@@ -401,7 +402,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
}
// Adjust revision
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
revision.setID(id);
revision.setUntransactional();
revision.setCreated(data.getTimeStamp());
@@ -429,7 +430,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
int version = transactionalRevision.getVersion();
CDORevisionManagerImpl revisionManager = view.getSession().getRevisionManager();
- CDORevisionImpl previousRevision = revisionManager.getRevisionByVersion(id, 0, version - 1);
+ InternalCDORevision previousRevision = revisionManager.getRevisionByVersion(id, 0, version - 1);
object.cdoInternalSetRevision(previousRevision);
changeState(object, remote ? CDOState.PROXY : CDOState.CLEAN);
@@ -444,7 +445,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
public void execute(InternalCDOObject object, CDOState state, CDOEvent event, Object featureDelta)
{
// Copy revision
- CDORevisionImpl revision = new CDORevisionImpl((CDORevisionImpl)object.cdoRevision());
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.copy(object.cdoRevision());
revision.setTransactional();
object.cdoInternalSetRevision(revision);
@@ -492,13 +493,13 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
protected void reviseObject(InternalCDOObject object, Long timeStamp)
{
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
revision.setRevised(timeStamp - 1);
if (revision.isTransactional())
{
CDOViewImpl view = (CDOViewImpl)object.cdoView();
- CDORevisionImpl sessionRevision = view.getRevision(object.cdoID());
+ InternalCDORevision sessionRevision = view.getRevision(object.cdoID());
if (sessionRevision.getVersion() < revision.getVersion())
{
sessionRevision.setRevised(timeStamp - 1);
@@ -539,7 +540,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
{
CDOID id = object.cdoID();
CDOViewImpl view = (CDOViewImpl)object.cdoView();
- CDORevisionImpl revision = view.getRevision(id);
+ InternalCDORevision revision = view.getRevision(id);
object.cdoInternalSetRevision(revision);
changeState(object, CDOState.CLEAN);
object.cdoInternalPostLoad();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 62a6fe7..b773c69 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -12,8 +12,7 @@
package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOAddFeatureDeltaImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOClearFeatureDeltaImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOContainerFeatureDeltaImpl;
@@ -31,6 +30,7 @@ import org.eclipse.emf.internal.cdo.util.FSMUtil;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -71,8 +71,8 @@ public final class CDOStore implements EStore
CDOID containerID = (CDOID)((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(newContainer);
- CDOContainerFeatureDeltaImpl delta = new CDOContainerFeatureDeltaImpl(containerID, newContainerFeatureID);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOContainerFeatureDeltaImpl(containerID, newContainerFeatureID);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
revision.setContainerID(containerID);
revision.setContainingFeatureID(newContainerFeatureID);
}
@@ -85,7 +85,7 @@ public final class CDOStore implements EStore
TRACER.format("getContainer({0})", cdoObject);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
CDOID id = revision.getContainerID();
return (InternalEObject)((CDOViewImpl)cdoObject.cdoView()).convertIDToObject(id);
}
@@ -98,7 +98,7 @@ public final class CDOStore implements EStore
TRACER.format("getContainingFeatureID({0})", cdoObject);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.getContainingFeatureID();
}
@@ -118,7 +118,7 @@ public final class CDOStore implements EStore
}
view.getFeatureAnalyzer().preTraverseFeature(cdoObject, cdoFeature, index);
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
Object value = get(revision, cdoFeature, index);
if (cdoFeature.isReference())
{
@@ -135,7 +135,7 @@ public final class CDOStore implements EStore
return value;
}
- private void loadAhead(CDORevisionImpl revision, CDOFeatureImpl cdoFeature, CDOID id, int index)
+ private void loadAhead(InternalCDORevision revision, CDOFeatureImpl cdoFeature, CDOID id, int index)
{
CDOSessionImpl session = view.getSession();
CDORevisionManagerImpl revisionManager = session.getRevisionManager();
@@ -143,7 +143,7 @@ public final class CDOStore implements EStore
int chunkSize = view.getLoadRevisionCollectionChunkSize();
if (chunkSize > 1 && !revisionManager.containsRevision(id))
{
- MoveableList list = revision.getList(cdoFeature);
+ MoveableList<Object> list = revision.getList(cdoFeature);
int fromIndex = index;
int toIndex = Math.min(index + chunkSize, list.size()) - 1;
@@ -175,7 +175,7 @@ public final class CDOStore implements EStore
}
}
- private Object get(CDORevisionImpl revision, CDOFeature cdoFeature, int index)
+ private Object get(InternalCDORevision revision, CDOFeature cdoFeature, int index)
{
Object result = revision.get(cdoFeature, index);
if (cdoFeature.isReference())
@@ -197,7 +197,7 @@ public final class CDOStore implements EStore
TRACER.format("isSet({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.isSet(cdoFeature);
}
@@ -210,7 +210,7 @@ public final class CDOStore implements EStore
TRACER.format("size({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.size(cdoFeature);
}
@@ -223,7 +223,7 @@ public final class CDOStore implements EStore
TRACER.format("isEmpty({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.isEmpty(cdoFeature);
}
@@ -241,7 +241,7 @@ public final class CDOStore implements EStore
value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.contains(cdoFeature, value);
}
@@ -259,7 +259,7 @@ public final class CDOStore implements EStore
value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.indexOf(cdoFeature, value);
}
@@ -277,7 +277,7 @@ public final class CDOStore implements EStore
value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.lastIndexOf(cdoFeature, value);
}
@@ -290,7 +290,7 @@ public final class CDOStore implements EStore
TRACER.format("hashCode({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
return revision.hashCode(cdoFeature);
}
@@ -303,7 +303,7 @@ public final class CDOStore implements EStore
TRACER.format("toArray({0}, {1})", cdoObject, cdoFeature);
}
- CDORevisionImpl revision = getRevisionForReading(cdoObject);
+ InternalCDORevision revision = getRevisionForReading(cdoObject);
Object[] result = revision.toArray(cdoFeature);
if (cdoFeature.isReference())
{
@@ -350,8 +350,8 @@ public final class CDOStore implements EStore
TRACER.format("set({0}, {1}, {2}, {3})", cdoObject, cdoFeature, index, value);
}
- CDOSetFeatureDeltaImpl delta = new CDOSetFeatureDeltaImpl(cdoFeature, index, value);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOSetFeatureDeltaImpl(cdoFeature, index, value);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
if (cdoFeature.isReference())
{
Object oldValue = revision.get(cdoFeature, index);
@@ -385,8 +385,8 @@ public final class CDOStore implements EStore
TRACER.format("unset({0}, {1})", cdoObject, cdoFeature);
}
- CDOUnsetFeatureDeltaImpl delta = new CDOUnsetFeatureDeltaImpl(cdoFeature);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOUnsetFeatureDeltaImpl(cdoFeature);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
revision.unset(cdoFeature);
}
@@ -409,8 +409,8 @@ public final class CDOStore implements EStore
value = ((CDOViewImpl)cdoObject.cdoView()).convertObjectToID(value);
}
- CDOAddFeatureDeltaImpl delta = new CDOAddFeatureDeltaImpl(cdoFeature, index, value);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOAddFeatureDeltaImpl(cdoFeature, index, value);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
revision.add(cdoFeature, index, value);
}
@@ -423,8 +423,8 @@ public final class CDOStore implements EStore
TRACER.format("remove({0}, {1}, {2})", cdoObject, cdoFeature, index);
}
- CDORemoveFeatureDeltaImpl delta = new CDORemoveFeatureDeltaImpl(cdoFeature, index);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDORemoveFeatureDeltaImpl(cdoFeature, index);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
Object result = revision.remove(cdoFeature, index);
if (cdoFeature.isReference())
{
@@ -448,8 +448,8 @@ public final class CDOStore implements EStore
TRACER.format("clear({0}, {1})", cdoObject, cdoFeature);
}
- CDOClearFeatureDeltaImpl delta = new CDOClearFeatureDeltaImpl(cdoFeature);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOClearFeatureDeltaImpl(cdoFeature);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
revision.clear(cdoFeature);
}
@@ -462,8 +462,8 @@ public final class CDOStore implements EStore
TRACER.format("move({0}, {1}, {2}, {3})", cdoObject, cdoFeature, target, source);
}
- CDOMoveFeatureDeltaImpl delta = new CDOMoveFeatureDeltaImpl(cdoFeature, target, source);
- CDORevisionImpl revision = getRevisionForWriting(cdoObject, delta);
+ CDOFeatureDelta delta = new CDOMoveFeatureDeltaImpl(cdoFeature, target, source);
+ InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
Object result = revision.move(cdoFeature, target, source);
if (cdoFeature.isReference())
{
@@ -506,21 +506,21 @@ public final class CDOStore implements EStore
return ModelUtil.getCDOFeature(eFeature, packageManager);
}
- private static CDORevisionImpl getRevisionForReading(InternalCDOObject cdoObject)
+ private static InternalCDORevision getRevisionForReading(InternalCDOObject cdoObject)
{
CDOStateMachine.INSTANCE.read(cdoObject);
return getRevision(cdoObject);
}
- private static CDORevisionImpl getRevisionForWriting(InternalCDOObject cdoObject, CDOFeatureDelta delta)
+ private static InternalCDORevision getRevisionForWriting(InternalCDOObject cdoObject, CDOFeatureDelta delta)
{
CDOStateMachine.INSTANCE.write(cdoObject, delta);
return getRevision(cdoObject);
}
- private static CDORevisionImpl getRevision(InternalCDOObject cdoObject)
+ private static InternalCDORevision getRevision(InternalCDOObject cdoObject)
{
- CDORevisionImpl revision = (CDORevisionImpl)cdoObject.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)cdoObject.cdoRevision();
if (revision == null)
{
throw new IllegalStateException("revision == null");
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index ca6f7ba..c58bdde 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -25,7 +25,7 @@ import org.eclipse.emf.cdo.eresource.EresourceFactory;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.CDOIDProvider;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDTyped;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
@@ -253,10 +253,10 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return newInstance(eClass);
}
- public CDORevisionImpl getRevision(CDOID id)
+ public InternalCDORevision getRevision(CDOID id)
{
CDORevisionResolver revisionManager = session.getRevisionManager();
- return (CDORevisionImpl)revisionManager.getRevision(id, session.getReferenceChunkSize());
+ return (InternalCDORevision)revisionManager.getRevision(id, session.getReferenceChunkSize());
}
public InternalCDOObject getObject(CDOID id)
@@ -345,8 +345,8 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
TRACER.trace("Creating object for " + id);
}
- CDORevisionImpl revision = getRevision(id);
- CDOClassImpl cdoClass = revision.getCDOClass();
+ InternalCDORevision revision = getRevision(id);
+ CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
InternalCDOObject object = newInstance(cdoClass);
if (object instanceof CDOResourceImpl)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
index bdacebd..53cd39e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java
@@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
@@ -177,9 +177,9 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
for (CDORevisionDelta revisionDelta : revisionDeltas)
{
((CDORevisionDeltaImpl)revisionDelta).write(out, transaction);
- // CDORevisionImpl revision = transaction.getRevision(revisionDelta.getID());
+ // InternalCDORevision revision = transaction.getRevision(revisionDelta.getID());
CDOObject object = transaction.getDirtyObjects().get(revisionDelta.getID());
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
revisionAdjuster.adjustRevision(revision, revisionDelta);
}
}
@@ -190,7 +190,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
for (Iterator<?> it = objects.iterator(); it.hasNext();)
{
InternalCDOObject object = (InternalCDOObject)it.next();
- CDORevisionImpl revision = (CDORevisionImpl)object.cdoRevision();
+ InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
revision.write(out, transaction, CDORevision.UNCHUNKED);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
index b35bf6a..803485c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java
@@ -12,8 +12,7 @@ package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassRefImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl.MoveableList;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -22,6 +21,7 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.collection.MoveableList;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
@@ -34,7 +34,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
{
private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadChunkRequest.class);
- private CDORevisionImpl revision;
+ private InternalCDORevision revision;
private CDOFeature feature;
@@ -44,7 +44,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
private int toIndex;
- public LoadChunkRequest(IChannel channel, CDORevisionImpl revision, CDOFeature feature, int accessIndex,
+ public LoadChunkRequest(IChannel channel, InternalCDORevision revision, CDOFeature feature, int accessIndex,
int fromIndex, int toIndex)
{
super(channel);
@@ -108,7 +108,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
protected CDOID confirming(ExtendedDataInputStream in) throws IOException
{
CDOID accessID = null;
- MoveableList list = revision.getList(feature);
+ MoveableList<Object> list = revision.getList(feature);
for (int i = fromIndex; i <= toIndex; i++)
{
CDOID id = CDOIDImpl.read(in);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
index f74193c..43318ea 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java
@@ -12,10 +12,11 @@ package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.analyzer.CDOFetchRuleManager;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
+import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
import org.eclipse.emf.internal.cdo.CDORevisionManagerImpl;
import org.eclipse.emf.internal.cdo.CDOSessionImpl;
@@ -37,7 +38,7 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public class LoadRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
+public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevision>>
{
private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, LoadRevisionRequest.class);
@@ -111,12 +112,12 @@ public class LoadRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
}
@Override
- protected List<CDORevisionImpl> confirming(ExtendedDataInputStream in) throws IOException
+ protected List<InternalCDORevision> confirming(ExtendedDataInputStream in) throws IOException
{
CDOSessionImpl session = getSession();
CDORevisionManagerImpl revisionManager = session.getRevisionManager();
CDOSessionPackageManagerImpl packageManager = session.getPackageManager();
- ArrayList<CDORevisionImpl> revisions = new ArrayList<CDORevisionImpl>(ids.size());
+ ArrayList<InternalCDORevision> revisions = new ArrayList<InternalCDORevision>(ids.size());
if (PROTOCOL.isEnabled())
{
@@ -124,7 +125,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
}
for (int i = 0; i < ids.size(); i++)
{
- CDORevisionImpl revision = new CDORevisionImpl(in, revisionManager, packageManager);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.read(in, revisionManager, packageManager);
revisions.add(revision);
}
@@ -137,7 +138,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
}
for (int i = 0; i < size; i++)
{
- CDORevisionImpl revision = new CDORevisionImpl(in, revisionManager, packageManager);
+ InternalCDORevision revision = (InternalCDORevision)CDORevisionUtil.read(in, revisionManager, packageManager);
revisionManager.addRevision(revision);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java
index 4f4e146..2fe0d8e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -32,19 +32,19 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public class VerifyRevisionRequest extends CDOClientRequest<List<CDORevisionImpl>>
+public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevision>>
{
private static final ContextTracer PROTOCOL = new ContextTracer(OM.DEBUG_PROTOCOL, VerifyRevisionRequest.class);
- private Collection<CDORevisionImpl> revisions;
+ private Collection<InternalCDORevision> revisions;
- public VerifyRevisionRequest(IChannel channel, Collection<CDORevisionImpl> revisions)
+ public VerifyRevisionRequest(IChannel channel, Collection<InternalCDORevision> revisions)
{
super(channel);
this.revisions = revisions;
}
- public VerifyRevisionRequest(IChannel channel, CDORevisionImpl revision)
+ public VerifyRevisionRequest(IChannel channel, InternalCDORevision revision)
{
this(channel, Collections.singleton(revision));
}
@@ -64,7 +64,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<CDORevisionImpl
}
out.writeInt(revisions.size());
- for (CDORevisionImpl revision : revisions)
+ for (InternalCDORevision revision : revisions)
{
CDOID id = revision.getID();
int version = revision.getVersion();
@@ -79,15 +79,15 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<CDORevisionImpl
}
@Override
- protected List<CDORevisionImpl> confirming(ExtendedDataInputStream in) throws IOException
+ protected List<InternalCDORevision> confirming(ExtendedDataInputStream in) throws IOException
{
- ArrayList<CDORevisionImpl> result = new ArrayList<CDORevisionImpl>();
+ ArrayList<InternalCDORevision> result = new ArrayList<InternalCDORevision>();
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Reading {0} timeStamps", revisions.size());
}
- for (CDORevisionImpl revision : revisions)
+ for (InternalCDORevision revision : revisions)
{
long revised = in.readLong();
if (PROTOCOL.isEnabled())
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java
index 462104c..cb50207 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java
@@ -12,7 +12,7 @@
package org.eclipse.emf.internal.cdo.util;
import org.eclipse.emf.cdo.internal.protocol.revision.CDOIDProvider;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOFeatureDeltaVisitorImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDOListFeatureDeltaImpl;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -31,14 +31,14 @@ public class RevisionAdjuster extends CDOFeatureDeltaVisitorImpl
{
private CDOIDProvider idProvider;
- private CDORevisionImpl revision;
+ private InternalCDORevision revision;
public RevisionAdjuster(CDOIDProvider idProvider)
{
this.idProvider = idProvider;
}
- public void adjustRevision(CDORevisionImpl revision, CDORevisionDelta revisionDelta)
+ public void adjustRevision(InternalCDORevision revision, CDORevisionDelta revisionDelta)
{
this.revision = revision;
revisionDelta.accept(this);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/collection/MoveableArrayList.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/collection/MoveableArrayList.java
new file mode 100644
index 0000000..b17f949
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/collection/MoveableArrayList.java
@@ -0,0 +1,69 @@
+package org.eclipse.net4j.internal.util.collection;
+
+import org.eclipse.net4j.util.collection.MoveableList;
+
+import java.util.ArrayList;
+
+/**
+ * A list with O(1) effort for random access.
+ *
+ * @author Eike Stepper
+ */
+public final class MoveableArrayList<E> extends ArrayList<E> implements MoveableList<E>
+{
+ private static final long serialVersionUID = 1L;
+
+ public MoveableArrayList(int initialCapacity)
+ {
+ super(initialCapacity);
+
+ }
+
+ public E move(int targetIndex, int sourceIndex)
+ {
+ int size = size();
+ if (sourceIndex >= size)
+ {
+ throw new IndexOutOfBoundsException("sourceIndex=" + sourceIndex + ", size=" + size);
+ }
+
+ if (targetIndex >= size)
+ {
+ throw new IndexOutOfBoundsException("targetIndex=" + targetIndex + ", size=" + size);
+ }
+
+ E object = get(sourceIndex);
+ if (targetIndex == sourceIndex)
+ {
+ return object;
+ }
+
+ if (targetIndex < sourceIndex)
+ {
+ moveUp1(targetIndex, sourceIndex - targetIndex);
+ }
+ else
+ {
+ moveDown1(targetIndex, targetIndex - sourceIndex);
+ }
+
+ set(targetIndex, object);
+ return object;
+ }
+
+ private void moveUp1(int index, int count)
+ {
+ for (int i = count; i > 0; i--)
+ {
+ set(index + i, get(index + i - 1));
+ }
+ }
+
+ private void moveDown1(int index, int count)
+ {
+ for (int i = count; i > 0; i--)
+ {
+ set(index - i, get(index - i + 1));
+ }
+ }
+}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/MoveableList.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/MoveableList.java
new file mode 100644
index 0000000..35eed80
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/collection/MoveableList.java
@@ -0,0 +1,11 @@
+package org.eclipse.net4j.util.collection;
+
+import java.util.List;
+
+/**
+ * @author Eike Stepper
+ */
+public interface MoveableList<E> extends List<E>
+{
+ public E move(int targetIndex, int sourceIndex);
+}