summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-01-19 07:10:26 (EST)
committerCaspar De Groot2010-01-19 07:10:26 (EST)
commitf5c18c3379ffdfef29374576b024a46cac572a2e (patch)
treefba38f2d8bd762c81c5bb27812ef4b08ffd0f605
parent45815eafa95929ffd8fa28060534aa30de9f5e5f (diff)
downloadcdo-f5c18c3379ffdfef29374576b024a46cac572a2e.zip
cdo-f5c18c3379ffdfef29374576b024a46cac572a2e.tar.gz
cdo-f5c18c3379ffdfef29374576b024a46cac572a2e.tar.bz2
[270716] Provide support for branching
https://bugs.eclipse.org/bugs/show_bug.cgi?id=270716
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/AbstractSyncRevisionsRequest.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SetPassiveUpdateRequest.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SyncRevisionsRequest.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java24
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java22
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java9
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java4
12 files changed, 90 insertions, 61 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
index bb0da51..82ac774 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.id.CDOID.Type;
import org.eclipse.emf.cdo.common.model.CDOClassifierRef;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndBranchImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionAndBranchImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDAndVersionImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDMetaImpl;
@@ -361,6 +362,14 @@ public final class CDOIDUtil
}
/**
+ * @since 3.0
+ */
+ public static CDOIDAndVersionAndBranch createIDAndVersionAndBranch(CDOID id, int version, int branchID)
+ {
+ return new CDOIDAndVersionAndBranchImpl(id, version, branchID);
+ }
+
+ /**
* @since 2.0
*/
public static boolean equals(CDOID id1, CDOID id2)
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/AbstractSyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/AbstractSyncRevisionsRequest.java
index 9cc4659..8eee5e3 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/AbstractSyncRevisionsRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/AbstractSyncRevisionsRequest.java
@@ -14,7 +14,7 @@ package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
-import org.eclipse.emf.cdo.common.id.CDOIDUtil;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
import org.eclipse.emf.cdo.common.revision.CDORevision;
@@ -44,15 +44,15 @@ public abstract class AbstractSyncRevisionsRequest extends CDOClientRequest<Coll
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_PROTOCOL, AbstractSyncRevisionsRequest.class);
- protected Map<CDOID, CDOIDAndVersion> idAndVersions;
+ protected Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches;
protected int referenceChunk;
public AbstractSyncRevisionsRequest(CDOClientProtocol protocol, short signalID,
- Map<CDOID, CDOIDAndVersion> idAndVersions, int referenceChunk)
+ Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int referenceChunk)
{
super(protocol, signalID);
- this.idAndVersions = idAndVersions;
+ this.idAndVersionAndBranches = idAndVersionAndBranches;
this.referenceChunk = referenceChunk;
}
@@ -61,14 +61,14 @@ public abstract class AbstractSyncRevisionsRequest extends CDOClientRequest<Coll
{
if (TRACER.isEnabled())
{
- TRACER.trace("Synchronization " + idAndVersions.size() + " objects"); //$NON-NLS-1$ //$NON-NLS-2$
+ TRACER.trace("Synchronization " + idAndVersionAndBranches.size() + " objects"); //$NON-NLS-1$ //$NON-NLS-2$
}
out.writeInt(referenceChunk);
- out.writeInt(idAndVersions.size());
- for (CDOIDAndVersion idAndVersion : idAndVersions.values())
+ out.writeInt(idAndVersionAndBranches.size());
+ for (CDOIDAndVersionAndBranch idAndVersionAndBranch : idAndVersionAndBranches.values())
{
- out.writeCDOIDAndVersion(idAndVersion);
+ out.writeCDOIDAndVersionAndBranch(idAndVersionAndBranch);
}
}
@@ -85,15 +85,16 @@ public abstract class AbstractSyncRevisionsRequest extends CDOClientRequest<Coll
long oldRevised = in.readLong();
CDOBranchPoint branchPoint = CDOBranchUtil.createBranchPoint(revision.getBranch(), oldRevised);
- CDOIDAndVersion idAndVersion = idAndVersions.get(revision.getID());
- if (idAndVersion == null)
+ CDOIDAndVersionAndBranch idAndVersionAndBranch = idAndVersionAndBranches.get(revision.getID());
+ if (idAndVersionAndBranch == null)
{
throw new IllegalStateException(MessageFormat.format(
Messages.getString("SyncRevisionsRequest.2"), revision.getID())); //$NON-NLS-1$
}
Set<CDOIDAndVersion> dirtyObjects = getRefreshContext(refreshContexts, branchPoint).getDirtyObjects();
- dirtyObjects.add(CDOIDUtil.createIDAndVersion(idAndVersion.getID(), idAndVersion.getVersion()));
+ // $$$ (CD)
+ // dirtyObjects.add(CDOIDUtil.createIDAndVersion(idAndVersion.getID(), idAndVersion.getVersion()));
revisionManager.addRevision(revision);
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
index 575435e..e07fe99 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.util.TransportException;
@@ -83,10 +83,10 @@ public class CDOClientProtocol extends SignalProtocol<CDOSession> implements CDO
return send(new OpenSessionRequest(this, repositoryName, passiveUpdateEnabled));
}
- public void setPassiveUpdate(Map<CDOID, CDOIDAndVersion> idAndVersions, int initialChunkSize,
+ public void setPassiveUpdate(Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int initialChunkSize,
boolean passiveUpdateEnabled)
{
- send(new SetPassiveUpdateRequest(this, idAndVersions, initialChunkSize, passiveUpdateEnabled));
+ send(new SetPassiveUpdateRequest(this, idAndVersionAndBranches, initialChunkSize, passiveUpdateEnabled));
}
public RepositoryTimeResult getRepositoryTime()
@@ -131,9 +131,10 @@ public class CDOClientProtocol extends SignalProtocol<CDOSession> implements CDO
return send(new LoadRevisionByVersionRequest(this, id, branchVersion, referenceChunk));
}
- public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersion> idAndVersions, int initialChunkSize)
+ public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches,
+ int initialChunkSize)
{
- return send(new SyncRevisionsRequest(this, idAndVersions, initialChunkSize));
+ return send(new SyncRevisionsRequest(this, idAndVersionAndBranches, initialChunkSize));
}
public void openView(int viewID, CDOBranchPoint branchPoint, boolean readOnly)
@@ -173,7 +174,7 @@ public class CDOClientProtocol extends SignalProtocol<CDOSession> implements CDO
}
}
- public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersion> objects, long timeout, LockType lockType)
+ public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersionAndBranch> objects, long timeout, LockType lockType)
throws InterruptedException
{
InterruptedException interruptedException = null;
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
index d9418d3..a619ad8 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/LockObjectsRequest.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.internal.net4j.bundle.OM;
@@ -36,10 +36,10 @@ public class LockObjectsRequest extends SyncRevisionsRequest
private long timeout;
- public LockObjectsRequest(CDOClientProtocol protocol, CDOView view, Map<CDOID, CDOIDAndVersion> idAndVersions,
- int referenceChunk, long timeout, LockType lockType)
+ public LockObjectsRequest(CDOClientProtocol protocol, CDOView view,
+ Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int referenceChunk, long timeout, LockType lockType)
{
- super(protocol, CDOProtocolConstants.SIGNAL_LOCK_OBJECTS, idAndVersions, referenceChunk);
+ super(protocol, CDOProtocolConstants.SIGNAL_LOCK_OBJECTS, idAndVersionAndBranches, referenceChunk);
this.view = view;
this.timeout = timeout;
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SetPassiveUpdateRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SetPassiveUpdateRequest.java
index 4463fcf..5e08357 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SetPassiveUpdateRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SetPassiveUpdateRequest.java
@@ -12,7 +12,7 @@
package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.io.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.internal.net4j.bundle.OM;
@@ -32,10 +32,10 @@ public class SetPassiveUpdateRequest extends SyncRevisionsRequest
private boolean passiveUpdateEnabled;
- public SetPassiveUpdateRequest(CDOClientProtocol protocol, Map<CDOID, CDOIDAndVersion> idAndVersions,
- int referenceChunk, boolean passiveUpdateEnabled)
+ public SetPassiveUpdateRequest(CDOClientProtocol protocol,
+ Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int referenceChunk, boolean passiveUpdateEnabled)
{
- super(protocol, CDOProtocolConstants.SIGNAL_PASSIVE_UPDATE, idAndVersions, referenceChunk);
+ super(protocol, CDOProtocolConstants.SIGNAL_PASSIVE_UPDATE, idAndVersionAndBranches, referenceChunk);
this.passiveUpdateEnabled = passiveUpdateEnabled;
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SyncRevisionsRequest.java
index dc2f999..0de7e9c 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SyncRevisionsRequest.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/SyncRevisionsRequest.java
@@ -12,7 +12,7 @@
package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.io.CDODataInput;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
@@ -29,15 +29,16 @@ import java.util.Map;
*/
public class SyncRevisionsRequest extends AbstractSyncRevisionsRequest
{
- public SyncRevisionsRequest(CDOClientProtocol protocol, Map<CDOID, CDOIDAndVersion> idAndVersions, int referenceChunk)
+ public SyncRevisionsRequest(CDOClientProtocol protocol, Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches,
+ int referenceChunk)
{
- this(protocol, CDOProtocolConstants.SIGNAL_SYNC_REVISIONS, idAndVersions, referenceChunk);
+ this(protocol, CDOProtocolConstants.SIGNAL_SYNC_REVISIONS, idAndVersionAndBranches, referenceChunk);
}
- public SyncRevisionsRequest(CDOClientProtocol protocol, short signalID, Map<CDOID, CDOIDAndVersion> idAndVersions,
- int referenceChunk)
+ public SyncRevisionsRequest(CDOClientProtocol protocol, short signalID,
+ Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int referenceChunk)
{
- super(protocol, signalID, idAndVersions, referenceChunk);
+ super(protocol, signalID, idAndVersionAndBranches, referenceChunk);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
index 91ceead..e8444f8 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticationResult;
@@ -125,7 +125,7 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
return result;
}
- public void setPassiveUpdate(Map<CDOID, CDOIDAndVersion> idAndVersions, int initialChunkSize,
+ public void setPassiveUpdate(Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int initialChunkSize,
boolean passiveUpdateEnabled)
{
// serverSessionProtocol.getSession().setPassiveUpdateEnabled(passiveUpdateEnabled);
@@ -180,7 +180,8 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
}
}
- public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersion> allRevisions, int initialChunkSize)
+ public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersionAndBranch> allRevisions,
+ int initialChunkSize)
{
throw new UnsupportedOperationException();
}
@@ -271,7 +272,7 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
throw new UnsupportedOperationException();
}
- public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersion> objects, long timeout, LockType lockType)
+ public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersionAndBranch> objects, long timeout, LockType lockType)
throws InterruptedException
{
throw new UnsupportedOperationException();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
index 8dbdd71..f596c11 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.branch.CDOBranchVersion;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDOAuthenticator;
@@ -477,7 +478,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
checkActive();
if (!options().isPassiveUpdateEnabled())
{
- Map<CDOID, CDOIDAndVersion> allRevisions = getAllCDOIDAndVersion();
+ Map<CDOID, CDOIDAndVersionAndBranch> allRevisions = getAllCDOIDAndVersionAndBranch();
try
{
@@ -864,12 +865,12 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
super.doDeactivate();
}
- private Map<CDOID, CDOIDAndVersion> getAllCDOIDAndVersion()
+ private Map<CDOID, CDOIDAndVersionAndBranch> getAllCDOIDAndVersionAndBranch()
{
- Map<CDOID, CDOIDAndVersion> uniqueObjects = new HashMap<CDOID, CDOIDAndVersion>();
+ Map<CDOID, CDOIDAndVersionAndBranch> uniqueObjects = new HashMap<CDOID, CDOIDAndVersionAndBranch>();
for (InternalCDOView view : getViews())
{
- view.getCDOIDAndVersion(uniqueObjects, Arrays.asList(view.getObjectsArray()));
+ view.getCDOIDAndVersionAndBranch(uniqueObjects, Arrays.asList(view.getObjectsArray()));
}
// Need to add Revision from revisionManager since we do not have all objects in view.
@@ -877,7 +878,9 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
{
if (!uniqueObjects.containsKey(revision.getID()))
{
- uniqueObjects.put(revision.getID(), CDOIDUtil.createIDAndVersion(revision.getID(), revision.getVersion()));
+
+ uniqueObjects.put(revision.getID(), CDOIDUtil.createIDAndVersionAndBranch(revision.getID(), revision
+ .getVersion(), revision.getBranch().getID()));
}
}
@@ -946,7 +949,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
this.passiveUpdateEnabled = passiveUpdateEnabled;
// Need to refresh if we change state
- Map<CDOID, CDOIDAndVersion> allRevisions = getAllCDOIDAndVersion();
+ Map<CDOID, CDOIDAndVersionAndBranch> allRevisions = getAllCDOIDAndVersionAndBranch();
if (!allRevisions.isEmpty())
{
int initialChunkSize = collectionLoadingPolicy.getInitialChunkSize();
@@ -1443,7 +1446,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
}
- public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersion> objects, long timeout, LockType lockType)
+ public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersionAndBranch> objects, long timeout, LockType lockType)
throws InterruptedException
{
int attempt = 0;
@@ -1478,7 +1481,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
}
- public void setPassiveUpdate(Map<CDOID, CDOIDAndVersion> idAndVersions, int initialChunkSize,
+ public void setPassiveUpdate(Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int initialChunkSize,
boolean passiveUpdateEnabled)
{
int attempt = 0;
@@ -1486,7 +1489,7 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
{
try
{
- delegate.setPassiveUpdate(idAndVersions, initialChunkSize, passiveUpdateEnabled);
+ delegate.setPassiveUpdate(idAndVersionAndBranches, initialChunkSize, passiveUpdateEnabled);
return;
}
catch (Exception ex)
@@ -1496,7 +1499,8 @@ public abstract class CDOSessionImpl extends Container<CDOView> implements Inter
}
}
- public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersion> allRevisions, int initialChunkSize)
+ public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersionAndBranch> allRevisions,
+ int initialChunkSize)
{
int attempt = 0;
for (;;)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index a0270a7..d5fbbd8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommit;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
@@ -340,7 +341,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
}
@Override
- public void getCDOIDAndVersion(Map<CDOID, CDOIDAndVersion> uniqueObjects, Collection<? extends CDOObject> cdoObjects)
+ public void getCDOIDAndVersionAndBranch(Map<CDOID, CDOIDAndVersionAndBranch> uniqueObjects,
+ Collection<? extends CDOObject> cdoObjects)
{
Map<CDOID, CDORevisionDelta> deltaMap = getRevisionDeltas();
for (CDOObject cdoObject : cdoObjects)
@@ -359,7 +361,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
}
}
- uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersion(cdoId, version));
+ int branchID = cdoRevision.getBranch().getID();
+ uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersionAndBranch(cdoId, version, branchID));
}
}
}
@@ -1199,7 +1202,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
/**
* TODO Simon: Should this method go to CDOSavePointImpl?
*/
- @SuppressWarnings({ "rawtypes", "unchecked" })
+ @SuppressWarnings( { "rawtypes", "unchecked" })
private void registerNew(Map map, InternalCDOObject object)
{
Object old = map.put(object.cdoID(), object);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 76b4e8e..44bf131 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDMeta;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
@@ -395,15 +396,18 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
throws InterruptedException
{
checkActive();
- Map<CDOID, CDOIDAndVersion> uniqueObjects = new HashMap<CDOID, CDOIDAndVersion>();
- getCDOIDAndVersion(uniqueObjects, objects);
+ Map<CDOID, CDOIDAndVersionAndBranch> uniqueObjects = new HashMap<CDOID, CDOIDAndVersionAndBranch>();
+ getCDOIDAndVersionAndBranch(uniqueObjects, objects);
for (CDOObject object : objects)
{
- CDOIDAndVersion idAndVersion = uniqueObjects.get(object.cdoID());
- if (idAndVersion == null)
+ CDOIDAndVersionAndBranch idAndVersionAndBranch = uniqueObjects.get(object.cdoID());
+ if (idAndVersionAndBranch == null)
{
- uniqueObjects
- .put(object.cdoID(), CDOIDUtil.createIDAndVersion(object.cdoID(), CDORevision.UNSPECIFIED_VERSION));
+ CDOID cdoID = object.cdoID();
+ int branchID = object.cdoRevision().getBranch().getID();
+ int version = CDORevision.UNSPECIFIED_VERSION;
+ CDOIDAndVersionAndBranch ivb = CDOIDUtil.createIDAndVersionAndBranch(cdoID, version, branchID);
+ uniqueObjects.put(object.cdoID(), ivb);
}
}
@@ -1599,7 +1603,8 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
return getResourceSet();
}
- public void getCDOIDAndVersion(Map<CDOID, CDOIDAndVersion> uniqueObjects, Collection<? extends CDOObject> cdoObjects)
+ public void getCDOIDAndVersionAndBranch(Map<CDOID, CDOIDAndVersionAndBranch> uniqueObjects,
+ Collection<? extends CDOObject> cdoObjects)
{
for (CDOObject internalCDOObject : cdoObjects)
{
@@ -1608,7 +1613,8 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
if (cdoRevision != null && !uniqueObjects.containsKey(cdoId))
{
int version = cdoRevision.getVersion();
- uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersion(cdoId, version));
+ int branchID = cdoRevision.getBranch().getID();
+ uniqueObjects.put(cdoId, CDOIDUtil.createIDAndVersionAndBranch(cdoId, version, branchID));
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
index 0728f39..895b7f7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.protocol.CDOProtocol;
@@ -51,7 +51,7 @@ import java.util.Set;
*/
public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLoader, RevisionLoader
{
- public void setPassiveUpdate(Map<CDOID, CDOIDAndVersion> idAndVersions, int initialChunkSize,
+ public void setPassiveUpdate(Map<CDOID, CDOIDAndVersionAndBranch> idAndVersionAndBranches, int initialChunkSize,
boolean passiveUpdateEnabled);
public RepositoryTimeResult getRepositoryTime();
@@ -71,7 +71,8 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
public Object loadChunk(InternalCDORevision revision, EStructuralFeature feature, int accessIndex, int fetchIndex,
int fromIndex, int toIndex);
- public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersion> allRevisions, int initialChunkSize);
+ public Collection<CDORefreshContext> syncRevisions(Map<CDOID, CDOIDAndVersionAndBranch> allRevisions,
+ int initialChunkSize);
/**
* @since 3.0
@@ -97,7 +98,7 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
/**
* @since 3.0
*/
- public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersion> objects, long timeout, LockType lockType)
+ public void lockObjects(CDOView view, Map<CDOID, CDOIDAndVersionAndBranch> objects, long timeout, LockType lockType)
throws InterruptedException;
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
index 36b84df..7bd5cb5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.id.CDOIDAndVersionAndBranch;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
@@ -74,7 +75,8 @@ public interface InternalCDOView extends CDOView, CDOIDProvider, ILifecycle
public Set<CDOObject> handleInvalidationWithoutNotification(Set<CDOIDAndVersion> dirtyOIDs,
Collection<CDOID> detachedOIDs, Set<InternalCDOObject> dirtyObjects, Set<InternalCDOObject> detachedObjects);
- public void getCDOIDAndVersion(Map<CDOID, CDOIDAndVersion> uniqueObjects, Collection<? extends CDOObject> cdoObjects);
+ public void getCDOIDAndVersionAndBranch(Map<CDOID, CDOIDAndVersionAndBranch> uniqueObjects,
+ Collection<? extends CDOObject> cdoObjects);
public void handleChangeSubscription(Collection<CDORevisionDelta> deltas, Collection<CDOID> detachedObjects);