Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-02-29 07:01:50 +0000
committerEike Stepper2016-02-29 07:01:50 +0000
commit1e62e88b51d29a257d63eb28288b30f7fdd5fd78 (patch)
tree4e1a1f15cac88a652855a334d59b6e3ff50248ef /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf
parent91d41fb91e4f69e4d048709aaef679f03faa3a10 (diff)
downloadcdo-1e62e88b51d29a257d63eb28288b30f7fdd5fd78.tar.gz
cdo-1e62e88b51d29a257d63eb28288b30f7fdd5fd78.tar.xz
cdo-1e62e88b51d29a257d63eb28288b30f7fdd5fd78.zip
[486458] Provide support for optimized loading and notifying of object units
Propagate isSupportingUnits() to the client. https://bugs.eclipse.org/bugs/show_bug.cgi?id=486458
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java18
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java258
3 files changed, 226 insertions, 52 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
index 84704432d3..4e64aac222 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/messages/messages.properties
@@ -107,6 +107,8 @@ SessionPropertyTester_20=Supporting Audits
SessionPropertyTester_21=Whether the repository of this session is supporting auditing.
SessionPropertyTester_22=Supporting Branches
SessionPropertyTester_23=Whether the repository of this session is supporting branching.
+SessionPropertyTester_42=Supporting Units
+SessionPropertyTester_43=Whether the repository of this session is supporting units.
SessionPropertyTester_24=Store Type
SessionPropertyTester_25=The type of the store that backs the repository of this session.
SessionPropertyTester_26=Object ID Types
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
index c338a84edf..ee1fcc448a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/session/SessionProperties.java
@@ -33,7 +33,7 @@ import java.util.Set;
/**
* @author Eike Stepper
*/
-public class SessionProperties extends Properties<CDOSession>implements CDOCommonRepository
+public class SessionProperties extends Properties<CDOSession> implements CDOCommonRepository
{
public static final IProperties<CDOSession> INSTANCE = new SessionProperties();
@@ -199,6 +199,17 @@ public class SessionProperties extends Properties<CDOSession>implements CDOCommo
}
});
+ add(new Property<CDOSession>("supportingUnits", Messages.getString("SessionPropertyTester_22"), //
+ Messages.getString("SessionPropertyTester_23"), //$NON-NLS-1$
+ CATEGORY_REPOSITORY)
+ {
+ @Override
+ protected Object eval(CDOSession session)
+ {
+ return session.getRepositoryInfo().isSupportingBranches();
+ }
+ });
+
add(new Property<CDOSession>("serializeCommits", Messages.getString("SessionPropertyTester_38"), //
Messages.getString("SessionPropertyTester_39"), //$NON-NLS-1$
CATEGORY_REPOSITORY)
@@ -346,6 +357,11 @@ public class SessionProperties extends Properties<CDOSession>implements CDOCommo
throw new UnsupportedOperationException();
}
+ public boolean isSupportingUnits()
+ {
+ throw new UnsupportedOperationException();
+ }
+
@Deprecated
public boolean isSupportingEcore()
{
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 1646589626..2357cc7faf 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
@@ -14,7 +14,6 @@ package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOObjectReference;
import org.eclipse.emf.cdo.common.CDOCommonRepository;
-import org.eclipse.emf.cdo.common.CDOCommonRepository.IDGenerationLocation;
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;
@@ -64,6 +63,9 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.spi.cdo.InternalCDOTransaction.InternalCDOCommitContext;
import org.eclipse.emf.spi.cdo.InternalCDOXATransaction.InternalCDOXACommitContext;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.PlatformObject;
+
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
@@ -356,17 +358,19 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
* @since 3.0
* @noinstantiate This class is not intended to be instantiated by clients.
*/
- public final class OpenSessionResult
+ public final class OpenSessionResult extends PlatformObject implements CDOCommonRepository
{
private int sessionID;
private String userID;
- private String repositoryUUID;
+ private String uuid;
+
+ private String name;
- private CDOCommonRepository.Type repositoryType;
+ private CDOCommonRepository.Type type;
- private CDOCommonRepository.State repositoryState;
+ private CDOCommonRepository.State state;
private String storeType;
@@ -380,19 +384,21 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
private CDOID rootResourceID;
- private boolean repositoryAuthenticating;
+ private boolean authenticating;
+
+ private boolean supportingAudits;
- private boolean repositorySupportingAudits;
+ private boolean supportingBranches;
- private boolean repositorySupportingBranches;
+ private boolean supportingUnits;
- private boolean repositorySerializingCommits;
+ private boolean serializingCommits;
- private boolean repositoryEnsuringReferentialIntegrity;
+ private boolean ensuringReferentialIntegrity;
private final List<InternalCDOPackageUnit> packageUnits = new ArrayList<InternalCDOPackageUnit>();
- private IDGenerationLocation repositoryIDGenerationLocation;
+ private IDGenerationLocation idGenerationLocation;
/**
* @since 4.4
@@ -402,9 +408,10 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
this.sessionID = sessionID;
userID = in.readString();
- repositoryUUID = in.readString();
- repositoryType = in.readEnum(CDOCommonRepository.Type.class);
- repositoryState = in.readEnum(CDOCommonRepository.State.class);
+ uuid = in.readString();
+ name = in.readString();
+ type = in.readEnum(CDOCommonRepository.Type.class);
+ state = in.readEnum(CDOCommonRepository.State.class);
storeType = in.readString();
int types = in.readInt();
@@ -417,12 +424,13 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
repositoryCreationTime = in.readLong();
lastUpdateTime = in.readLong();
rootResourceID = in.readCDOID();
- repositoryAuthenticating = in.readBoolean();
- repositorySupportingAudits = in.readBoolean();
- repositorySupportingBranches = in.readBoolean();
- repositorySerializingCommits = in.readBoolean();
- repositoryEnsuringReferentialIntegrity = in.readBoolean();
- repositoryIDGenerationLocation = in.readEnum(IDGenerationLocation.class);
+ authenticating = in.readBoolean();
+ supportingAudits = in.readBoolean();
+ supportingBranches = in.readBoolean();
+ supportingUnits = in.readBoolean();
+ serializingCommits = in.readBoolean();
+ ensuringReferentialIntegrity = in.readBoolean();
+ idGenerationLocation = in.readEnum(IDGenerationLocation.class);
CDOPackageUnit[] packageUnits = in.readCDOPackageUnits(null);
for (int i = 0; i < packageUnits.length; i++)
@@ -458,25 +466,36 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
return userID;
}
- public String getRepositoryUUID()
+ /**
+ * @since 4.5
+ */
+ public String getUUID()
{
- return repositoryUUID;
+ return uuid;
}
/**
- * @since 3.0
+ * @since 4.5
*/
- public CDOCommonRepository.Type getRepositoryType()
+ public String getName()
{
- return repositoryType;
+ return name;
}
/**
- * @since 3.0
+ * @since 4.5
*/
- public CDOCommonRepository.State getRepositoryState()
+ public Type getType()
{
- return repositoryState;
+ return type;
+ }
+
+ /**
+ * @since 4.5
+ */
+ public State getState()
+ {
+ return state;
}
/**
@@ -503,63 +522,91 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
return rootResourceID;
}
- public long getRepositoryCreationTime()
+ /**
+ * @since 4.5
+ */
+ public long getCreationTime()
{
return repositoryCreationTime;
}
/**
- * @since 4.4
+ * @since 4.5
*/
- public boolean isRepositoryAuthenticating()
+ public boolean isAuthenticating()
{
- return repositoryAuthenticating;
+ return authenticating;
}
- public boolean isRepositorySupportingAudits()
+ /**
+ * @since 4.5
+ */
+ public boolean isSupportingAudits()
{
- return repositorySupportingAudits;
+ return supportingAudits;
}
/**
- * @since 3.0
+ * @since 4.5
*/
- public boolean isRepositorySupportingBranches()
+ public boolean isSupportingBranches()
+ {
+ return supportingBranches;
+ }
+
+ /**
+ * @since 4.5
+ */
+ public boolean isSupportingUnits()
{
- return repositorySupportingBranches;
+ return supportingUnits;
}
/**
+ * @since 4.5
* @deprecated As of 4.2 instances of Ecore are always supported (on demand).
*/
@Deprecated
- public boolean isRepositorySupportingEcore()
+ public boolean isSupportingEcore()
{
return true;
}
/**
- * @since 4.2
+ * @since 4.5
*/
- public boolean isRepositorySerializingCommits()
+ public boolean isSerializingCommits()
{
- return repositorySerializingCommits;
+ return serializingCommits;
}
/**
- * @since 4.0
+ * @since 4.5
*/
- public boolean isRepositoryEnsuringReferentialIntegrity()
+ public boolean isEnsuringReferentialIntegrity()
{
- return repositoryEnsuringReferentialIntegrity;
+ return ensuringReferentialIntegrity;
}
/**
- * @since 4.1
+ * @since 4.5
*/
- public IDGenerationLocation getRepositoryIDGenerationLocation()
+ public IDGenerationLocation getIDGenerationLocation()
+ {
+ return idGenerationLocation;
+ }
+
+ /**
+ * @since 3.0
+ */
+ public long getLastUpdateTime()
+ {
+ return lastUpdateTime;
+ }
+
+ public List<InternalCDOPackageUnit> getPackageUnits()
{
- return repositoryIDGenerationLocation;
+ return packageUnits;
}
public RepositoryTimeResult getRepositoryTimeResult()
@@ -573,16 +620,125 @@ public interface CDOSessionProtocol extends CDOProtocol, PackageLoader, BranchLo
}
/**
+ * @since 4.5
+ */
+ public long getTimeStamp()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @since 4.5
+ */
+ public boolean waitWhileInitial(IProgressMonitor monitor)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * @deprecated as of 4.5 use {@link #getUUID()}.
+ */
+ @Deprecated
+ public String getRepositoryUUID()
+ {
+ return getUUID();
+ }
+
+ /**
* @since 3.0
+ * @deprecated as of 4.5 use {@link #getType()}.
*/
- public long getLastUpdateTime()
+ @Deprecated
+ public CDOCommonRepository.Type getRepositoryType()
{
- return lastUpdateTime;
+ return getType();
}
- public List<InternalCDOPackageUnit> getPackageUnits()
+ /**
+ * @since 3.0
+ * @deprecated as of 4.5 use {@link #getState()}.
+ */
+ @Deprecated
+ public CDOCommonRepository.State getRepositoryState()
{
- return packageUnits;
+ return getState();
+ }
+
+ /**
+ * @deprecated as of 4.5 use {@link #getCreationTime()}.
+ */
+ @Deprecated
+ public long getRepositoryCreationTime()
+ {
+ return getCreationTime();
+ }
+
+ /**
+ * @since 4.4
+ * @deprecated as of 4.5 use {@link #isAuthenticating()}.
+ */
+ @Deprecated
+ public boolean isRepositoryAuthenticating()
+ {
+ return isAuthenticating();
+ }
+
+ /**
+ * @deprecated as of 4.5 use {@link #isSupportingAudits()}.
+ */
+ @Deprecated
+ public boolean isRepositorySupportingAudits()
+ {
+ return isSupportingAudits();
+ }
+
+ /**
+ * @since 3.0
+ * @deprecated as of 4.5 use {@link #isSupportingBranches()}.
+ */
+ @Deprecated
+ public boolean isRepositorySupportingBranches()
+ {
+ return isSupportingBranches();
+ }
+
+ /**
+ * @deprecated As of 4.2 instances of Ecore are always supported (on demand).
+ */
+ @Deprecated
+ public boolean isRepositorySupportingEcore()
+ {
+ return isSupportingEcore();
+ }
+
+ /**
+ * @since 4.2
+ * @deprecated as of 4.5 use {@link #isSerializingCommits()}.
+ */
+ @Deprecated
+ public boolean isRepositorySerializingCommits()
+ {
+ return isSerializingCommits();
+ }
+
+ /**
+ * @since 4.0
+ * @deprecated as of 4.5 use {@link #isEnsuringReferentialIntegrity()}.
+ */
+ @Deprecated
+ public boolean isRepositoryEnsuringReferentialIntegrity()
+ {
+ return isEnsuringReferentialIntegrity();
+ }
+
+ /**
+ * @since 4.1
+ * @deprecated as of 4.5 use {@link #getIDGenerationLocation()}.
+ */
+ @Deprecated
+ public IDGenerationLocation getRepositoryIDGenerationLocation()
+ {
+ return getIDGenerationLocation();
}
}

Back to the top