Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-14 12:35:37 -0400
committerEike Stepper2008-10-14 12:35:37 -0400
commit72992aa9b5e42037aa0ed7644a319b9ef0198cf7 (patch)
treed3b64aca3a2c71b743915f0ef01da164fc156ed0
parent415b9d4404403a82bd8bbeabe681d1e5c633689f (diff)
downloadcdo-72992aa9b5e42037aa0ed7644a319b9ef0198cf7.tar.gz
cdo-72992aa9b5e42037aa0ed7644a319b9ef0198cf7.tar.xz
cdo-72992aa9b5e42037aa0ed7644a319b9ef0198cf7.zip
[250809] Enhance the way stores express their capabilities
https://bugs.eclipse.org/bugs/show_bug.cgi?id=250809
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java20
-rw-r--r--plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java76
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java27
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java87
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HbStoreRepositoryProvider.java11
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithDeltaSupportTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithoutDeltaSupportTest.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_248052_Test.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java5
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java1
18 files changed, 246 insertions, 225 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
index 57c59dff40..5b521a0066 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java
@@ -67,7 +67,7 @@ public class DBStore extends LongIDStore implements IDBStore
public DBStore()
{
- super(TYPE);
+ super(TYPE, set(ChangeFormat.REVISION), set(RevisionTemporality.AUDITING), set(RevisionParallelism.NONE));
}
public IMappingStrategy getMappingStrategy()
@@ -118,24 +118,6 @@ public class DBStore extends LongIDStore implements IDBStore
}
@Override
- public boolean hasAuditingSupport()
- {
- return true;
- }
-
- @Override
- public boolean hasBranchingSupport()
- {
- return false;
- }
-
- @Override
- public boolean hasWriteDeltaSupport()
- {
- return false;
- }
-
- @Override
protected StoreAccessorPool getReaderPool(ISession session, boolean forReleasing)
{
return readerPool;
diff --git a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
index 86f94da56c..dd4ca36327 100644
--- a/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.hibernate/src/org/eclipse/emf/cdo/server/internal/hibernate/HibernateStore.java
@@ -72,7 +72,7 @@ public class HibernateStore extends Store implements IHibernateStore
public HibernateStore(IHibernateMappingProvider mappingProvider)
{
- super(TYPE);
+ super(TYPE, set(ChangeFormat.REVISION), set(RevisionTemporality.NONE), set(RevisionParallelism.NONE));
this.mappingProvider = mappingProvider;
packageHandler = new HibernatePackageHandler(this);
@@ -112,21 +112,6 @@ public class HibernateStore extends Store implements IHibernateStore
return hibernateSessionFactory;
}
- public boolean hasAuditingSupport()
- {
- return false;
- }
-
- public boolean hasBranchingSupport()
- {
- return false;
- }
-
- public boolean hasWriteDeltaSupport()
- {
- return false;
- }
-
public CDOIDObjectFactory getCDOIDObjectFactory()
{
return CDOID_OBJECT_FACTORY;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
index 14a778564b..71aeb5d033 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/LongIDStore.java
@@ -17,6 +17,8 @@ import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.spi.common.CDOIDLongFactoryImpl;
+import java.util.Set;
+
/**
* @author Eike Stepper
*/
@@ -28,29 +30,13 @@ public abstract class LongIDStore extends Store
private transient long lastObjectID;
- public LongIDStore(String type)
- {
- super(type);
- }
-
- public synchronized CDOID getNextCDOID()
- {
- return CDOIDUtil.createLong(++lastObjectID);
- }
-
- public long getLastObjectID()
- {
- return lastObjectID;
- }
-
- public void setLastObjectID(long lastObjectID)
- {
- this.lastObjectID = lastObjectID;
- }
-
- public boolean wasCrashed()
+ /**
+ * @since 2.0
+ */
+ public LongIDStore(String type, Set<ChangeFormat> supportedChangeFormats,
+ Set<RevisionTemporality> supportedRevisionTemporalities, Set<RevisionParallelism> supportedRevisionParallelisms)
{
- return lastObjectID == CRASHED;
+ super(type, supportedChangeFormats, supportedRevisionTemporalities, supportedRevisionParallelisms);
}
public CDOIDObjectFactory getCDOIDObjectFactory()
@@ -68,18 +54,23 @@ public abstract class LongIDStore extends Store
return CDOID_OBJECT_FACTORY.getLibraryHandler();
}
- public boolean hasAuditingSupport()
+ public long getLastObjectID()
+ {
+ return lastObjectID;
+ }
+
+ public void setLastObjectID(long lastObjectID)
{
- return false;
+ this.lastObjectID = lastObjectID;
}
- public boolean hasBranchingSupport()
+ public synchronized CDOID getNextCDOID()
{
- return false;
+ return CDOIDUtil.createLong(++lastObjectID);
}
- public boolean hasWriteDeltaSupport()
+ public boolean wasCrashed()
{
- return false;
+ return lastObjectID == CRASHED;
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
index b28ce43002..e91faffb83 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/MEMStore.java
@@ -46,7 +46,8 @@ public class MEMStore extends LongIDStore implements IMEMStore
*/
public MEMStore(int listLimit)
{
- super(TYPE);
+ super(TYPE, set(ChangeFormat.REVISION, ChangeFormat.DELTA), set(RevisionTemporality.NONE,
+ RevisionTemporality.AUDITING), set(RevisionParallelism.NONE));
this.listLimit = listLimit;
}
@@ -285,24 +286,6 @@ public class MEMStore extends LongIDStore implements IMEMStore
}
}
- @Override
- public boolean hasBranchingSupport()
- {
- return false;
- }
-
- @Override
- public boolean hasWriteDeltaSupport()
- {
- return true;
- }
-
- @Override
- public boolean hasAuditingSupport()
- {
- return true;
- }
-
public void repairAfterCrash()
{
// Do nothing
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 b91612ba6e..2ee339bd5c 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
@@ -57,11 +57,11 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
private Map<String, String> properties;
- private Boolean supportingRevisionDeltas;
+ private boolean supportingRevisionDeltas;
- private Boolean supportingAudits;
+ private boolean supportingAudits;
- private Boolean verifyingRevisions;
+ private boolean verifyingRevisions;
private PackageManager packageManager;
@@ -121,7 +121,7 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
{
if (uuid == null)
{
- uuid = getProperties().get(Props.PROP_OVERRIDE_UUID);
+ uuid = getProperties().get(Props.OVERRIDE_UUID);
if (uuid == null)
{
uuid = UUID.randomUUID().toString();
@@ -152,34 +152,16 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
public boolean isSupportingRevisionDeltas()
{
- if (supportingRevisionDeltas == null)
- {
- String value = getProperties().get(Props.PROP_SUPPORTING_REVISION_DELTAS);
- supportingRevisionDeltas = value == null ? false : Boolean.valueOf(value);
- }
-
return supportingRevisionDeltas;
}
public boolean isSupportingAudits()
{
- if (supportingAudits == null)
- {
- String value = getProperties().get(Props.PROP_SUPPORTING_AUDITS);
- supportingAudits = value == null ? false : Boolean.valueOf(value);
- }
-
return supportingAudits;
}
public boolean isVerifyingRevisions()
{
- if (verifyingRevisions == null)
- {
- String value = getProperties().get(Props.PROP_VERIFYING_REVISIONS);
- verifyingRevisions = value == null ? false : Boolean.valueOf(value);
- }
-
return verifyingRevisions;
}
@@ -516,12 +498,13 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
protected void doBeforeActivate() throws Exception
{
super.doBeforeActivate();
- checkArg(packageManager, "packageManager");
- checkArg(sessionManager, "sessionManager");
- checkArg(revisionManager, "revisionManager");
- checkArg(queryManager, "queryManager");
- checkArg(notificationManager, "notificationManager");
- checkArg(commitManager, "commitManager");
+ checkState(!StringUtil.isEmpty(name), "name is empty");
+ checkState(packageManager, "packageManager");
+ checkState(sessionManager, "sessionManager");
+ checkState(revisionManager, "revisionManager");
+ checkState(queryManager, "queryManager");
+ checkState(notificationManager, "notificationManager");
+ checkState(commitManager, "commitManager");
packageManager.setRepository(this);
sessionManager.setRepository(this);
@@ -530,24 +513,19 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
notificationManager.setRepository(this);
commitManager.setRepository(this);
- if (StringUtil.isEmpty(name))
- {
- throw new IllegalArgumentException("name is null or empty");
- }
-
- if (store == null)
- {
- throw new IllegalArgumentException("store is null");
- }
+ checkState(store, "store");
+ supportingRevisionDeltas = store.getSupportedChangeFormats().contains(IStore.ChangeFormat.DELTA);
- if (isSupportingRevisionDeltas() && !store.hasWriteDeltaSupport())
{
- throw new IllegalStateException("Store without revision delta support");
+ String value = getProperties().get(Props.SUPPORTING_AUDITS);
+ supportingAudits = value == null ? false : Boolean.valueOf(value);
+ store.setRevisionTemporality(supportingAudits ? IStore.RevisionTemporality.AUDITING
+ : IStore.RevisionTemporality.NONE);
}
- if (isSupportingAudits() && !store.hasAuditingSupport())
{
- throw new IllegalStateException("Store without auditing support");
+ String value = getProperties().get(Props.VERIFYING_REVISIONS);
+ verifyingRevisions = value == null ? false : Boolean.valueOf(value);
}
elements = new IRepositoryElement[] { packageManager, sessionManager, revisionManager, queryManager,
@@ -558,18 +536,6 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
protected void doActivate() throws Exception
{
super.doActivate();
- activateRepository();
- }
-
- @Override
- protected void doDeactivate() throws Exception
- {
- deactivateRepository();
- super.doDeactivate();
- }
-
- protected void activateRepository() throws Exception
- {
LifecycleUtil.activate(store);
LifecycleUtil.activate(packageManager);
if (store.wasCrashed())
@@ -588,7 +554,8 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
LifecycleUtil.activate(queryHandlerProvider);
}
- protected void deactivateRepository()
+ @Override
+ protected void doDeactivate() throws Exception
{
LifecycleUtil.deactivate(queryHandlerProvider);
LifecycleUtil.deactivate(commitManager);
@@ -599,6 +566,7 @@ public class Repository extends Container<IRepositoryElement> implements IReposi
LifecycleUtil.deactivate(packageManager);
LifecycleUtil.deactivate(store);
+ super.doDeactivate();
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
index 62206b0b4f..e3a70b746f 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Store.java
@@ -20,24 +20,32 @@ import org.eclipse.emf.cdo.server.IStoreReader;
import org.eclipse.emf.cdo.server.IStoreWriter;
import org.eclipse.emf.cdo.server.IView;
-import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
+import org.eclipse.net4j.util.StringUtil;
import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
/**
* @author Eike Stepper
*/
public abstract class Store extends Lifecycle implements IStore
{
- private String type;
+ private final String type;
- // Exclude from dump due to contained db password
- @ExcludeFromDump
- private Map<String, String> properties;
+ private final Set<ChangeFormat> supportedChangeFormats;
+
+ private final Set<RevisionTemporality> supportedRevisionTemporalities;
+
+ private final Set<RevisionParallelism> supportedRevisionParallelisms;
+
+ private RevisionTemporality revisionTemporality = RevisionTemporality.NONE;
+
+ private RevisionParallelism revisionParallelism = RevisionParallelism.NONE;
private IRepository repository;
@@ -45,39 +53,105 @@ public abstract class Store extends Lifecycle implements IStore
private CDOPathFeature resourcePathFeature;
- public Store(String type)
+ /**
+ * @since 2.0
+ */
+ public Store(String type, Set<ChangeFormat> supportedChangeFormats,
+ Set<RevisionTemporality> supportedRevisionTemporalities, Set<RevisionParallelism> supportedRevisionParallelisms)
{
+ checkArg(!StringUtil.isEmpty(type), "Empty type");
this.type = type;
+
+ checkArg(supportedChangeFormats != null && !supportedChangeFormats.isEmpty(), "Empty supportedChangeFormats");
+ this.supportedChangeFormats = supportedChangeFormats;
+
+ checkArg(supportedRevisionTemporalities != null && !supportedRevisionTemporalities.isEmpty(),
+ "Empty supportedRevisionTemporalities");
+ this.supportedRevisionTemporalities = supportedRevisionTemporalities;
+
+ checkArg(supportedRevisionParallelisms != null && !supportedRevisionParallelisms.isEmpty(),
+ "Empty supportedRevisionParallelisms");
+ this.supportedRevisionParallelisms = supportedRevisionParallelisms;
}
- public String getStoreType()
+ /**
+ * @since 2.0
+ */
+ public String getType()
{
return type;
}
- public synchronized Map<String, String> getProperties()
+ public IRepository getRepository()
{
- if (properties == null)
- {
- properties = new HashMap<String, String>();
- }
+ return repository;
+ }
- return properties;
+ public void setRepository(IRepository repository)
+ {
+ this.repository = repository;
}
- public synchronized void setProperties(Map<String, String> properties)
+ /**
+ * @since 2.0
+ */
+ public Set<ChangeFormat> getSupportedChangeFormats()
{
- this.properties = properties;
+ return supportedChangeFormats;
}
- public IRepository getRepository()
+ /**
+ * @since 2.0
+ */
+ public Set<RevisionTemporality> getSupportedRevisionTemporalities()
{
- return repository;
+ return supportedRevisionTemporalities;
}
- public void setRepository(IRepository repository)
+ /**
+ * @since 2.0
+ */
+ public Set<RevisionParallelism> getSupportedRevisionParallelisms()
{
- this.repository = repository;
+ return supportedRevisionParallelisms;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public RevisionTemporality getRevisionTemporality()
+ {
+ return revisionTemporality;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public void setRevisionTemporality(RevisionTemporality revisionTemporality)
+ {
+ checkInactive();
+ checkState(supportedRevisionTemporalities.contains(revisionTemporality), "Revision temporality not supported: "
+ + revisionTemporality);
+ this.revisionTemporality = revisionTemporality;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public RevisionParallelism getRevisionParallelism()
+ {
+ return revisionParallelism;
+ }
+
+ /**
+ * @since 2.0
+ */
+ public void setRevisionParallelism(RevisionParallelism revisionParallelism)
+ {
+ checkInactive();
+ checkState(supportedRevisionParallelisms.contains(revisionParallelism), "Revision parallelism not supported: "
+ + revisionParallelism);
+ this.revisionParallelism = revisionParallelism;
}
public long getLastMetaID()
@@ -237,4 +311,12 @@ public abstract class Store extends Lifecycle implements IStore
* {@link Lifecycle#activate() activating} the new instance.
*/
protected abstract IStoreWriter createWriter(IView view);
+
+ /**
+ * @since 2.0
+ */
+ protected static <T> Set<T> set(T... elements)
+ {
+ return Collections.unmodifiableSet(new HashSet<T>(Arrays.asList(elements)));
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
index 393a9c532c..6d1b7fce7d 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IRepository.java
@@ -159,16 +159,29 @@ public interface IRepository extends IContainer<IRepositoryElement>, IQueryHandl
*/
public interface Props
{
- public static final String PROP_OVERRIDE_UUID = "overrideUUID";
-
- public static final String PROP_SUPPORTING_REVISION_DELTAS = "supportingRevisionDeltas";
+ /**
+ * @since 2.0
+ */
+ public static final String OVERRIDE_UUID = "overrideUUID";
- public static final String PROP_SUPPORTING_AUDITS = "supportingAudits";
+ /**
+ * @since 2.0
+ */
+ public static final String SUPPORTING_AUDITS = "supportingAudits";
- public static final String PROP_VERIFYING_REVISIONS = "verifyingRevisions";
+ /**
+ * @since 2.0
+ */
+ public static final String VERIFYING_REVISIONS = "verifyingRevisions";
- public static final String PROP_CURRENT_LRU_CAPACITY = "currentLRUCapacity";
+ /**
+ * @since 2.0
+ */
+ public static final String CURRENT_LRU_CAPACITY = "currentLRUCapacity";
- public static final String PROP_REVISED_LRU_CAPACITY = "revisedLRUCapacity";
+ /**
+ * @since 2.0
+ */
+ public static final String REVISED_LRU_CAPACITY = "revisedLRUCapacity";
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
index eb6304feea..966527370a 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStore.java
@@ -13,14 +13,18 @@ package org.eclipse.emf.cdo.server;
import org.eclipse.emf.cdo.common.id.CDOIDLibraryDescriptor;
import org.eclipse.emf.cdo.common.id.CDOIDLibraryProvider;
import org.eclipse.emf.cdo.common.id.CDOIDObjectFactory;
-import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
+
+import java.util.Set;
/**
* @author Eike Stepper
*/
public interface IStore extends IRepositoryElement
{
- public String getStoreType();
+ /**
+ * @since 2.0
+ */
+ public String getType();
public CDOIDObjectFactory getCDOIDObjectFactory();
@@ -29,39 +33,39 @@ public interface IStore extends IRepositoryElement
public CDOIDLibraryProvider getCDOIDLibraryProvider();
/**
- * Returns if this store supports the writing of modified newRevisions in terms of deltas.
- * <p>
- * The contract includes that store implementations with write delta support must also implement
- * {@link IStoreWriter#writeRevisionDelta(CDORevisionDelta) IStoreWriter.writeRevisionDelta(CDORevisionDeltaImpl)} to
- * not throw an <code>UnsupportedOperationException</code>.
- *
- * @return <code>true</code> if this store supports the writing of modified newRevisions in terms of deltas,
- * <code>false</code> otherwise.
+ * @since 2.0
*/
- public boolean hasWriteDeltaSupport();
+ public Set<ChangeFormat> getSupportedChangeFormats();
/**
- * Returns if this store supports the retrieval of historical newRevisions.
- * <p>
- * The contract includes that store implementations with auditing support must also implement
- * {@link IStoreReader#readRevisionByTime(org.eclipse.emf.cdo.common.CDOID, int, long)
- * IStoreReader.readRevisionByTime(CDOID, int, long)} to not throw an <code>UnsupportedOperationException</code>.
- *
- * @return <code>true</code> if this store supports the retrieval of historical newRevisions, <code>false</code>
- * otherwise.
+ * @since 2.0
*/
- public boolean hasAuditingSupport();
+ public Set<RevisionTemporality> getSupportedRevisionTemporalities();
/**
- * Returns if this store supports the storage of concurrent newRevisions in separate branches.
- * <p>
- * <b>Note:</b> This is reserved for future use by the framework. There is currently no support for branching in the
- * framework!
- *
- * @return <code>true</code> if this store supports the storage of concurrent newRevisions in separate branches,
- * <code>false</code> otherwise.
+ * @since 2.0
+ */
+ public Set<RevisionParallelism> getSupportedRevisionParallelisms();
+
+ /**
+ * @since 2.0
+ */
+ public RevisionTemporality getRevisionTemporality();
+
+ /**
+ * @since 2.0
+ */
+ public void setRevisionTemporality(RevisionTemporality revisionTemporality);
+
+ /**
+ * @since 2.0
+ */
+ public RevisionParallelism getRevisionParallelism();
+
+ /**
+ * @since 2.0
*/
- public boolean hasBranchingSupport();
+ public void setRevisionParallelism(RevisionParallelism revisionParallelism);
public boolean wasCrashed();
@@ -104,4 +108,31 @@ public interface IStore extends IRepositoryElement
* @return a writer that can be used to write to this store in the context of the given view, never <code>null</code>.
*/
public IStoreWriter getWriter(IView view);
+
+ /**
+ * @author Eike Stepper
+ * @since 2.0
+ */
+ public enum ChangeFormat
+ {
+ REVISION, DELTA
+ }
+
+ /**
+ * @author Eike Stepper
+ * @since 2.0
+ */
+ public enum RevisionTemporality
+ {
+ NONE, AUDITING
+ }
+
+ /**
+ * @author Eike Stepper
+ * @since 2.0
+ */
+ public enum RevisionParallelism
+ {
+ NONE, BRANCHING
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HbStoreRepositoryProvider.java b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HbStoreRepositoryProvider.java
index 5b9c91e9f5..b3cda9f441 100644
--- a/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HbStoreRepositoryProvider.java
+++ b/plugins/org.eclipse.emf.cdo.tests.hibernate/src/org/eclipse/emf/cdo/tests/hibernate/HbStoreRepositoryProvider.java
@@ -51,12 +51,11 @@ public class HbStoreRepositoryProvider extends StoreRepositoryProvider
setLogging();
Map<String, String> props = new HashMap<String, String>();
- props.put(Props.PROP_OVERRIDE_UUID, "f8188187-65de-4c8a-8e75-e0ce5949837a");
- props.put(Props.PROP_SUPPORTING_AUDITS, "false");
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "false");
- props.put(Props.PROP_VERIFYING_REVISIONS, "false");
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ props.put(Props.OVERRIDE_UUID, "f8188187-65de-4c8a-8e75-e0ce5949837a");
+ props.put(Props.SUPPORTING_AUDITS, "false");
+ props.put(Props.VERIFYING_REVISIONS, "false");
+ props.put(Props.CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.REVISED_LRU_CAPACITY, "10000");
addHibernateTeneoProperties(props);
// override with the test properties
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
index 4feaa75332..7a91455474 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AuditTest.java
@@ -34,7 +34,7 @@ public class AuditTest extends AbstractCDOTest
public Map<String, Object> getTestProperties()
{
Map<String, Object> testProperties = super.getTestProperties();
- testProperties.put(IRepository.Props.PROP_SUPPORTING_AUDITS, "true");
+ testProperties.put(IRepository.Props.SUPPORTING_AUDITS, "true");
return testProperties;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java
index cddb3ef7df..81c3d322d1 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ImportXML.java
@@ -79,9 +79,8 @@ public class ImportXML
private static IRepository createRepository()
{
Map<String, String> props = new HashMap<String, String>();
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ props.put(Props.CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.REVISED_LRU_CAPACITY, "10000");
return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithDeltaSupportTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithDeltaSupportTest.java
index 86566ddb1c..cd8a838b48 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithDeltaSupportTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithDeltaSupportTest.java
@@ -11,7 +11,6 @@
**************************************************************************/
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.tests.config.RepositoryConfig;
import java.util.Map;
@@ -26,7 +25,6 @@ public class RevisionDeltaWithDeltaSupportTest extends RevisionDeltaTest
public Map<String, Object> getTestProperties()
{
Map<String, Object> testProperties = super.getTestProperties();
- testProperties.put(IRepository.Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
testProperties.put(RepositoryConfig.PROP_TEST_REVISION_MANAGER, new TestRevisionManager());
return testProperties;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithoutDeltaSupportTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithoutDeltaSupportTest.java
index f57e5d5620..eb5ce2ee37 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithoutDeltaSupportTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/RevisionDeltaWithoutDeltaSupportTest.java
@@ -11,7 +11,6 @@
**************************************************************************/
package org.eclipse.emf.cdo.tests;
-import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.tests.config.RepositoryConfig;
import java.util.Map;
@@ -26,7 +25,6 @@ public class RevisionDeltaWithoutDeltaSupportTest extends RevisionDeltaTest
public Map<String, Object> getTestProperties()
{
Map<String, Object> testProperties = super.getTestProperties();
- testProperties.put(IRepository.Props.PROP_SUPPORTING_REVISION_DELTAS, "false");
testProperties.put(RepositoryConfig.PROP_TEST_REVISION_MANAGER, new TestRevisionManager());
return testProperties;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java
index 4738c406ff..5e747ae325 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/StoreRepositoryProvider.java
@@ -45,9 +45,8 @@ public class StoreRepositoryProvider
protected IRepository createRepository(String name, Map<String, String> testProperties)
{
Map<String, String> props = new HashMap<String, String>();
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ props.put(Props.CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.REVISED_LRU_CAPACITY, "10000");
props.putAll(testProperties);
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_248052_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_248052_Test.java
index 45e914e39a..2cd82758fe 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_248052_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_248052_Test.java
@@ -37,8 +37,7 @@ public class Bugzilla_248052_Test extends AbstractCDOTest
public Map<String, Object> getTestProperties()
{
Map<String, Object> testProperties = super.getTestProperties();
- testProperties.put(IRepository.Props.PROP_SUPPORTING_REVISION_DELTAS, "false");
- testProperties.put(IRepository.Props.PROP_SUPPORTING_AUDITS, "false");
+ testProperties.put(IRepository.Props.SUPPORTING_AUDITS, "false");
return testProperties;
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
index 5d787a02b8..015f597573 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/config/RepositoryConfig.java
@@ -110,9 +110,9 @@ public abstract class RepositoryConfig extends Config implements RepositoryProvi
protected void initRepositoryProperties(Map<String, String> props)
{
- props.put(Props.PROP_OVERRIDE_UUID, ""); // UUID := name !!!
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ props.put(Props.OVERRIDE_UUID, ""); // UUID := name !!!
+ props.put(Props.CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.REVISED_LRU_CAPACITY, "10000");
}
@Override
@@ -153,11 +153,6 @@ public abstract class RepositoryConfig extends Config implements RepositoryProvi
}
Map<String, String> props = getRepositoryProperties();
- if (store.hasWriteDeltaSupport())
- {
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "true");
- }
-
Repository repository = (Repository)CDOServerUtil.createRepository(name, store, props);
RevisionManager revisionManager = getTestRevisionManager();
if (revisionManager != null)
@@ -378,9 +373,8 @@ public abstract class RepositoryConfig extends Config implements RepositoryProvi
protected void initRepositoryProperties(Map<String, String> props)
{
super.initRepositoryProperties(props);
- props.put(Props.PROP_SUPPORTING_AUDITS, "false");
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, "false");
- props.put(Props.PROP_VERIFYING_REVISIONS, "false");
+ props.put(Props.SUPPORTING_AUDITS, "false");
+ props.put(Props.VERIFYING_REVISIONS, "false");
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
index b28774a492..ab02956d97 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/store/logic/TestLogic.java
@@ -81,9 +81,8 @@ public abstract class TestLogic extends AbstractOMTest
protected Repository createRepository()
{
Map<String, String> props = new HashMap<String, String>();
- props.put(Props.PROP_SUPPORTING_REVISION_DELTAS, Boolean.toString(withRevisionDeltaSupport()));
- props.put(Props.PROP_CURRENT_LRU_CAPACITY, "10000");
- props.put(Props.PROP_REVISED_LRU_CAPACITY, "10000");
+ props.put(Props.CURRENT_LRU_CAPACITY, "10000");
+ props.put(Props.REVISED_LRU_CAPACITY, "10000");
Map<String, String> testProperties = getTestProperties();
if (testProperties != null)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index d6a68033ba..48f16f4cda 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -700,6 +700,7 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
{
reviseObject(object, timeStamp);
}
+
changeState(object, CDOState.PROXY);
}

Back to the top