summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-01-21 03:15:49 (EST)
committerEike Stepper2008-01-21 03:15:49 (EST)
commiteb5e2b64c44b9779ddb96c50d41f974bd1ea9b6d (patch)
tree95a2d0ccded712e604c337603fe71682ebfa46d7
parentac374ed1a0af94a25fc0971287e94f0d790c6558 (diff)
downloadcdo-eb5e2b64c44b9779ddb96c50d41f974bd1ea9b6d.zip
cdo-eb5e2b64c44b9779ddb96c50d41f974bd1ea9b6d.tar.gz
cdo-eb5e2b64c44b9779ddb96c50d41f974bd1ea9b6d.tar.bz2
[215911] RevisionManager should add revision when store support delta.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215911
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IClassMapping.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java8
-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.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ClassMapping.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java4
-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.java18
-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/MappingStrategy.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/ObjectIDIterator.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ReferenceMapping.java14
-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.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/NOOPStoreAccessor.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/RevisionManager.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/StoreAccessor.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/CommitTransactionIndication.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationNotification.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadChunkIndication.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/LoadRevisionIndication.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/QueryObjectTypesIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java4
-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/IStore.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreProvider.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreWriter.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java32
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java21
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/CommitTransactionRequest.java15
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/InvalidationIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadChunkRequest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/LoadRevisionRequest.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryObjectTypesRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/VerifyRevisionRequest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/RevisionAdjuster.java2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBConnectionProvider.java (renamed from plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ConnectionProvider.java)2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java4
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DataSourceConnectionProvider.java4
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java4
55 files changed, 247 insertions, 247 deletions
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 876d895..f550050 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,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.db;
-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.revision.CDORevision;
import org.eclipse.net4j.db.ddl.IDBTable;
@@ -40,13 +40,11 @@ public interface IClassMapping
public IReferenceMapping getReferenceMapping(CDOFeature feature);
- public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision);
+ public void writeRevision(IDBStoreWriter storeWriter, CDORevision revision);
- public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk);
+ public void readRevision(IDBStoreReader storeReader, CDORevision revision, int referenceChunk);
- public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
- int referenceChunk);
+ public void readRevisionByTime(IDBStoreReader storeReader, CDORevision revision, long timeStamp, int referenceChunk);
- public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
- int referenceChunk);
+ public void readRevisionByVersion(IDBStoreReader storeReader, CDORevision revision, int version, int referenceChunk);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
index 38a15f4..c72f6b3 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
@@ -12,8 +12,8 @@ package org.eclipse.emf.cdo.server.db;
import org.eclipse.emf.cdo.server.IStore;
-import org.eclipse.net4j.db.ConnectionProvider;
import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.ddl.IDBSchema;
/**
@@ -23,9 +23,9 @@ public interface IDBStore extends IStore
{
public IMappingStrategy getMappingStrategy();
- public IDBAdapter getDBAdapter();
+ public IDBSchema getDBSchema();
- public ConnectionProvider getConnectionProvider();
+ public IDBAdapter getDBAdapter();
- public IDBSchema getSchema();
+ public IDBConnectionProvider getDBConnectionProvider();
}
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 7ce7136..48578b3 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.InternalCDORevision;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
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, InternalCDORevision revision);
+ public void writeReference(IDBStoreWriter storeWriter, CDORevision revision);
- public void readReference(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk);
+ public void readReference(IDBStoreReader storeReader, CDORevision 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 c3fc6a8..0ec59e8 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
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
@@ -126,7 +126,7 @@ public abstract class AttributeMapping extends FeatureMapping implements IAttrib
return null;
}
- return CDOIDImpl.create(id);
+ return CDOIDUtil.create(id);
}
}
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 9dc8a49..326cf2d 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
@@ -10,12 +10,13 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.model.resource.CDOResourceClass;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
import org.eclipse.emf.cdo.server.db.IClassMapping;
import org.eclipse.emf.cdo.server.db.IDBStore;
@@ -196,7 +197,7 @@ public abstract class ClassMapping implements IClassMapping
try
{
- IDBTable table = mappingStrategy.getStore().getSchema().addTable(tableName);
+ IDBTable table = mappingStrategy.getStore().getDBSchema().addTable(tableName);
affectedTables.add(table);
return table;
}
@@ -436,21 +437,21 @@ public abstract class ClassMapping implements IClassMapping
protected abstract boolean hasFullRevisionInfo();
- public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
+ public void writeRevision(IDBStoreWriter storeWriter, CDORevision revision)
{
if (revision.getVersion() >= 2 && hasFullRevisionInfo())
{
- writeRevisedRow(storeWriter, revision);
+ writeRevisedRow(storeWriter, (InternalCDORevision)revision);
}
if (attributeMappings != null)
{
- writeAttributes(storeWriter, revision);
+ writeAttributes(storeWriter, (InternalCDORevision)revision);
}
if (referenceMappings != null)
{
- writeReferences(storeWriter, revision);
+ writeReferences(storeWriter, (InternalCDORevision)revision);
}
}
@@ -500,14 +501,13 @@ public abstract class ClassMapping implements IClassMapping
}
}
- public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
+ public void readRevision(IDBStoreReader storeReader, CDORevision revision, int referenceChunk)
{
String where = CDODBSchema.ATTRIBUTES_REVISED + "=0";
- readRevision(storeReader, revision, where, true, referenceChunk);
+ readRevision(storeReader, (InternalCDORevision)revision, where, true, referenceChunk);
}
- public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
- int referenceChunk)
+ public void readRevisionByTime(IDBStoreReader storeReader, CDORevision revision, long timeStamp, int referenceChunk)
{
StringBuilder where = new StringBuilder();
where.append("(");
@@ -520,14 +520,13 @@ public abstract class ClassMapping implements IClassMapping
where.append(timeStamp);
where.append(">=");
where.append(CDODBSchema.ATTRIBUTES_CREATED);
- readRevision(storeReader, revision, where.toString(), true, referenceChunk);
+ readRevision(storeReader, (InternalCDORevision)revision, where.toString(), true, referenceChunk);
}
- public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
- int referenceChunk)
+ public void readRevisionByVersion(IDBStoreReader storeReader, CDORevision revision, int version, int referenceChunk)
{
String where = CDODBSchema.ATTRIBUTES_VERSION + "=" + version;
- readRevision(storeReader, revision, where, false, referenceChunk);
+ readRevision(storeReader, (InternalCDORevision)revision, where, false, referenceChunk);
}
protected void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, String where,
@@ -557,7 +556,10 @@ public abstract class ClassMapping implements IClassMapping
}
String sql = builder.toString();
- if (TRACER.isEnabled()) TRACER.trace(sql);
+ if (TRACER.isEnabled())
+ {
+ TRACER.trace(sql);
+ }
ResultSet resultSet = null;
try
@@ -578,8 +580,8 @@ public abstract class ClassMapping implements IClassMapping
revision.setCreated(resultSet.getLong(i++));
revision.setRevised(resultSet.getLong(i++));
- revision.setResourceID(CDOIDImpl.create(resultSet.getLong(i++)));
- revision.setContainerID(CDOIDImpl.create(resultSet.getLong(i++)));
+ revision.setResourceID(CDOIDUtil.create(resultSet.getLong(i++)));
+ revision.setContainerID(CDOIDUtil.create(resultSet.getLong(i++)));
revision.setContainingFeatureID(resultSet.getInt(i++));
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index d742fdc..a62cd1a 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -21,11 +21,11 @@ import org.eclipse.emf.cdo.server.db.IDBStore;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
-import org.eclipse.net4j.db.ConnectionProvider;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBType;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.ddl.IDBSchema;
import org.eclipse.net4j.db.ddl.IDBTable;
import org.eclipse.net4j.internal.db.ddl.DBSchema;
@@ -45,11 +45,11 @@ public class DBStore extends Store implements IDBStore
private IMappingStrategy mappingStrategy;
- private IDBAdapter dbAdapter;
+ private IDBSchema dbSchema;
- private ConnectionProvider connectionProvider;
+ private IDBAdapter dbAdapter;
- private IDBSchema schema;
+ private IDBConnectionProvider dbConnectionProvider;
private int nextPackageID;
@@ -57,7 +57,7 @@ public class DBStore extends Store implements IDBStore
private int nextFeatureID;
- public DBStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, ConnectionProvider connectionProvider)
+ public DBStore(IMappingStrategy mappingStrategy, IDBAdapter dbAdapter, IDBConnectionProvider dbConnectionProvider)
{
super(TYPE);
if (dbAdapter == null)
@@ -65,14 +65,14 @@ public class DBStore extends Store implements IDBStore
throw new IllegalArgumentException("dbAdapter is null");
}
- if (connectionProvider == null)
+ if (dbConnectionProvider == null)
{
- throw new IllegalArgumentException("connectionProvider is null");
+ throw new IllegalArgumentException("dbConnectionProvider is null");
}
this.mappingStrategy = mappingStrategy;
this.dbAdapter = dbAdapter;
- this.connectionProvider = connectionProvider;
+ this.dbConnectionProvider = dbConnectionProvider;
}
public IMappingStrategy getMappingStrategy()
@@ -80,24 +80,25 @@ public class DBStore extends Store implements IDBStore
return mappingStrategy;
}
- public IDBAdapter getDBAdapter()
+ public synchronized IDBSchema getDBSchema()
{
- return dbAdapter;
+ // TODO Better synchronization or eager init
+ if (dbSchema == null)
+ {
+ dbSchema = createSchema();
+ }
+
+ return dbSchema;
}
- public ConnectionProvider getConnectionProvider()
+ public IDBAdapter getDBAdapter()
{
- return connectionProvider;
+ return dbAdapter;
}
- public IDBSchema getSchema()
+ public IDBConnectionProvider getDBConnectionProvider()
{
- if (schema == null)
- {
- schema = createSchema();
- }
-
- return schema;
+ return dbConnectionProvider;
}
@Override
@@ -122,18 +123,21 @@ public class DBStore extends Store implements IDBStore
return new DBStoreWriter(this, view);
}
- public int getNextPackageID()
+ public synchronized int getNextPackageID()
{
+ // TODO Better synchronization
return nextPackageID++;
}
- public int getNextClassID()
+ public synchronized int getNextClassID()
{
+ // TODO Better synchronization
return nextClassID++;
}
- public int getNextFeatureID()
+ public synchronized int getNextFeatureID()
{
+ // TODO Better synchronization
return nextFeatureID++;
}
@@ -154,10 +158,10 @@ public class DBStore extends Store implements IDBStore
protected void activateOrDeactivate(boolean started)
{
Repository repository = (Repository)getRepository();
- Connection connection = connectionProvider.getConnection();
+ Connection connection = dbConnectionProvider.getConnection();
if (connection == null)
{
- throw new DBException("No connection from connection provider: " + connectionProvider);
+ throw new DBException("No connection from connection provider: " + dbConnectionProvider);
}
try
@@ -179,7 +183,7 @@ public class DBStore extends Store implements IDBStore
protected void activateStore(Repository repository, Connection connection)
{
- Set<IDBTable> createdTables = CDODBSchema.INSTANCE.create(dbAdapter, connectionProvider);
+ Set<IDBTable> createdTables = CDODBSchema.INSTANCE.create(dbAdapter, dbConnectionProvider);
if (createdTables.contains(CDODBSchema.REPOSITORY))
{
// First start
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 48f39d7..afeefc1 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.server.StoreAccessor;
+import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.db.IClassMapping;
@@ -56,7 +56,7 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor
{
try
{
- connection = getStore().getConnectionProvider().getConnection();
+ connection = getStore().getDBConnectionProvider().getConnection();
connection.setAutoCommit(isReader());
}
catch (SQLException ex)
@@ -123,12 +123,12 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor
throw new IllegalArgumentException("Not a boolean value: " + value);
}
- protected Set<IDBTable> mapPackages(CDOPackageImpl... cdoPackages)
+ protected Set<IDBTable> mapPackages(CDOPackage... cdoPackages)
{
Set<IDBTable> affectedTables = new HashSet<IDBTable>();
if (cdoPackages != null && cdoPackages.length != 0)
{
- for (CDOPackageImpl cdoPackage : cdoPackages)
+ for (CDOPackage cdoPackage : cdoPackages)
{
Set<IDBTable> tables = mapClasses(cdoPackage.getClasses());
affectedTables.addAll(tables);
@@ -138,13 +138,13 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor
return affectedTables;
}
- protected Set<IDBTable> mapClasses(CDOClassImpl... cdoClasses)
+ protected Set<IDBTable> mapClasses(CDOClass... cdoClasses)
{
Set<IDBTable> affectedTables = new HashSet<IDBTable>();
if (cdoClasses != null && cdoClasses.length != 0)
{
IMappingStrategy mappingStrategy = getStore().getMappingStrategy();
- for (CDOClassImpl cdoClass : cdoClasses)
+ for (CDOClass cdoClass : cdoClasses)
{
IClassMapping mapping = mappingStrategy.getClassMapping(cdoClass);
if (mapping != null)
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
index d6644fb..db8550e 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreFactory.java
@@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.server.IStoreFactory;
import org.eclipse.emf.cdo.server.db.CDODBUtil;
import org.eclipse.emf.cdo.server.db.IMappingStrategy;
-import org.eclipse.net4j.db.ConnectionProvider;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
@@ -49,7 +49,7 @@ public class DBStoreFactory implements IStoreFactory
IMappingStrategy mappingStrategy = getMappingStrategy(storeConfig);
IDBAdapter dbAdapter = getDBAdapter(storeConfig);
DataSource dataSource = getDataSource(storeConfig);
- ConnectionProvider connectionProvider = DBUtil.createConnectionProvider(dataSource);
+ IDBConnectionProvider connectionProvider = DBUtil.createConnectionProvider(dataSource);
DBStore store = new DBStore(mappingStrategy, dbAdapter, connectionProvider);
mappingStrategy.setStore(store);
return store;
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 f1cad8a..9f21128 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
@@ -22,6 +22,7 @@ import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -90,15 +91,15 @@ public class DBStoreReader extends DBStoreAccessor implements IDBStoreReader
return result;
}
- public void readPackage(final CDOPackageImpl cdoPackage)
+ public void readPackage(final CDOPackage cdoPackage)
{
String where = CDODBSchema.PACKAGES_URI.getName() + " = '" + cdoPackage.getPackageURI() + "'";
Object[] values = DBUtil.select(getConnection(), where, CDODBSchema.PACKAGES_ID, CDODBSchema.PACKAGES_NAME,
CDODBSchema.PACKAGES_ECORE);
PackageServerInfo.setDBID(cdoPackage, (Integer)values[0]);
- cdoPackage.setName((String)values[1]);
- cdoPackage.setEcore((String)values[2]);
- readClasses(cdoPackage);
+ ((CDOPackageImpl)cdoPackage).setName((String)values[1]);
+ ((CDOPackageImpl)cdoPackage).setEcore((String)values[2]);
+ readClasses((CDOPackageImpl)cdoPackage);
mapPackages(cdoPackage);
}
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 4d935bb..99bdcfb 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,8 +14,10 @@ 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.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.db.IClassMapping;
import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
@@ -43,9 +45,9 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
super(store, view);
}
- public void writePackages(CDOPackageImpl... cdoPackages)
+ public void writePackages(CDOPackage... cdoPackages)
{
- for (CDOPackageImpl cdoPackage : cdoPackages)
+ for (CDOPackage cdoPackage : cdoPackages)
{
writePackage(cdoPackage);
}
@@ -54,7 +56,7 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
getStore().getDBAdapter().createTables(affectedTables, getConnection());
}
- protected void writePackage(CDOPackageImpl cdoPackage)
+ protected void writePackage(CDOPackage cdoPackage)
{
int id = getStore().getNextPackageID();
PackageServerInfo.setDBID(cdoPackage, id);
@@ -105,9 +107,9 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
DBUtil.close(pstmt);
}
- for (CDOClassImpl cdoClass : cdoPackage.getClasses())
+ for (CDOClass cdoClass : cdoPackage.getClasses())
{
- writeClass(cdoClass);
+ writeClass((CDOClassImpl)cdoClass);
}
}
@@ -162,14 +164,14 @@ public class DBStoreWriter extends DBStoreReader implements IDBStoreWriter
type, packageURI, classifierID, many, containment, idx);
}
- public void writeRevision(InternalCDORevision revision)
+ public void writeRevision(CDORevision revision)
{
if (TRACER.isEnabled())
{
TRACER.format("Inserting revision: {0}", revision);
}
- CDOClassImpl cdoClass = (CDOClassImpl)revision.getCDOClass();
+ CDOClass cdoClass = 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 d0afc74..00f2a41 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,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-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.revision.CDORevision;
import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
/**
@@ -32,7 +32,7 @@ public class HorizontalClassMapping extends ClassMapping
}
@Override
- public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
+ public void writeRevision(IDBStoreWriter storeWriter, CDORevision 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/MappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
index 3c9943d..02eb156 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/MappingStrategy.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.model.resource.CDOPathFeature;
@@ -347,7 +347,7 @@ public abstract class MappingStrategy extends Lifecycle implements IMappingStrat
}
long id = resultSet.getLong(1);
- return CDOIDImpl.create(id);
+ return CDOIDUtil.create(id);
}
catch (SQLException ex)
{
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 b370dbe..f4b18fd 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,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-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.revision.CDORevision;
import org.eclipse.emf.cdo.server.db.IAttributeMapping;
import org.eclipse.emf.cdo.server.db.IClassMapping;
import org.eclipse.emf.cdo.server.db.IDBStoreReader;
@@ -77,20 +77,20 @@ public class NoClassMapping implements IClassMapping
return null;
}
- public void writeRevision(IDBStoreWriter storeWriter, InternalCDORevision revision)
+ public void writeRevision(IDBStoreWriter storeWriter, CDORevision revision)
{
}
- public void readRevision(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
+ public void readRevision(IDBStoreReader storeReader, CDORevision revision, int referenceChunk)
{
}
- public void readRevisionByTime(IDBStoreReader storeReader, InternalCDORevision revision, long timeStamp,
+ public void readRevisionByTime(IDBStoreReader storeReader, CDORevision revision, long timeStamp,
int referenceChunk)
{
}
- public void readRevisionByVersion(IDBStoreReader storeReader, InternalCDORevision revision, int version,
+ public void readRevisionByVersion(IDBStoreReader storeReader, CDORevision revision, int version,
int referenceChunk)
{
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectIDIterator.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectIDIterator.java
index d4cb7d0..75bba78 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectIDIterator.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectIDIterator.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.server.db.IDBStoreReader;
@@ -92,11 +92,11 @@ public abstract class ObjectIDIterator implements CloseableIterator<CDOID>
{
int classID = currentResultSet.getInt(2);
CDOClassRef type = mappingStrategy.getClassRef(storeReader, classID);
- nextID = CDOIDImpl.create(id, type);
+ nextID = CDOIDUtil.create(id, type);
}
else
{
- nextID = CDOIDImpl.create(id);
+ nextID = CDOIDUtil.create(id);
}
return true;
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
index 2c28989..2e7974b 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/ObjectTypeCache.java
@@ -136,7 +136,7 @@ public class ObjectTypeCache extends Lifecycle implements IObjectTypeCache
{
if (table == null)
{
- IDBSchema schema = mappingStrategy.getStore().getSchema();
+ IDBSchema schema = mappingStrategy.getStore().getDBSchema();
table = schema.addTable(CDODBSchema.CDO_OBJECTS);
idField = table.addField(CDODBSchema.ATTRIBUTES_ID, DBType.BIGINT);
typeField = table.addField(CDODBSchema.ATTRIBUTES_CLASS, DBType.INTEGER);
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 a2679de..2baf411 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
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
@@ -73,13 +73,13 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
return table;
}
- public void writeReference(IDBStoreWriter storeWriter, InternalCDORevision revision)
+ public void writeReference(IDBStoreWriter storeWriter, CDORevision revision)
{
long source = revision.getID().getValue();
int version = revision.getVersion();
int idx = 0;
- for (Object element : revision.getList(getFeature()))
+ for (Object element : ((InternalCDORevision)revision).getList(getFeature()))
{
long target = ((CDOID)element).getValue();
StringBuilder builder = new StringBuilder(insertPrefix);
@@ -96,9 +96,9 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
}
}
- public void readReference(IDBStoreReader storeReader, InternalCDORevision revision, int referenceChunk)
+ public void readReference(IDBStoreReader storeReader, CDORevision revision, int referenceChunk)
{
- MoveableList<Object> list = revision.getList(getFeature());
+ MoveableList<Object> list = ((InternalCDORevision)revision).getList(getFeature());
CDOID source = revision.getID();
int version = revision.getVersion();
@@ -115,7 +115,7 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
while (resultSet.next() && (referenceChunk == CDORevision.UNCHUNKED || --referenceChunk >= 0))
{
long target = resultSet.getLong(1);
- list.add(CDOIDImpl.create(target));
+ list.add(CDOIDUtil.create(target));
}
// TODO Optimize this?
@@ -164,7 +164,7 @@ public class ReferenceMapping extends FeatureMapping implements IReferenceMappin
chunkSize = chunk.size();
}
- chunk.addID(indexInChunk++, CDOIDImpl.create(target));
+ chunk.addID(indexInChunk++, CDOIDUtil.create(target));
if (indexInChunk == chunkSize)
{
chunk = null;
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 f4aa2b2..df012fd 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,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server.internal.db;
-import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
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, InternalCDORevision revision)
+ public void writeRevision(IDBStoreWriter storeWriter, CDORevision 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 707baec..15b9e13 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
@@ -11,15 +11,15 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
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.CDOPackage;
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.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreChunkReader;
import org.eclipse.emf.cdo.server.IStoreReader;
@@ -66,7 +66,7 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
return Collections.emptySet();
}
- public void readPackage(CDOPackageImpl cdoPackage)
+ public void readPackage(CDOPackage cdoPackage)
{
throw new UnsupportedOperationException();
}
@@ -128,17 +128,17 @@ public class MEMStoreAccessor extends StoreAccessor implements IStoreReader, ISt
throw new UnsupportedOperationException();
}
- public void writePackages(CDOPackageImpl... cdoPackages)
+ public void writePackages(CDOPackage... cdoPackages)
{
}
- public void writeRevision(InternalCDORevision revision)
+ public void writeRevision(CDORevision revision)
{
newRevisions.add(revision);
}
@Override
- public void writeRevisionDelta(CDORevisionDeltaImpl delta)
+ public void writeRevisionDelta(CDORevisionDelta delta)
{
InternalCDORevision revision = (InternalCDORevision)getStore().getRevision(delta.getID());
InternalCDORevision newRevision = (InternalCDORevision)CDORevisionUtil.copy(revision);
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 78d779f..a25e3db 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
@@ -10,11 +10,10 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-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;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.ISession;
@@ -59,7 +58,7 @@ public class NOOPStoreAccessor extends StoreAccessor implements IStoreReader, IS
return Collections.emptySet();
}
- public void readPackage(CDOPackageImpl cdoPackage)
+ public void readPackage(CDOPackage cdoPackage)
{
throw new UnsupportedOperationException();
}
@@ -99,11 +98,11 @@ public class NOOPStoreAccessor extends StoreAccessor implements IStoreReader, IS
throw new UnsupportedOperationException();
}
- public void writePackages(CDOPackageImpl... cdoPackages)
+ public void writePackages(CDOPackage... cdoPackages)
{
}
- public void writeRevision(InternalCDORevision revision)
+ public void writeRevision(CDORevision 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 94c5113..9f2a6e9 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
@@ -304,7 +304,7 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
{
private CDORevisionDeltaImpl revisionDelta;
- private InternalCDORevision dirtyRevision = null;
+ private InternalCDORevision dirtyRevision;
private AddRevisionDeltaOperation(CDORevisionDeltaImpl revisionDelta)
{
@@ -313,23 +313,28 @@ public class RevisionManager extends CDORevisionResolverImpl implements IRevisio
public void phase1(IStoreWriter storeWriter) throws Exception
{
- if (getRepository().isSupportingRevisionDeltas())
+ boolean supportDelta = getRepository().isSupportingRevisionDeltas();
+ InternalCDORevision originRevision = getRevisionByVersion(revisionDelta.getID(), CDORevision.UNCHUNKED,
+ revisionDelta.getOriginVersion(), !supportDelta);
+
+ if (originRevision != null)
+ {
+ dirtyRevision = (InternalCDORevision)CDORevisionUtil.copy(originRevision);
+ revisionDelta.apply(dirtyRevision);
+ }
+ else if (!supportDelta)
+ {
+ // Origin revision need to be accessible for stores that do not support deltas
+ throw new IllegalStateException("Can not retrieve origin revision");
+ }
+
+ if (supportDelta)
{
// Can throw an exception if duplicate
storeWriter.writeRevisionDelta(revisionDelta);
}
else
{
- InternalCDORevision oldRevision = getRevisionByVersion(revisionDelta.getID(), CDORevision.UNCHUNKED,
- revisionDelta.getOriginVersion(), true);
- if (oldRevision == null)
- {
- throw new IllegalStateException("Can not retrieve origin revision");
- }
-
- dirtyRevision = (InternalCDORevision)CDORevisionUtil.copy(oldRevision);
- revisionDelta.apply(dirtyRevision);
-
// Can throw an exception if duplicate
storeWriter.writeRevision(dirtyRevision);
}
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 1cbbe21..6670e1a 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
@@ -11,15 +11,15 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-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.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;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDProvider;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -179,7 +179,7 @@ public class Session extends Container<IView> implements ISession, CDOIDProvider
}
CDOClassRef type = getObjectTypeRef(id);
- return CDOIDImpl.create(id.getValue(), type);
+ return CDOIDUtil.create(id.getValue(), type);
}
public CDOClassRef getObjectTypeRef(CDOID id)
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
index 444236b..f6c3e1e 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IStore;
@@ -52,7 +52,7 @@ public abstract class Store extends Lifecycle implements IStore
public CDOID getNextCDOID()
{
- CDOID id = CDOIDImpl.create(nextOIDValue);
+ CDOID id = CDOIDUtil.create(nextOIDValue);
++nextOIDValue;
++nextOIDValue;
return id;
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 bcd46b2..589a769 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
@@ -12,10 +12,10 @@
package org.eclipse.emf.cdo.internal.server;
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.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.server.IStoreAccessor;
import org.eclipse.emf.cdo.server.IView;
@@ -92,7 +92,7 @@ public class StoreAccessor implements IStoreAccessor
return store.getNextCDOID();
}
- public void writeRevisionDelta(CDORevisionDeltaImpl delta)
+ public void writeRevisionDelta(CDORevisionDelta delta)
{
throw new UnsupportedOperationException();
}
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 a281b2b..0c1251a 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
@@ -11,7 +11,6 @@
**************************************************************************/
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.InternalCDORevision;
@@ -24,6 +23,7 @@ import org.eclipse.emf.cdo.internal.server.View;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackageManager;
@@ -320,12 +320,12 @@ public class CommitTransactionIndication extends CDOServerIndication
if (!oldID.isMeta())
{
CDOID newID = entry.getValue();
- CDOIDImpl.write(out, oldID);
- CDOIDImpl.write(out, newID);
+ CDOIDUtil.write(out, oldID);
+ CDOIDUtil.write(out, newID);
}
}
- CDOIDImpl.write(out, CDOID.NULL);
+ CDOIDUtil.write(out, CDOID.NULL);
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationNotification.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationNotification.java
index e566609..68af019 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationNotification.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/InvalidationNotification.java
@@ -11,9 +11,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.channel.IChannel;
@@ -66,7 +66,7 @@ public class InvalidationNotification extends Request
out.writeInt(size);
for (int i = 0; i < dirtyIDs.length; i++)
{
- CDOIDImpl.write(out, dirtyIDs[i]);
+ CDOIDUtil.write(out, dirtyIDs[i]);
}
}
}
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 33373d8..3440cc1 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
@@ -11,12 +11,12 @@
**************************************************************************/
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.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;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -59,7 +59,7 @@ public class LoadChunkIndication extends CDOReadIndication
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
- id = CDOIDImpl.read(in);
+ id = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Read revision ID: {0}", id);
@@ -103,7 +103,7 @@ public class LoadChunkIndication extends CDOReadIndication
MoveableList<Object> list = revision.getList(feature);
for (int i = fromIndex; i <= toIndex; i++)
{
- CDOIDImpl.write(out, session.provideCDOID(list.get(i)));
+ CDOIDUtil.write(out, session.provideCDOID(list.get(i)));
}
}
}
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 19b336d..cb863c4 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
@@ -10,12 +10,12 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
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;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
@@ -79,7 +79,7 @@ public class LoadRevisionIndication extends CDOReadIndication
ids = new CDOID[size];
for (int i = 0; i < size; i++)
{
- CDOID id = CDOIDImpl.read(in);
+ CDOID id = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Read ID: {0}", id);
@@ -97,7 +97,7 @@ public class LoadRevisionIndication extends CDOReadIndication
loadRevisionCollectionChunkSize = 1;
}
- contextID = CDOIDImpl.read(in);
+ contextID = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Reading fetch rules for context {0}", contextID);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/QueryObjectTypesIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/QueryObjectTypesIndication.java
index ddc47ad..7fd24b1 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/QueryObjectTypesIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/QueryObjectTypesIndication.java
@@ -10,10 +10,10 @@
**************************************************************************/
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.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -54,7 +54,7 @@ public class QueryObjectTypesIndication extends CDOReadIndication
ids = new CDOID[size];
for (int i = 0; i < ids.length; i++)
{
- ids[i] = CDOIDImpl.read(in);
+ ids[i] = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Read ID: {0}", ids[i]);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
index a793ef7..c068fad 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourceIDIndication.java
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -61,6 +61,6 @@ public class ResourceIDIndication extends CDOReadIndication
PROTOCOL.format("Writing ID: {0}", id);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
index 2aaafa9..20df6e4 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/protocol/ResourcePathIndication.java
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -43,7 +43,7 @@ public class ResourcePathIndication extends CDOReadIndication
@Override
protected void indicating(ExtendedDataInputStream in) throws IOException
{
- final CDOID id = CDOIDImpl.read(in);
+ final CDOID id = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Read ID: {0}", id);
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 e89e2e3..49c4543 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
@@ -10,11 +10,11 @@
**************************************************************************/
package org.eclipse.emf.cdo.internal.server.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
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;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
@@ -52,7 +52,7 @@ public class VerifyRevisionIndication extends CDOReadIndication
timeStamps = new long[size];
for (int i = 0; i < size; i++)
{
- CDOID id = CDOIDImpl.read(in);
+ CDOID id = CDOIDUtil.read(in);
int version = in.readInt();
if (PROTOCOL.isEnabled()) PROTOCOL.format("Read ID and version: {0}v{1}", id, version);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
index caaccba..e3598cf 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
@@ -10,6 +10,8 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
+
/**
* @author Eike Stepper
*/
@@ -23,7 +25,7 @@ public interface IStore extends IRepositoryElement
* Returns if this store supports the writing of modified newRevisions in terms of deltas.
* <p>
* The contract includes that store implementations with write delta support must also implement
- * {@link IStoreWriter#writeRevisionDelta(org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl) IStoreWriter.writeRevisionDelta(CDORevisionDeltaImpl)}
+ * {@link IStoreWriter#writeRevisionDelta(CDORevisionDelta) IStoreWriter.writeRevisionDelta(CDORevisionDeltaImpl)}
* to not throw an <code>UnsupportedOperationException</code>.
*
* @return <code>true</code> if this store supports the writing of modified newRevisions in terms of deltas,
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreProvider.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreProvider.java
deleted file mode 100644
index 30d3f45..0000000
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreProvider.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2008 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.emf.cdo.server;
-
-/**
- * @author Eike Stepper
- */
-@Deprecated
-public interface IStoreProvider
-{
- public IStore getStore(String repositoryName);
-}
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 0494775..6822725 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
@@ -10,11 +10,11 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
-import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.server.StoreUtil;
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.CDOPackage;
import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -37,7 +37,7 @@ public interface IStoreReader extends IStoreAccessor
/**
* Demand loads a given package proxy that has been created on startup of the repository.
*/
- public void readPackage(CDOPackageImpl cdoPackage);
+ public void readPackage(CDOPackage cdoPackage);
/**
* Returns an iterator that iterates over all objects in the store and makes their ids available for processing. This
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 ef9cc19..cb8c9e0 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
@@ -11,15 +11,13 @@
**************************************************************************/
package org.eclipse.emf.cdo.server;
-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.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.model.CDOFeature;
+import org.eclipse.emf.cdo.protocol.model.CDOPackage;
+import org.eclipse.emf.cdo.protocol.revision.CDORevision;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
/**
* @author Eike Stepper
@@ -35,20 +33,23 @@ public interface IStoreWriter extends IStoreReader
* <b>Note:</b> The implementor of this method must not assume that references to classes in this package or in any
* other package are already resolved or are resolveable at the point in time when this method is called by the
* framework. References to classes frequently appear in {@link CDOClass#getSuperTypes()} and in
- * {@link CDOFeature#getReferenceType()}. Instead {@link CDOClassImpl#getSuperTypeProxies()} and
- * {@link CDOFeatureImpl#getReferenceTypeProxy()} should be used.
+ * {@link CDOFeature#getReferenceType()}. Instead
+ * {@link org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl#getSuperTypeProxies() CDOClassImpl.getSuperTypeProxies()}
+ * and
+ * {@link org.eclipse.emf.cdo.internal.protocol.model.CDOFeatureImpl#getReferenceTypeProxy() CDOFeatureImpl.getReferenceTypeProxy()}
+ * should be used.
* <p>
*
* @see CDOClassProxy#getPackageURI()
* @see CDOClassProxy#getClassifierID()
*/
- public void writePackages(CDOPackageImpl... cdoPackages);
+ public void writePackages(CDOPackage... cdoPackages);
public CDOID primeNewObject(CDOClass cdoClass);
- public void writeRevision(InternalCDORevision revision);
+ public void writeRevision(CDORevision revision);
- public void writeRevisionDelta(CDORevisionDeltaImpl delta);
+ public void writeRevisionDelta(CDORevisionDelta delta);
public void commit();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
index 3b14cfa..918baaf 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionHolderTest.java
@@ -10,11 +10,12 @@
**************************************************************************/
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.DLRevisionHolder;
import org.eclipse.emf.cdo.internal.protocol.revision.LRURevisionHolder;
import org.eclipse.emf.cdo.internal.protocol.revision.LRURevisionList;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDProvider;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionData;
@@ -22,7 +23,9 @@ import org.eclipse.emf.cdo.protocol.revision.CDORevisionResolver;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.net4j.tests.AbstractOMTest;
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
@@ -189,17 +192,7 @@ public class RevisionHolderTest extends AbstractOMTest
public RevisionStub(long id)
{
- this.id = CDOIDImpl.create(id);
- }
-
- public CDORevisionDelta compare(CDORevision origin)
- {
- return null;
- }
-
- public void merge(CDORevisionDelta delta)
- {
- throw new UnsupportedOperationException();
+ this.id = CDOIDUtil.create(id);
}
public CDOClass getCDOClass()
@@ -256,5 +249,20 @@ public class RevisionHolderTest extends AbstractOMTest
{
return false;
}
+
+ public CDORevisionDelta compare(CDORevision origin)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void merge(CDORevisionDelta delta)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void write(ExtendedDataOutput out, CDOIDProvider idProvider, int referenceChunk) throws IOException
+ {
+ throw new UnsupportedOperationException();
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
index c2cb137..c208859 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOUtil.java
@@ -14,8 +14,8 @@ import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOView;
import org.eclipse.emf.cdo.eresource.CDOResourceFactory;
import org.eclipse.emf.cdo.eresource.EresourcePackage;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.internal.cdo.CDOSessionFactory;
@@ -239,7 +239,7 @@ public final class CDOUtil
try
{
String path = uri.path();
- return CDOIDImpl.parse(path);
+ return CDOIDUtil.parse(path);
}
catch (RuntimeException ex)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
index 2e4fca9..c251c7a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionImpl.java
@@ -13,12 +13,12 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.CDOSession;
import org.eclipse.emf.cdo.CDOSessionInvalidationEvent;
import org.eclipse.emf.cdo.CDOView;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.CDOIDRangeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -407,7 +407,7 @@ public class CDOSessionImpl extends Container<CDOView> implements CDOSession
*/
private long registerMetaInstance(InternalEObject metaInstance, long idValue)
{
- CDOID id = CDOIDImpl.create(idValue);
+ CDOID id = CDOIDUtil.create(idValue);
if (TRACER.isEnabled())
{
TRACER.format("Registering meta instance: {0} <-> {1}", id, metaInstance);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
index 5dd3863..35e13a9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOTransactionImpl.java
@@ -19,13 +19,14 @@ import org.eclipse.emf.cdo.CDOTransactionHandler;
import org.eclipse.emf.cdo.CDOTransactionStartedEvent;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
-import org.eclipse.emf.cdo.internal.protocol.revision.delta.CDORevisionDeltaImpl;
+import org.eclipse.emf.cdo.internal.protocol.revision.delta.InternalCDORevisionDelta;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOFeatureDelta;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
+import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDeltaUtil;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.bundle.OM;
@@ -154,27 +155,27 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
public List<CDOPackage> getNewPackages()
{
- return newPackages;
+ return Collections.unmodifiableList(newPackages);
}
public Map<CDOID, CDOResource> getNewResources()
{
- return newResources;
+ return Collections.unmodifiableMap(newResources);
}
public Map<CDOID, CDOObject> getNewObjects()
{
- return newObjects;
+ return Collections.unmodifiableMap(newObjects);
}
public Map<CDOID, CDOObject> getDirtyObjects()
{
- return dirtyObjects;
+ return Collections.unmodifiableMap(dirtyObjects);
}
public Map<CDOID, CDORevisionDelta> getRevisionDeltas()
{
- return revisionDeltas;
+ return Collections.unmodifiableMap(revisionDeltas);
}
public CDOID getNextTemporaryID()
@@ -182,7 +183,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
long id = nextTemporaryID;
--nextTemporaryID;
--nextTemporaryID;
- return CDOIDImpl.create(id);
+ return CDOIDUtil.create(id);
}
public CDOResource createResource(String path)
@@ -326,10 +327,10 @@ public class CDOTransactionImpl extends CDOViewImpl implements CDOTransaction
public void registerFeatureDelta(InternalCDOObject object, CDOFeatureDelta featureDelta)
{
- CDORevisionDeltaImpl revisionDelta = (CDORevisionDeltaImpl)revisionDeltas.get(object.cdoID());
+ InternalCDORevisionDelta revisionDelta = (InternalCDORevisionDelta)revisionDeltas.get(object.cdoID());
if (revisionDelta == null)
{
- revisionDelta = new CDORevisionDeltaImpl(object.cdoRevision());
+ revisionDelta = (InternalCDORevisionDelta)CDORevisionDeltaUtil.create(object.cdoRevision());
revisionDeltas.put(object.cdoID(), revisionDelta);
}
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 c58bdde..92f83a0 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
@@ -24,9 +24,9 @@ import org.eclipse.emf.cdo.eresource.CDOResource;
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.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDProvider;
import org.eclipse.emf.cdo.protocol.CDOIDTyped;
import org.eclipse.emf.cdo.protocol.model.CDOClass;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
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 53cd39e..7188dd5 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
@@ -13,20 +13,18 @@ package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.CDOObject;
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.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;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOPackage;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.protocol.revision.delta.CDORevisionDelta;
import org.eclipse.emf.internal.cdo.CDOTransactionImpl;
-import org.eclipse.emf.internal.cdo.InternalCDOObject;
import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.util.RevisionAdjuster;
@@ -102,13 +100,13 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
for (;;)
{
- CDOID oldID = CDOIDImpl.read(in);
+ CDOID oldID = CDOIDUtil.read(in);
if (oldID.isNull())
{
break;
}
- CDOID newID = CDOIDImpl.read(in);
+ CDOID newID = CDOIDUtil.read(in);
result.addIDMapping(oldID, newID);
}
@@ -176,8 +174,7 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
out.writeInt(revisionDeltas.size());
for (CDORevisionDelta revisionDelta : revisionDeltas)
{
- ((CDORevisionDeltaImpl)revisionDelta).write(out, transaction);
- // InternalCDORevision revision = transaction.getRevision(revisionDelta.getID());
+ revisionDelta.write(out, transaction);
CDOObject object = transaction.getDirtyObjects().get(revisionDelta.getID());
InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
revisionAdjuster.adjustRevision(revision, revisionDelta);
@@ -189,8 +186,8 @@ public class CommitTransactionRequest extends CDOClientRequest<CommitTransaction
out.writeInt(objects.size());
for (Iterator<?> it = objects.iterator(); it.hasNext();)
{
- InternalCDOObject object = (InternalCDOObject)it.next();
- InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
+ CDOObject object = (CDOObject)it.next();
+ CDORevision revision = object.cdoRevision();
revision.write(out, transaction, CDORevision.UNCHUNKED);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/InvalidationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/InvalidationIndication.java
index cd7cb844..b83a6be 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/InvalidationIndication.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/InvalidationIndication.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.internal.cdo.CDOSessionImpl;
@@ -60,7 +60,7 @@ public class InvalidationIndication extends Indication
Set<CDOID> dirtyOIDs = new HashSet<CDOID>();
for (int i = 0; i < size; i++)
{
- CDOID dirtyOID = CDOIDImpl.read(in);
+ CDOID dirtyOID = CDOIDUtil.read(in);
dirtyOIDs.add(dirtyOID);
}
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 803485c..f6aed66 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
@@ -10,10 +10,10 @@
**************************************************************************/
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.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
@@ -69,7 +69,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
{
PROTOCOL.format("Writing revision ID: {0}", id);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
int version = revision.getVersion();
if (revision.isTransactional())
@@ -111,7 +111,7 @@ public class LoadChunkRequest extends CDOClientRequest<CDOID>
MoveableList<Object> list = revision.getList(feature);
for (int i = fromIndex; i <= toIndex; i++)
{
- CDOID id = CDOIDImpl.read(in);
+ CDOID id = CDOIDUtil.read(in);
list.set(i, id);
if (i == accessIndex)
{
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 43318ea..39b2768 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
@@ -11,9 +11,9 @@
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.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.analyzer.CDOFetchRule;
import org.eclipse.emf.cdo.protocol.revision.CDORevisionUtil;
@@ -85,7 +85,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi
{
PROTOCOL.format("Writing ID: {0}", id);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
}
CDOFetchRuleManager ruleManager = getSession().getRevisionManager().getRuleManager();
@@ -102,7 +102,7 @@ public class LoadRevisionRequest extends CDOClientRequest<List<InternalCDORevisi
out.writeInt(fetchSize);
out.writeInt(ruleManager.getLoadRevisionCollectionChunkSize());
- CDOIDImpl.write(out, contextID);
+ CDOIDUtil.write(out, contextID);
for (CDOFetchRule fetchRule : fetchRules)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryObjectTypesRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryObjectTypesRequest.java
index 7130c14..fcb6111 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryObjectTypesRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/QueryObjectTypesRequest.java
@@ -10,9 +10,9 @@
**************************************************************************/
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.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
@@ -63,7 +63,7 @@ public class QueryObjectTypesRequest extends CDOClientRequest<CDOClassRef[]>
PROTOCOL.format("Writing ID: {0}", id);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
index a30da06..145f9c1 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourceIDRequest.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.internal.cdo.bundle.OM;
@@ -59,7 +59,7 @@ public class ResourceIDRequest extends CDOClientRequest<CDOID>
@Override
protected CDOID confirming(ExtendedDataInputStream in) throws IOException
{
- CDOID id = CDOIDImpl.read(in);
+ CDOID id = CDOIDUtil.read(in);
if (PROTOCOL.isEnabled())
{
PROTOCOL.format("Read ID: {0}", id);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
index 38df1f4..0481ac9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/ResourcePathRequest.java
@@ -10,8 +10,8 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.internal.cdo.bundle.OM;
@@ -52,7 +52,7 @@ public class ResourcePathRequest extends CDOClientRequest<String>
PROTOCOL.format("Writing ID: {0}", id);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
}
@Override
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 2fe0d8e..6e1e191 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
@@ -10,9 +10,9 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo.protocol;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.internal.protocol.revision.InternalCDORevision;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
@@ -73,7 +73,7 @@ public class VerifyRevisionRequest extends CDOClientRequest<List<InternalCDORevi
PROTOCOL.format("Writing ID and version: {0}v{1}", id, version);
}
- CDOIDImpl.write(out, id);
+ CDOIDUtil.write(out, id);
out.writeInt(version);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
index 1d7d655..4ed1015 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
@@ -11,8 +11,8 @@
package org.eclipse.emf.internal.cdo.util;
import org.eclipse.emf.cdo.CDOState;
-import org.eclipse.emf.cdo.internal.protocol.CDOIDImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
+import org.eclipse.emf.cdo.protocol.CDOIDUtil;
import org.eclipse.emf.internal.cdo.CDOAdapterImpl;
import org.eclipse.emf.internal.cdo.CDOViewImpl;
@@ -58,7 +58,7 @@ final class ProxyResolverResource implements Resource
*/
public EObject getEObject(String uriFragment)
{
- CDOID id = CDOIDImpl.create(Long.parseLong(uriFragment));
+ CDOID id = CDOIDUtil.create(Long.parseLong(uriFragment));
InternalCDOObject object = view.getObject(id);
InternalEObject instance = object.cdoInternalInstance();
if (instance instanceof CDOAdapterImpl)
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 cb50207..591c824 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
@@ -11,10 +11,10 @@
package org.eclipse.emf.internal.cdo.util;
-import org.eclipse.emf.cdo.internal.protocol.revision.CDOIDProvider;
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.CDOIDProvider;
import org.eclipse.emf.cdo.protocol.model.CDOFeature;
import org.eclipse.emf.cdo.protocol.revision.CDOReferenceProxy;
import org.eclipse.emf.cdo.protocol.revision.delta.CDOAddFeatureDelta;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
index e9c2660..97180bd 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/DBUtil.java
@@ -67,7 +67,7 @@ public final class DBUtil
}
}
- public static ConnectionProvider createConnectionProvider(DataSource dataSource)
+ public static IDBConnectionProvider createConnectionProvider(DataSource dataSource)
{
return new DataSourceConnectionProvider(dataSource);
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ConnectionProvider.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBConnectionProvider.java
index af466c2..3a44d63 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ConnectionProvider.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/IDBConnectionProvider.java
@@ -15,7 +15,7 @@ import java.sql.Connection;
/**
* @author Eike Stepper
*/
-public interface ConnectionProvider
+public interface IDBConnectionProvider
{
public Connection getConnection() throws DBException;
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java
index 6451d63..0ca1654 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/db/ddl/IDBSchema.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.db.ddl;
-import org.eclipse.net4j.db.ConnectionProvider;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.IDBAdapter;
@@ -32,7 +32,7 @@ public interface IDBSchema extends IDBSchemaElement
public Set<IDBTable> create(IDBAdapter dbAdapter, Connection connection) throws DBException;
- public Set<IDBTable> create(IDBAdapter dbAdapter, ConnectionProvider connectionProvider) throws DBException;
+ public Set<IDBTable> create(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider) throws DBException;
public Set<IDBTable> create(IDBAdapter dbAdapter, DataSource dataSource) throws DBException;
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DataSourceConnectionProvider.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DataSourceConnectionProvider.java
index 87e4703..bc393e9 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DataSourceConnectionProvider.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/DataSourceConnectionProvider.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.internal.db;
-import org.eclipse.net4j.db.ConnectionProvider;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.DBException;
import javax.sql.DataSource;
@@ -21,7 +21,7 @@ import java.sql.SQLException;
/**
* @author Eike Stepper
*/
-public class DataSourceConnectionProvider implements ConnectionProvider
+public class DataSourceConnectionProvider implements IDBConnectionProvider
{
private DataSource dataSource;
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java
index ec80442..b9ca8ae 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBSchema.java
@@ -10,7 +10,7 @@
**************************************************************************/
package org.eclipse.net4j.internal.db.ddl;
-import org.eclipse.net4j.db.ConnectionProvider;
+import org.eclipse.net4j.db.IDBConnectionProvider;
import org.eclipse.net4j.db.DBException;
import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBAdapter;
@@ -93,7 +93,7 @@ public class DBSchema extends DBSchemaElement implements IDBSchema
return dbAdapter.createTables(tables.values(), connection);
}
- public Set<IDBTable> create(IDBAdapter dbAdapter, ConnectionProvider connectionProvider) throws DBException
+ public Set<IDBTable> create(IDBAdapter dbAdapter, IDBConnectionProvider connectionProvider) throws DBException
{
Connection connection = null;