summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Velten2013-11-20 09:03:26 (EST)
committerGerrit Code Review @ Eclipse.org2013-12-19 02:56:23 (EST)
commitf14f771ed499274460c1776b45340e9202f40c37 (patch)
tree9bb049132968e43999b70df43197205c8a278858
parente8405e0a186c9378cddafe504182df3b596a1409 (diff)
downloadcdo-f14f771ed499274460c1776b45340e9202f40c37.zip
cdo-f14f771ed499274460c1776b45340e9202f40c37.tar.gz
cdo-f14f771ed499274460c1776b45340e9202f40c37.tar.bz2
[422145]: Branches cannot be renamedrefs/changes/19/18619/12
https://bugs.eclipse.org/bugs/show_bug.cgi?id=422145 Bug: 422145 Change-Id: I6ded9e20bc7ded6efd3548a9cbd6c4c61c2a161e Signed-off-by: Mathieu Velten <mathieu.velten@atos.net>
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchChangedEvent.java39
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/BranchNotificationIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CDOClientProtocol.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java33
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/BranchNotificationRequest.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Session.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedClientSessionProtocol.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/CDOSessionImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java23
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java2
37 files changed, 558 insertions, 58 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
index abbeeab..b48f499 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranch.java
@@ -27,7 +27,7 @@ import org.eclipse.net4j.util.container.IContainer;
* <li> {@link CDOBranchTag Branch tags} are named points in a branch.
* <li> {@link #getBase() Base points } of sub branches of a branch.
* </ul>
- *
+ *
* @author Eike Stepper
* @since 3.0
* @noextend This interface is not intended to be extended by clients.
@@ -50,7 +50,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
/**
* The string used to separate the segments of branch paths.
- *
+ *
* @see #getPathName()
* @see #getBranch(String)
* @see CDOBranchManager#getBranch(String)
@@ -107,7 +107,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
* <p>
* The base of the {@link CDOBranchManager#getMainBranch() main branch} marks the creation of the
* {@link CDOCommonRepository repository}.
- *
+ *
* @see CDOBranch#getHead()
* @see #getPoint(long)
*/
@@ -116,7 +116,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
/**
* Returns the floating <i>end point</i> of this branch, a pair of this branch and the fixed special time stamp <i>
* {@link CDOBranchPoint#UNSPECIFIED_DATE unspecified}</i>.
- *
+ *
* @see CDOBranch#getBase()
* @see #getPoint(long)
*/
@@ -126,7 +126,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
* Returns the branch point in this branch with the given time stamp.
* <p>
* This factory method never returns <code>null</code>.
- *
+ *
* @see CDOBranch#getBase()
* @see CDOBranch#getHead()
* @see #getVersion(int)
@@ -137,7 +137,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
* Returns the branch version in this branch with the given version number.
* <p>
* This factory method never returns <code>null</code>.
- *
+ *
* @see #getPoint(long)
*/
public CDOBranchVersion getVersion(int version);
@@ -165,7 +165,7 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
* Creates a sub branch of this branch with the given name, {@link #getBase() based} at the {@link CDOBranchPoint
* branch point} in this branch with the given time stamp.
* <p>
- *
+ *
* @param name
* The name of the sub branch to be created. It must not contain the {@link #PATH_SEPARATOR path separator}
* character (slash).
@@ -182,4 +182,11 @@ public interface CDOBranch extends IContainer<CDOBranch>, Comparable<CDOBranch>
* current time}.
*/
public CDOBranch createBranch(String name);
+
+ /**
+ * Renames this branch with the given new name.
+ *
+ * @since 4.3
+ */
+ public void rename(String newName);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchChangedEvent.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchChangedEvent.java
new file mode 100644
index 0000000..86bd108
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchChangedEvent.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2013 Eike Stepper (Berlin, Germany) and others.
+ * 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.common.branch;
+
+import org.eclipse.net4j.util.event.IEvent;
+
+/**
+ * An {@link IEvent event} fired from a {@link CDOBranchManager branch manager} when a new {@link CDOBranch branch} has
+ * been created.
+ *
+ * @author Eike Stepper
+ * @since 4.3
+ * @noextend This interface is not intended to be extended by clients.
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface CDOBranchChangedEvent extends IEvent
+{
+ public CDOBranchManager getSource();
+
+ public CDOBranch getBranch();
+
+ public ChangeKind getChangeKind();
+
+ /**
+ * @author Eike Stepper
+ */
+ public enum ChangeKind
+ {
+ CREATED, RENAMED, DELETED
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
index 848a783..b3ae2c1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchCreatedEvent.java
@@ -15,13 +15,15 @@ import org.eclipse.net4j.util.event.IEvent;
/**
* An {@link IEvent event} fired from a {@link CDOBranchManager branch manager} when a new {@link CDOBranch branch} has
* been created.
- *
+ *
* @author Eike Stepper
* @since 3.0
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
+ * @deprecated As of 4.3 use {@link CDOBranchChangedEvent}.
*/
-public interface CDOBranchCreatedEvent extends IEvent
+@Deprecated
+public interface CDOBranchCreatedEvent extends CDOBranchChangedEvent
{
public CDOBranchManager getSource();
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
index 4fe6acb..a4d4429 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/branch/CDOBranchManager.java
@@ -24,7 +24,7 @@ import org.eclipse.net4j.util.event.INotifier;
* <p>
* A branch manager can fire the following events:
* <ul>
- * <li> {@link CDOBranchCreatedEvent} after a new branch has been created.
+ * <li> {@link CDOBranchChangedEvent} after a new branch has been created, renamed or deleted.
* </ul>
* <p>
* Branch managers are usually associated with the following entities:
@@ -39,7 +39,7 @@ import org.eclipse.net4j.util.event.INotifier;
* @noimplement This interface is not intended to be implemented by clients.
* @apiviz.landmark
* @apiviz.has {@link CDOBranch} oneway - - mainBranch
- * @apiviz.uses {@link CDOBranchCreatedEvent} - - fires
+ * @apiviz.uses {@link CDOBranchChangedEvent} - - fires
*/
public interface CDOBranchManager extends INotifier
{
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
index f642d28..02c887e 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/protocol/CDOProtocolConstants.java
@@ -29,8 +29,9 @@ public interface CDOProtocolConstants
/**
* @since 4.2
*/
- public static final int PROTOCOL_VERSION = 18; // Password change protocol
+ public static final int PROTOCOL_VERSION = 19; // Branch renaming
+ // public static final int PROTOCOL_VERSION = 18; // Password change protocol
// public static final int PROTOCOL_VERSION = 17; // Last update for make query fail in sequence
// //////////////////////////////////////////////////////////////////////
@@ -278,6 +279,11 @@ public interface CDOProtocolConstants
*/
public static final short SIGNAL_CREDENTIALS_CHALLENGE = 57;
+ /**
+ * @since 4.3
+ */
+ public static final short SIGNAL_RENAME_BRANCH = 58;
+
// //////////////////////////////////////////////////////////////////////
// Session Refresh
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java
index 5bfdbcd..8a638b5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchImpl.java
@@ -234,6 +234,16 @@ public class CDOBranchImpl extends Container<CDOBranch> implements InternalCDOBr
return child.getBranch(rest);
}
+ public void rename(String newName)
+ {
+ if (!branchManager.getRepository().isSupportingBranches())
+ {
+ throw new IllegalStateException("Branching is not supported");
+ }
+
+ branchManager.renameBranch(this, newName);
+ }
+
private InternalCDOBranch getChild(String name)
{
InternalCDOBranch[] branches = getBranches();
@@ -260,6 +270,11 @@ public class CDOBranchImpl extends Container<CDOBranch> implements InternalCDOBr
base = baseBranch.getPoint(baseTimeStamp);
}
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
public void addChild(InternalCDOBranch branch)
{
synchronized (this)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java
index b5b9f46..2667ef1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/branch/CDOBranchManagerImpl.java
@@ -12,7 +12,8 @@ package org.eclipse.emf.cdo.internal.common.branch;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.branch.CDOBranchHandler;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
@@ -84,13 +85,26 @@ public class CDOBranchManagerImpl extends Container<CDOBranch> implements Intern
mainBranch = new CDOBranchImpl.Main(this, local, timeStamp);
}
+ @Deprecated
public void handleBranchCreated(InternalCDOBranch branch)
{
- CDOBranchPoint base = branch.getBase();
- InternalCDOBranch baseBranch = (InternalCDOBranch)base.getBranch();
- baseBranch.addChild(branch);
+ handleBranchChanged(branch, ChangeKind.CREATED);
+ }
+
+ public void handleBranchChanged(InternalCDOBranch branch, ChangeKind changeKind)
+ {
+ if (changeKind == ChangeKind.CREATED)
+ {
+ CDOBranchPoint base = branch.getBase();
+ InternalCDOBranch baseBranch = (InternalCDOBranch)base.getBranch();
+ baseBranch.addChild(branch);
- fireEvent(new BranchCreatedEvent(branch));
+ fireEvent(new BranchCreatedEvent(branch));
+ }
+ else
+ {
+ fireEvent(new BranchChangedEvent(branch, changeKind));
+ }
}
public CDOBranch[] getElements()
@@ -228,6 +242,23 @@ public class CDOBranchManagerImpl extends Container<CDOBranch> implements Intern
return branch;
}
+ public void renameBranch(CDOBranch branch, String newName)
+ {
+ checkActive();
+ if (branch.isMainBranch())
+ {
+ throw new IllegalArgumentException("Renaming of the MAIN branch is not supported");
+ }
+
+ if (!(branchLoader instanceof BranchLoader2))
+ {
+ throw new UnsupportedOperationException("Branch renaming is not supported by " + this);
+ }
+
+ ((BranchLoader2)branchLoader).renameBranch(branch.getID(), newName);
+ ((InternalCDOBranch)branch).setName(newName);
+ }
+
@Override
public String toString()
{
@@ -265,16 +296,19 @@ public class CDOBranchManagerImpl extends Container<CDOBranch> implements Intern
/**
* @author Eike Stepper
*/
- private static final class BranchCreatedEvent extends Event implements CDOBranchCreatedEvent
+ private static class BranchChangedEvent extends Event implements CDOBranchChangedEvent
{
private static final long serialVersionUID = 1L;
private CDOBranch branch;
- public BranchCreatedEvent(CDOBranch branch)
+ private ChangeKind changeKind;
+
+ public BranchChangedEvent(CDOBranch branch, ChangeKind changeKind)
{
super(branch.getBranchManager());
this.branch = branch;
+ this.changeKind = changeKind;
}
@Override
@@ -287,5 +321,25 @@ public class CDOBranchManagerImpl extends Container<CDOBranch> implements Intern
{
return branch;
}
+
+ public ChangeKind getChangeKind()
+ {
+ return changeKind;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ @Deprecated
+ private static final class BranchCreatedEvent extends BranchChangedEvent implements
+ org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent
+ {
+ private static final long serialVersionUID = 1L;
+
+ public BranchCreatedEvent(CDOBranch branch)
+ {
+ super(branch, ChangeKind.CREATED);
+ }
}
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java
index 86a25d7..f7ed9e9 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranch.java
@@ -44,5 +44,10 @@ public interface InternalCDOBranch extends CDOBranch
public void setBranchInfo(String name, InternalCDOBranch baseBranch, long baseTimeStamp);
+ /**
+ * @since 4.3
+ */
+ public void setName(String name);
+
public void addChild(InternalCDOBranch branch);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java
index 58a181d..3ea71c4 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/branch/InternalCDOBranchManager.java
@@ -11,6 +11,8 @@
package org.eclipse.emf.cdo.spi.common.branch;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.branch.CDOBranchHandler;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
@@ -67,9 +69,23 @@ public interface InternalCDOBranchManager extends CDOBranchManager, ILifecycle
public InternalCDOBranch createBranch(int id, String name, InternalCDOBranch baseBranch, long baseTimeStamp);
+ /**
+ * @since 4.3
+ */
+ public void renameBranch(CDOBranch branch, String newName);
+
+ /**
+ * @deprecated As of 4.3 use {@link #handleBranchChanged(InternalCDOBranch, ChangeKind)}.
+ */
+ @Deprecated
public void handleBranchCreated(InternalCDOBranch branch);
/**
+ * @since 4.3
+ */
+ public void handleBranchChanged(InternalCDOBranch branch, ChangeKind changeKind);
+
+ /**
* If the meaning of this type isn't clear, there really should be more of a description here...
*
* @author Eike Stepper
@@ -210,4 +226,21 @@ public interface InternalCDOBranchManager extends CDOBranchManager, ILifecycle
}
}
}
+
+ /**
+ * If the meaning of this type isn't clear, there really should be more of a description here...
+ *
+ * @author Mathieu Velten
+ * @since 4.3
+ */
+ public interface BranchLoader2 extends BranchLoader
+ {
+ /**
+ * @deprecated Not yet implemented.
+ */
+ @Deprecated
+ public void deleteBranch(int branchID);
+
+ public void renameBranch(int branchID, String newName);
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/BranchNotificationIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/BranchNotificationIndication.java
index 4843003..ec5c90d 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/BranchNotificationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/BranchNotificationIndication.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.cdo.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
@@ -33,8 +34,9 @@ public class BranchNotificationIndication extends CDOClientIndication
protected void indicating(CDODataInput in) throws IOException
{
CDOBranch branch = in.readCDOBranch();
+ ChangeKind changeKind = in.readEnum(ChangeKind.class);
InternalCDOBranchManager branchManager = getSession().getBranchManager();
- branchManager.handleBranchCreated((InternalCDOBranch)branch);
+ branchManager.handleBranchChanged((InternalCDOBranch)branch, changeKind);
}
}
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 8e6011c..e9f6acf 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
@@ -156,6 +156,17 @@ public class CDOClientProtocol extends AuthenticatingSignalProtocol<CDOSessionIm
return send(new LoadBranchesRequest(this, startID, endID, handler));
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ send(new RenameBranchRequest(this, branchID, newName));
+ }
+
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
{
send(new LoadCommitInfosRequest(this, branch, startTime, endTime, handler));
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java
new file mode 100644
index 0000000..85a8b18
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/RenameBranchRequest.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2013 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Mathieu Velten - initial API and implementation
+ */
+package org.eclipse.emf.cdo.internal.net4j.protocol;
+
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+
+import java.io.IOException;
+
+/**
+ * @author Mathieu Velten
+ */
+public class RenameBranchRequest extends CDOClientRequest<Boolean>
+{
+ private int branchID;
+
+ private String newName;
+
+ public RenameBranchRequest(CDOClientProtocol protocol, int branchID, String newName)
+ {
+ super(protocol, CDOProtocolConstants.SIGNAL_RENAME_BRANCH);
+ this.branchID = branchID;
+ this.newName = newName;
+ }
+
+ @Override
+ protected void requesting(CDODataOutput out) throws IOException
+ {
+ out.writeInt(branchID);
+ out.writeString(newName);
+ }
+
+ @Override
+ protected Boolean confirming(CDODataInput in) throws IOException
+ {
+ return true;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
index 0024935..0d61bf9 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/CDODBSchema.java
@@ -123,6 +123,9 @@ public class CDODBSchema
public static final String SQL_LOAD_BRANCH = "SELECT " + BRANCHES_NAME + ", " + BRANCHES_BASE_BRANCH_ID + ", " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ BRANCHES_BASE_TIMESTAMP + " FROM " + BRANCHES + " WHERE " + BRANCHES_ID + "=?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ public static final String SQL_RENAME_BRANCH = "UPDATE " + BRANCHES + " SET " + BRANCHES_NAME + "=?" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ + " WHERE " + BRANCHES_ID + "=?"; //$NON-NLS-1$ //$NON-NLS-2$
+
public static final String SQL_LOAD_SUB_BRANCHES = "SELECT " + BRANCHES_ID + ", " + BRANCHES_NAME + ", " //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ BRANCHES_BASE_TIMESTAMP + " FROM " + BRANCHES + " WHERE " + BRANCHES_BASE_BRANCH_ID + "=?"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
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 3deaaed..14befb6 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
@@ -51,6 +51,7 @@ import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader2;
import org.eclipse.emf.cdo.spi.common.commit.CDOChangeSetSegment;
import org.eclipse.emf.cdo.spi.common.commit.CDOCommitInfoUtil;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
@@ -108,7 +109,7 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, DurableLocking2
+public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor, BranchLoader2, DurableLocking2
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, DBStoreAccessor.class);
@@ -976,6 +977,36 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
}
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ checkBranchingSupport();
+
+ IDBPreparedStatement stmt = connection.prepareStatement(CDODBSchema.SQL_RENAME_BRANCH, ReuseProbability.LOW);
+
+ try
+ {
+ stmt.setString(1, newName);
+ stmt.setInt(2, branchID);
+
+ DBUtil.update(stmt, true);
+ getConnection().commit();
+ }
+ catch (SQLException ex)
+ {
+ throw new DBException(ex);
+ }
+ finally
+ {
+ DBUtil.close(stmt);
+ }
+ }
+
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
{
int count = CDOCommitInfoUtil.decodeCount(endTime);
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/BranchNotificationRequest.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/BranchNotificationRequest.java
index 2591c49..d3d888e 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/BranchNotificationRequest.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/BranchNotificationRequest.java
@@ -13,6 +13,7 @@
package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
@@ -25,15 +26,19 @@ public class BranchNotificationRequest extends CDOServerRequest
{
private CDOBranch branch;
- public BranchNotificationRequest(CDOServerProtocol serverProtocol, CDOBranch branch)
+ private ChangeKind changeKind;
+
+ public BranchNotificationRequest(CDOServerProtocol serverProtocol, CDOBranch branch, ChangeKind changeKind)
{
super(serverProtocol, CDOProtocolConstants.SIGNAL_BRANCH_NOTIFICATION);
this.branch = branch;
+ this.changeKind = changeKind;
}
@Override
protected void requesting(CDODataOutput out) throws IOException
{
out.writeCDOBranch(branch);
+ out.writeEnum(changeKind);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
index 633112c..9d29017 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CDOServerProtocol.java
@@ -16,6 +16,7 @@
package org.eclipse.emf.cdo.server.internal.net4j.protocol;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -139,11 +140,17 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession> implement
}
}
+ @Deprecated
public void sendBranchNotification(InternalCDOBranch branch) throws Exception
{
+ sendBranchNotification(branch, ChangeKind.CREATED);
+ }
+
+ public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception
+ {
if (LifecycleUtil.isActive(getChannel()))
{
- new BranchNotificationRequest(this, branch).sendAsync();
+ new BranchNotificationRequest(this, branch, changeKind).sendAsync();
}
else
{
@@ -365,6 +372,9 @@ public class CDOServerProtocol extends SignalProtocol<InternalSession> implement
case SIGNAL_CHANGE_CREDENTIALS:
return new ChangeCredentialsIndication(this);
+ case SIGNAL_RENAME_BRANCH:
+ return new RenameBranchIndication(this);
+
default:
return super.createSignalReactor(signalID);
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java
index 694fe27..8aece61 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CreateBranchIndication.java
@@ -10,6 +10,7 @@
*/
package org.eclipse.emf.cdo.server.internal.net4j.protocol;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
@@ -50,7 +51,7 @@ public class CreateBranchIndication extends CDOServerWriteIndication
branchInfo.getBaseTimeStamp());
InternalSessionManager sessionManager = getRepository().getSessionManager();
- sessionManager.sendBranchNotification(getSession(), branch);
+ sessionManager.sendBranchNotification(getSession(), branch, ChangeKind.CREATED);
out.writeInt(branch.getID());
out.writeLong(branch.getBase().getTimeStamp());
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java
new file mode 100644
index 0000000..dc11b90
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/RenameBranchIndication.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2013 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Mathieu Velten - initial API and implementation
+ */
+package org.eclipse.emf.cdo.server.internal.net4j.protocol;
+
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
+import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
+import org.eclipse.emf.cdo.spi.server.InternalSessionManager;
+
+import java.io.IOException;
+
+/**
+ * @author Mathieu Velten
+ */
+public class RenameBranchIndication extends CDOServerWriteIndication
+{
+ private int branchID;
+
+ private String newName;
+
+ public RenameBranchIndication(CDOServerProtocol protocol)
+ {
+ super(protocol, CDOProtocolConstants.SIGNAL_RENAME_BRANCH);
+ }
+
+ @Override
+ protected void indicating(CDODataInput in) throws IOException
+ {
+ branchID = in.readInt();
+ newName = in.readString();
+ }
+
+ @Override
+ protected void responding(CDODataOutput out) throws IOException
+ {
+ InternalCDOBranchManager branchManager = getRepository().getBranchManager();
+ InternalCDOBranch branch = branchManager.getBranch(branchID);
+
+ branchManager.renameBranch(branch, newName);
+ InternalSessionManager sessionManager = getRepository().getSessionManager();
+ sessionManager.sendBranchNotification(getSession(), branch, ChangeKind.RENAMED);
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
index 736e11e..02744d0 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java
@@ -67,6 +67,7 @@ import org.eclipse.emf.cdo.spi.common.CDOReplicationContext;
import org.eclipse.emf.cdo.spi.common.CDOReplicationInfo;
import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader2;
import org.eclipse.emf.cdo.spi.common.commit.CDOChangeSetSegment;
import org.eclipse.emf.cdo.spi.common.commit.CDOCommitInfoUtil;
import org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo;
@@ -435,6 +436,36 @@ public class Repository extends Container<Object> implements InternalRepository
return accessor.loadBranches(startID, endID, branchHandler);
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ if (!isSupportingBranches())
+ {
+ throw new IllegalStateException("Branching is not supported by " + this);
+ }
+
+ if (branchID == CDOBranch.MAIN_BRANCH_ID)
+ {
+ throw new IllegalArgumentException("Renaming of the MAIN branch is not supported");
+ }
+
+ IStoreAccessor accessor = StoreThreadLocal.getAccessor();
+ if (!(accessor instanceof BranchLoader2))
+ {
+ throw new UnsupportedOperationException("Branch renaming is not supported by " + this);
+ }
+
+ synchronized (createBranchLock)
+ {
+ ((BranchLoader2)accessor).renameBranch(branchID, newName);
+ }
+ }
+
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
{
IStoreAccessor accessor = StoreThreadLocal.getAccessor();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
index d680fec..4c6e6e7 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/ServerCDOView.java
@@ -521,7 +521,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
/**
* Server sessions may not be used to change the user's credentials: it must
* be done client-side by interaction with the user.
- *
+ *
* @since 4.3
*/
public void changeCredentials()
@@ -532,7 +532,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
/**
* Server sessions may not be used to reset a user's credentials: it must
* be done client-side by interaction with an adminstrator.
- *
+ *
* @since 4.3
*/
public void resetCredentials(String userID)
@@ -1001,6 +1001,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
throw new UnsupportedOperationException();
}
+ @Deprecated
public void handleBranchNotification(InternalCDOBranch branch)
{
throw new UnsupportedOperationException();
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 0143be5..5d74292 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
@@ -17,6 +17,7 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.CDOCommonSession;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
@@ -397,11 +398,17 @@ public class Session extends Container<IView> implements InternalSession
}
}
+ @Deprecated
public void sendBranchNotification(InternalCDOBranch branch) throws Exception
{
+ sendBranchNotification(branch, ChangeKind.CREATED);
+ }
+
+ public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception
+ {
if (protocol != null)
{
- protocol.sendBranchNotification(branch);
+ protocol.sendBranchNotification(branch, changeKind);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
index fe39211..8c0a43a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java
@@ -17,6 +17,7 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.CDOCommonSession;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -268,15 +269,21 @@ public class SessionManager extends Container<ISession> implements InternalSessi
}
}
+ @Deprecated
public void sendBranchNotification(InternalSession sender, InternalCDOBranch branch)
{
+ sendBranchNotification(sender, branch, ChangeKind.CREATED);
+ }
+
+ public void sendBranchNotification(InternalSession sender, InternalCDOBranch branch, ChangeKind changeKind)
+ {
for (InternalSession session : getSessions())
{
if (session != sender)
{
try
{
- session.sendBranchNotification(branch);
+ session.sendBranchNotification(branch, changeKind);
}
catch (Exception ex)
{
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 1569e4f..03ff06f 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
@@ -138,6 +138,17 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
throw new UnsupportedOperationException();
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ throw new UnsupportedOperationException();
+ }
+
public RepositoryTimeResult getRepositoryTime()
{
RepositoryTimeResult result = new RepositoryTimeResult();
@@ -629,4 +640,5 @@ public class EmbeddedClientSessionProtocol extends Lifecycle implements CDOSessi
serverSessionProtocol = null;
super.doDeactivate();
}
+
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
index 94ecdf8..2431c84 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java
@@ -12,6 +12,7 @@
package org.eclipse.emf.cdo.internal.server.embedded;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -72,8 +73,8 @@ public class EmbeddedServerSessionProtocol extends Lifecycle implements ISession
throw new UnsupportedOperationException();
}
- public Response sendCredentialsChallenge(Challenge challenge, String userID,
- CredentialsUpdateOperation operation) throws Exception
+ public Response sendCredentialsChallenge(Challenge challenge, String userID, CredentialsUpdateOperation operation)
+ throws Exception
{
throw new UnsupportedOperationException();
}
@@ -99,8 +100,12 @@ public class EmbeddedServerSessionProtocol extends Lifecycle implements ISession
public void sendBranchNotification(InternalCDOBranch branch)
{
- EmbeddedClientSession clientSession = clientSessionProtocol.getSession();
- clientSession.handleBranchNotification(branch);
+ throw new UnsupportedOperationException();
+ }
+
+ public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception
+ {
+ throw new UnsupportedOperationException();
}
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
index 743a176..0dc8a19 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStore.java
@@ -42,7 +42,7 @@ import org.eclipse.emf.cdo.server.StoreThreadLocal;
import org.eclipse.emf.cdo.server.mem.IMEMStore;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
-import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader2;
import org.eclipse.emf.cdo.spi.common.commit.CDOChangeSetSegment;
import org.eclipse.emf.cdo.spi.common.commit.CDOCommitInfoUtil;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
@@ -96,7 +96,7 @@ import java.util.Set;
/**
* @author Simon McDuff
*/
-public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader, DurableLocking2
+public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader2, DurableLocking2
{
public static final String TYPE = "mem"; //$NON-NLS-1$
@@ -262,6 +262,20 @@ public class MEMStore extends LongIDStore implements IMEMStore, BranchLoader, Du
return count;
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ BranchInfo oldBranchInfo = branchInfos.remove(branchID);
+ BranchInfo newBranchInfo = new BranchInfo(newName, oldBranchInfo.getBaseBranchID(),
+ oldBranchInfo.getBaseTimeStamp());
+ branchInfos.put(branchID, newBranchInfo);
+ }
+
public synchronized void loadCommitInfos(final CDOBranch branch, long startTime, final long endTime,
CDOCommitInfoHandler handler)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
index d26e59f..edaff31 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/mem/MEMStoreAccessor.java
@@ -226,6 +226,11 @@ public class MEMStoreAccessor extends LongIDStoreAccessor implements Raw, Durabl
return getStore().loadBranches(startID, endID, branchHandler);
}
+ public void renameBranch(int branchID, String newName)
+ {
+ getStore().renameBranch(branchID, newName);
+ }
+
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
{
getStore().loadCommitInfos(branch, startTime, endTime, handler);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
index 0abf61f..02523c5 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/RepositorySynchronizer.java
@@ -15,7 +15,8 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.LockNotificationMode;
import org.eclipse.emf.cdo.common.CDOCommonSession.Options.PassiveUpdateMode;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -340,10 +341,17 @@ public class RepositorySynchronizer extends PriorityQueueRunner implements Inter
return;
}
- if (event instanceof CDOBranchCreatedEvent)
+ if (event instanceof CDOBranchChangedEvent)
{
- CDOBranchCreatedEvent e = (CDOBranchCreatedEvent)event;
- addWork(new BranchRunnable(e.getBranch()));
+ CDOBranchChangedEvent e = (CDOBranchChangedEvent)event;
+ if (e.getChangeKind() == ChangeKind.CREATED)
+ {
+ addWork(new BranchRunnable(e.getBranch()));
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Branch renaming not supported: " + RepositorySynchronizer.this);
+ }
}
else if (event instanceof CDOSessionInvalidationEvent)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
index 7ded592..34082fa 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java
@@ -13,6 +13,7 @@
package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -56,9 +57,18 @@ public interface ISessionProtocol extends CDOProtocol, IAuthenticationProtocol
public void sendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState,
CDOID rootResourceID) throws Exception;
+ /**
+ * @deprecated As of 4.3 use {@link #sendBranchNotification(InternalCDOBranch, ChangeKind)}.
+ */
+ @Deprecated
public void sendBranchNotification(InternalCDOBranch branch) throws Exception;
/**
+ * @since 4.3
+ */
+ public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception;
+
+ /**
* @deprecated As of 4.2 use {@link #sendCommitNotification(CDOCommitInfo, boolean)}.
*/
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
index 91ba787..a35639c 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java
@@ -28,7 +28,7 @@ import org.eclipse.emf.cdo.server.ITransaction;
import org.eclipse.emf.cdo.spi.common.CDOReplicationContext;
import org.eclipse.emf.cdo.spi.common.CDOReplicationInfo;
import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager;
-import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader2;
import org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager.CommitInfoLoader;
@@ -64,8 +64,8 @@ import java.util.concurrent.Semaphore;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface InternalRepository extends IRepository, PackageProcessor, PackageLoader, BranchLoader, RevisionLoader,
- CommitInfoLoader, CDORevisionUnchunker
+public interface InternalRepository extends IRepository, PackageProcessor, PackageLoader, BranchLoader2,
+ RevisionLoader, CommitInfoLoader, CDORevisionUnchunker
{
public void setName(String name);
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java
index f8e0411..3d9c0bc 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.CDOCommonSession;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
@@ -32,7 +33,7 @@ import java.util.Set;
* If the meaning of this type isn't clear, there really should be more of a description here...
*
* @author Eike Stepper
- * @since 3.0
+ * @since 4.3
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
@@ -80,9 +81,18 @@ public interface InternalSession extends ISession, CDOIDProvider, CDOPermissionP
public void sendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState,
CDOID rootResourceID) throws Exception;
+ /**
+ * @deprecated As of 4.3 use {@link #sendBranchNotification(InternalCDOBranch, ChangeKind)}.
+ */
+ @Deprecated
public void sendBranchNotification(InternalCDOBranch branch) throws Exception;
/**
+ * @since 4.3
+ */
+ public void sendBranchNotification(InternalCDOBranch branch, ChangeKind changeKind) throws Exception;
+
+ /**
* @deprecated As of 4.2 use {@link #sendCommitNotification(CDOCommitInfo, boolean)}.
*/
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
index cdbfaa9..9d57436 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java
@@ -13,6 +13,7 @@
package org.eclipse.emf.cdo.spi.server;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent.ChangeKind;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
@@ -83,13 +84,13 @@ public interface InternalSessionManager extends ISessionManager
/**
* Challenges the connected user to authenticate the connection.
- *
+ *
* @param sessionProtocol the authenticatable session protocol
* @return the user ID with which the user authenticated herself, or {@code null}
* if the server does not require authentication for this connection
- *
+ *
* @throws SecurityException on failure to authenticate
- *
+ *
* @since 4.3
*/
public String authenticateUser(IAuthenticationProtocol sessionProtocol) throws SecurityException;
@@ -131,9 +132,18 @@ public interface InternalSessionManager extends ISessionManager
public void sendRepositoryStateNotification(CDOCommonRepository.State oldState, CDOCommonRepository.State newState,
CDOID rootResourceID);
+ /**
+ * @deprecated As of 4.3 use {@link #sendBranchNotification(InternalSession, InternalCDOBranch, ChangeKind)}.
+ */
+ @Deprecated
public void sendBranchNotification(InternalSession sender, InternalCDOBranch branch);
/**
+ * @since 4.3
+ */
+ public void sendBranchNotification(InternalSession sender, InternalCDOBranch branch, ChangeKind changeKind);
+
+ /**
* @deprecated As of 4.2 use {@link #sendCommitNotification(InternalSession, CDOCommitInfo, boolean)}.
*/
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java
index 494dd38..4f4a049 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/BranchingTest.java
@@ -12,7 +12,7 @@ package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
@@ -130,6 +130,35 @@ public class BranchingTest extends AbstractCDOTest
session.close();
}
+ public void testRenameBranch() throws Exception
+ {
+ CDOSession session = openSession1();
+ CDOBranch mainBranch = session.getBranchManager().getMainBranch();
+ CDOBranch branch = mainBranch.createBranch("testing");
+ branch.rename("renamed");
+ closeSession1();
+
+ session = openSession2();
+ CDOBranch renamedBranch = session.getBranchManager().getBranch("MAIN/renamed");
+ assertNotNull(renamedBranch);
+
+ CDOBranch testingBranch = session.getBranchManager().getBranch("MAIN/testing");
+ assertNull(testingBranch);
+
+ try
+ {
+ session.getBranchManager().getMainBranch().rename("test");
+ fail("Main branch can't be renamed");
+ }
+ catch (Exception expected)
+ {
+ // SUCCESS
+ }
+
+ String name = session.getBranchManager().getMainBranch().getName();
+ assertEquals("Main branch can't be renamed", CDOBranch.MAIN_BRANCH_NAME, name);
+ }
+
public void testGetBranch() throws Exception
{
String name = getBranchName("testing");
@@ -183,9 +212,9 @@ public class BranchingTest extends AbstractCDOTest
{
public void notifyEvent(IEvent event)
{
- if (event instanceof CDOBranchCreatedEvent)
+ if (event instanceof CDOBranchChangedEvent)
{
- CDOBranchCreatedEvent e = (CDOBranchCreatedEvent)event;
+ CDOBranchChangedEvent e = (CDOBranchChangedEvent)event;
result.setValue(e.getBranch());
}
}
diff --git a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
index 0947772..bb4f632 100644
--- a/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui.ide/src/org/eclipse/emf/cdo/ui/ide/RepositoryContentProvider.java
@@ -13,7 +13,7 @@ package org.eclipse.emf.cdo.ui.ide;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
-import org.eclipse.emf.cdo.common.branch.CDOBranchCreatedEvent;
+import org.eclipse.emf.cdo.common.branch.CDOBranchChangedEvent;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.internal.ui.actions.OpenTransactionAction;
import org.eclipse.emf.cdo.internal.ui.actions.RemoveResourceActionDelegate;
@@ -324,7 +324,7 @@ public class RepositoryContentProvider extends StructuredContentProvider<IWorksp
{
public void notifyEvent(IEvent event)
{
- if (event instanceof CDOBranchCreatedEvent)
+ if (event instanceof CDOBranchChangedEvent)
{
refreshViewer(true);
}
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 569c27d..4aa88a6 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
@@ -896,9 +896,10 @@ public abstract class CDOSessionImpl extends CDOTransactionContainerImpl impleme
fireEvent(new RepositoryStateChangedEvent(this, oldState, newState));
}
+ @Deprecated
public void handleBranchNotification(InternalCDOBranch branch)
{
- getBranchManager().handleBranchCreated(branch);
+ throw new UnsupportedOperationException();
}
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java
index ce79962..6e18026 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/DelegatingSessionProtocol.java
@@ -549,6 +549,29 @@ public class DelegatingSessionProtocol extends Lifecycle implements CDOSessionPr
}
}
+ @Deprecated
+ public void deleteBranch(int branchID)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void renameBranch(int branchID, String newName)
+ {
+ int attempt = 0;
+ for (;;)
+ {
+ try
+ {
+ delegate.renameBranch(branchID, newName);
+ return;
+ }
+ catch (Exception ex)
+ {
+ handleException(++attempt, ex);
+ }
+ }
+ }
+
public void loadCommitInfos(CDOBranch branch, long startTime, long endTime, CDOCommitInfoHandler handler)
{
int attempt = 0;
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 2c47bfe..cf0ece6 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
@@ -39,7 +39,7 @@ import org.eclipse.emf.cdo.session.remote.CDORemoteSession;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
import org.eclipse.emf.cdo.spi.common.CDORawReplicationContext;
import org.eclipse.emf.cdo.spi.common.CDOReplicationContext;
-import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader;
+import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranchManager.BranchLoader2;
import org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo;
import org.eclipse.emf.cdo.spi.common.commit.InternalCDOCommitInfoManager.CommitInfoLoader;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry.PackageLoader;
@@ -78,7 +78,7 @@ import java.util.Set;
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
-public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLoader, RevisionLoader, CommitInfoLoader
+public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLoader2, RevisionLoader, CommitInfoLoader
{
public RepositoryTimeResult getRepositoryTime();
@@ -300,9 +300,9 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
/**
* Requests that the server initiate the change-credentials protocol.
* This is an optional session protocol operation.
- *
+ *
* @since 4.3
- *
+ *
* @throws UnsupportedOperationException if the session protocol implementation does
* not support requesting change of credentials
*/
@@ -311,11 +311,11 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
/**
* Requests that the server initiate the reset-credentials protocol.
* This is an optional session protocol operation.
- *
+ *
* @param userID the ID of the user whose credentials are to be reset
- *
+ *
* @since 4.3
- *
+ *
* @throws UnsupportedOperationException if the session protocol implementation does
* not support requesting reset of credentials
*/
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
index 4dd0cba..6d2d6b9 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOSession.java
@@ -201,7 +201,9 @@ public interface InternalCDOSession extends CDOSession, PackageProcessor, Packag
/**
* @since 3.0
+ * @deprecated As of 4.3 no longer supported.
*/
+ @Deprecated
public void handleBranchNotification(InternalCDOBranch branch);
/**