Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-09-27 09:28:33 +0000
committerEike Stepper2013-09-29 09:40:31 +0000
commit48c07bf1f2acc05313f6f4b3bfaee8db208b1d66 (patch)
tree482a121fa8d603ac3e0a3016a0ee52cff685b66b /plugins/org.eclipse.emf.cdo.server
parent5f0ddac06df136a2a0b7c46fe33400386da92a53 (diff)
downloadcdo-48c07bf1f2acc05313f6f4b3bfaee8db208b1d66.tar.gz
cdo-48c07bf1f2acc05313f6f4b3bfaee8db208b1d66.tar.xz
cdo-48c07bf1f2acc05313f6f4b3bfaee8db208b1d66.zip
[418267] [Security] Cached permissions are not always properly updated
after commits https://bugs.eclipse.org/bugs/show_bug.cgi?id=418267
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server')
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/Repository.java10
-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.java282
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/SessionManager.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java36
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/embedded/EmbeddedServerSessionProtocol.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IPermissionManager.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/ISessionProtocol.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalRepository.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSession.java7
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalSessionManager.java7
14 files changed, 253 insertions, 157 deletions
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 7a29c97536..736e11e076 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
@@ -36,12 +36,12 @@ import org.eclipse.emf.cdo.common.lock.CDOLockUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.common.revision.delta.CDOContainerFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOFeatureDelta;
@@ -1046,16 +1046,16 @@ public class Repository extends Container<Object> implements InternalRepository
@Deprecated
public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache)
{
- sendCommitNotification(sender, commitInfo, clearResourcePathCache, null);
+ throw new UnsupportedOperationException();
}
- public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- CDORevisionProvider revisionProvider)
+ public void sendCommitNotification(CommitNotificationInfo info)
{
+ CDOCommitInfo commitInfo = info.getCommitInfo();
boolean isFailureCommitInfo = commitInfo.getBranch() == null;
if (isFailureCommitInfo || !commitInfo.isEmpty())
{
- sessionManager.sendCommitNotification(sender, commitInfo, clearResourcePathCache, revisionProvider);
+ sessionManager.sendCommitNotification(info);
commitInfoManager.notifyCommitInfoHandlers(commitInfo);
}
}
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 26e6b31855..75b3189233 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
@@ -23,6 +23,7 @@ import org.eclipse.emf.cdo.common.lob.CDOLobStore;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
import org.eclipse.emf.cdo.common.lock.CDOLockState;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
@@ -950,7 +951,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
}
public void invalidate(CDOCommitInfo commitInfo, InternalCDOTransaction sender, boolean clearResourcePathCache,
- Map<CDOID, CDOPermission> permissions)
+ boolean clearPermissionCache, Map<CDOID, CDOPermission> permissions)
{
throw new UnsupportedOperationException();
}
@@ -967,7 +968,7 @@ public class ServerCDOView extends AbstractCDOView implements org.eclipse.emf.cd
throw new UnsupportedOperationException();
}
- public void handleCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache, Set<CDOID> readOnly)
+ public void handleCommitNotification(CommitNotificationInfo info)
{
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 2d6b8d4049..a0e1968f32 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
@@ -22,6 +22,7 @@ import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
@@ -59,8 +60,8 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.core.runtime.Platform;
import java.text.MessageFormat;
-import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -407,17 +408,16 @@ public class Session extends Container<IView> implements InternalSession
@Deprecated
public void sendCommitNotification(CDOCommitInfo commitInfo) throws Exception
{
- sendCommitNotification(commitInfo, true);
+ throw new UnsupportedOperationException();
}
@Deprecated
public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache) throws Exception
{
- sendCommitNotification(commitInfo, true, null);
+ throw new UnsupportedOperationException();
}
- public void sendCommitNotification(final CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- final CDORevisionProvider revisionProvider) throws Exception
+ public void sendCommitNotification(CommitNotificationInfo notificationInfo) throws Exception
{
if (protocol == null)
{
@@ -429,123 +429,34 @@ public class Session extends Container<IView> implements InternalSession
return;
}
- final IPermissionManager permissionManager = manager.getPermissionManager();
- final Set<CDOID> readOnly = new HashSet<CDOID>();
- final InternalView[] views = getViews();
-
- protocol.sendCommitNotification(new DelegatingCommitInfo()
+ byte securityImpact = notificationInfo.getSecurityImpact();
+ if (securityImpact == CommitNotificationInfo.IMPACT_PERMISSIONS)
{
- private final PassiveUpdateMode passiveUpdateMode = getPassiveUpdateMode();
-
- private final boolean additions = passiveUpdateMode == PassiveUpdateMode.ADDITIONS;
+ IPermissionManager permissionManager = manager.getPermissionManager();
+ Set<? extends Object> impactedRules = notificationInfo.getImpactedRules();
- private final boolean changes = passiveUpdateMode == PassiveUpdateMode.CHANGES;
-
- @Override
- protected CDOCommitInfo getDelegate()
+ if (!permissionManager.hasAnyRule(this, impactedRules))
{
- return commitInfo;
- }
-
- @Override
- public List<CDOIDAndVersion> getNewObjects()
- {
- final List<CDOIDAndVersion> newObjects = super.getNewObjects();
- return new IndexedList<CDOIDAndVersion>()
- {
- @Override
- public CDOIDAndVersion get(int index)
- {
- CDORevision revision = (CDORevision)newObjects.get(index);
- if (additions)
- {
- if (permissionManager == null)
- {
- // Return full revision
- return revision;
- }
-
- CDOPermission permission = permissionManager.getPermission(revision, commitInfo, Session.this);
- if (permission != CDOPermission.NONE)
- {
- if (permission == CDOPermission.READ)
- {
- readOnly.add(revision.getID());
- }
-
- // Return full revision
- return revision;
- }
- }
-
- // Prevent sending full revision by copying the id and version
- return CDOIDUtil.createIDAndVersion(revision);
- }
-
- @Override
- public int size()
- {
- return newObjects.size();
- }
- };
+ securityImpact = CommitNotificationInfo.IMPACT_NONE;
}
+ }
- @Override
- public List<CDORevisionKey> getChangedObjects()
- {
- final List<CDORevisionKey> changedObjects = super.getChangedObjects();
- return new IndexedList<CDORevisionKey>()
- {
- @Override
- public CDORevisionKey get(int index)
- {
- CDORevisionDelta revisionDelta = (CDORevisionDelta)changedObjects.get(index);
- CDOID id = revisionDelta.getID();
+ CommitInfo sessionCommitInfo = new CommitInfo(notificationInfo);
- if (changes || additions || hasSubscription(id, views))
- {
- if (permissionManager == null)
- {
- // Return full delta
- return revisionDelta;
- }
-
- if (revisionProvider == null)
- {
- // Return full delta
- return revisionDelta;
- }
-
- CDORevision newRevision = revisionProvider.getRevision(id);
- CDOPermission permission = permissionManager.getPermission(newRevision, commitInfo, Session.this);
- if (permission != CDOPermission.NONE)
- {
- if (permission == CDOPermission.READ)
- {
- readOnly.add(id);
- }
-
- // Return full delta
- return revisionDelta;
- }
- }
+ CommitNotificationInfo sessionNotificationInfo = new CommitNotificationInfo();
+ sessionNotificationInfo.setSender(notificationInfo.getSender());
+ sessionNotificationInfo.setCommitInfo(sessionCommitInfo);
+ sessionNotificationInfo.setRevisionProvider(notificationInfo.getRevisionProvider());
+ sessionNotificationInfo.setClearResourcePathCache(notificationInfo.isClearResourcePathCache());
+ sessionNotificationInfo.setNewPermissions(sessionCommitInfo.getNewPermissions());
+ sessionNotificationInfo.setSecurityImpact(securityImpact);
- // Prevent sending full delta by copying the id and version
- return CDORevisionUtil.copyRevisionKey(revisionDelta);
- }
-
- @Override
- public int size()
- {
- return changedObjects.size();
- }
- };
- }
- }, clearResourcePathCache, readOnly);
+ protocol.sendCommitNotification(sessionNotificationInfo);
synchronized (lastUpdateTimeLock)
{
- lastUpdateTime = commitInfo.getTimeStamp();
+ CDOCommitInfo originalCommitInfo = notificationInfo.getCommitInfo();
+ lastUpdateTime = originalCommitInfo.getTimeStamp();
}
}
@@ -654,4 +565,151 @@ public class Session extends Container<IView> implements InternalSession
manager = null;
super.doDeactivate();
}
+
+ /**
+ * @author Eike Stepper
+ */
+ private final class CommitInfo extends DelegatingCommitInfo
+ {
+ private final CDOCommitInfo delegate;
+
+ private final CDORevisionProvider revisionProvider;
+
+ private final InternalView[] views;
+
+ private final IPermissionManager permissionManager;
+
+ private final Map<CDOID, CDOPermission> newPermissions;
+
+ private final boolean additions;
+
+ private final boolean changes;
+
+ public CommitInfo(CommitNotificationInfo notificationInfo)
+ {
+ delegate = notificationInfo.getCommitInfo();
+ revisionProvider = notificationInfo.getRevisionProvider();
+
+ views = getViews();
+ permissionManager = manager.getPermissionManager();
+ if (permissionManager != null)
+ {
+ newPermissions = CDOIDUtil.createMap();
+ }
+ else
+ {
+ newPermissions = null;
+ }
+
+ PassiveUpdateMode passiveUpdateMode = getPassiveUpdateMode();
+ additions = passiveUpdateMode == PassiveUpdateMode.ADDITIONS;
+ changes = additions || passiveUpdateMode == PassiveUpdateMode.CHANGES;
+ }
+
+ @Override
+ protected CDOCommitInfo getDelegate()
+ {
+ return delegate;
+ }
+
+ protected void addNewPermission(CDOID id, CDOPermission permission)
+ {
+ newPermissions.put(id, permission);
+ }
+
+ public Map<CDOID, CDOPermission> getNewPermissions()
+ {
+ return newPermissions;
+ }
+
+ @Override
+ public List<CDOIDAndVersion> getNewObjects()
+ {
+ final List<CDOIDAndVersion> newObjects = super.getNewObjects();
+ return new IndexedList<CDOIDAndVersion>()
+ {
+ @Override
+ public CDOIDAndVersion get(int index)
+ {
+ CDORevision revision = (CDORevision)newObjects.get(index);
+ if (additions)
+ {
+ if (permissionManager == null)
+ {
+ // Return full revision
+ return revision;
+ }
+
+ CDOPermission permission = permissionManager.getPermission(revision, delegate, Session.this);
+ CDOID id = revision.getID();
+ addNewPermission(id, permission);
+
+ if (permission != CDOPermission.NONE)
+ {
+ // Return full revision
+ return revision;
+ }
+ }
+
+ // Prevent sending full revision by copying the id and version
+ return CDOIDUtil.createIDAndVersion(revision);
+ }
+
+ @Override
+ public int size()
+ {
+ return newObjects.size();
+ }
+ };
+ }
+
+ @Override
+ public List<CDORevisionKey> getChangedObjects()
+ {
+ final List<CDORevisionKey> changedObjects = super.getChangedObjects();
+ return new IndexedList<CDORevisionKey>()
+ {
+ @Override
+ public CDORevisionKey get(int index)
+ {
+ CDORevisionDelta revisionDelta = (CDORevisionDelta)changedObjects.get(index);
+ CDOID id = revisionDelta.getID();
+
+ if (changes || hasSubscription(id, views))
+ {
+ if (permissionManager == null)
+ {
+ // Return full delta
+ return revisionDelta;
+ }
+
+ if (revisionProvider == null)
+ {
+ // Return full delta
+ return revisionDelta;
+ }
+
+ CDORevision newRevision = revisionProvider.getRevision(id);
+ CDOPermission permission = permissionManager.getPermission(newRevision, delegate, Session.this);
+ addNewPermission(id, permission);
+
+ if (permission != CDOPermission.NONE)
+ {
+ // Return full delta
+ return revisionDelta;
+ }
+ }
+
+ // Prevent sending full delta by copying the id and version
+ return CDORevisionUtil.copyRevisionKey(revisionDelta);
+ }
+
+ @Override
+ public int size()
+ {
+ return changedObjects.size();
+ }
+ };
+ }
+ }
}
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 f4444d53f2..11c168bc33 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
@@ -13,12 +13,13 @@
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.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
import org.eclipse.emf.cdo.common.util.NotAuthenticatedException;
import org.eclipse.emf.cdo.internal.server.bundle.OM;
import org.eclipse.emf.cdo.server.IPermissionManager;
@@ -283,25 +284,25 @@ public class SessionManager extends Container<ISession> implements InternalSessi
@Deprecated
public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo)
{
- sendCommitNotification(sender, commitInfo, true);
+ throw new UnsupportedOperationException();
}
@Deprecated
public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache)
{
- sendCommitNotification(sender, commitInfo, true, null);
+ throw new UnsupportedOperationException();
}
- public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- CDORevisionProvider revisionProvider)
+ public void sendCommitNotification(CommitNotificationInfo info)
{
+ CDOCommonSession sender = info.getSender();
for (InternalSession session : getSessions())
{
if (session != sender)
{
try
{
- session.sendCommitNotification(commitInfo, clearResourcePathCache, revisionProvider);
+ session.sendCommitNotification(info);
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
index 8f2acf818c..d4c16c6af9 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/TransactionCommitContext.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.cdo.common.lock.CDOLockOwner;
import org.eclipse.emf.cdo.common.lock.CDOLockState;
import org.eclipse.emf.cdo.common.lock.CDOLockUtil;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
@@ -66,7 +67,6 @@ import org.eclipse.emf.cdo.spi.common.revision.StubCDORevision;
import org.eclipse.emf.cdo.spi.server.InternalCommitContext;
import org.eclipse.emf.cdo.spi.server.InternalLockManager;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
-import org.eclipse.emf.cdo.spi.server.InternalSession;
import org.eclipse.emf.cdo.spi.server.InternalTransaction;
import org.eclipse.net4j.util.CheckUtil;
@@ -132,8 +132,6 @@ public class TransactionCommitContext implements InternalCommitContext
private String commitComment;
- private boolean clearResourcePathCache;
-
private boolean usingEcore;
private boolean usingEtypes;
@@ -186,6 +184,8 @@ public class TransactionCommitContext implements InternalCommitContext
private Map<Object, Object> data;
+ private CommitNotificationInfo commitNotificationInfo = new CommitNotificationInfo();
+
public TransactionCommitContext(InternalTransaction transaction)
{
this.transaction = transaction;
@@ -257,7 +257,12 @@ public class TransactionCommitContext implements InternalCommitContext
public boolean isClearResourcePathCache()
{
- return clearResourcePathCache;
+ return commitNotificationInfo.isClearResourcePathCache();
+ }
+
+ public boolean isClearPermissionCache()
+ {
+ return commitNotificationInfo.getSecurityImpact() != CommitNotificationInfo.IMPACT_NONE;
}
public boolean isUsingEcore()
@@ -473,7 +478,13 @@ public class TransactionCommitContext implements InternalCommitContext
public void setClearResourcePathCache(boolean clearResourcePathCache)
{
- this.clearResourcePathCache = clearResourcePathCache;
+ commitNotificationInfo.setClearResourcePathCache(clearResourcePathCache);
+ }
+
+ public void setSecurityImpact(byte securityImpact, Set<? extends Object> impactedRules)
+ {
+ commitNotificationInfo.setSecurityImpact(securityImpact);
+ commitNotificationInfo.setImpactedRules(impactedRules);
}
public void setUsingEcore(boolean usingEcore)
@@ -803,10 +814,19 @@ public class TransactionCommitContext implements InternalCommitContext
private void sendCommitNotifications(boolean success)
{
- InternalSession sender = transaction.getSession();
- CDOCommitInfo commitInfo = success ? createCommitInfo() : createFailureCommitInfo();
+ commitNotificationInfo.setSender(transaction.getSession());
+ commitNotificationInfo.setRevisionProvider(this);
+
+ if (success)
+ {
+ commitNotificationInfo.setCommitInfo(createCommitInfo());
+ }
+ else
+ {
+ commitNotificationInfo.setCommitInfo(createFailureCommitInfo());
+ }
- repository.sendCommitNotification(sender, commitInfo, clearResourcePathCache, this);
+ repository.sendCommitNotification(commitNotificationInfo);
}
public CDOCommitInfo createCommitInfo()
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 ea68f0d544..4430eb417f 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
@@ -24,8 +24,6 @@ import org.eclipse.net4j.util.lifecycle.Lifecycle;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
-import java.util.Set;
-
/**
* @author Eike Stepper
* @deprecated Not yet supported.
@@ -110,8 +108,7 @@ public class EmbeddedServerSessionProtocol extends Lifecycle implements ISession
throw new UnsupportedOperationException();
}
- public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache, Set<CDOID> readOnly)
- throws Exception
+ public void sendCommitNotification(CommitNotificationInfo info) throws Exception
{
throw new UnsupportedOperationException();
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
index a2d026950f..240f59b4de 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/syncing/SynchronizableRepository.java
@@ -32,6 +32,7 @@ import org.eclipse.emf.cdo.common.lock.CDOLockUtil;
import org.eclipse.emf.cdo.common.lock.IDurableLockingManager.LockArea;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
@@ -449,9 +450,15 @@ public abstract class SynchronizableRepository extends Repository.Default implem
CDOCommitData data = CDOCommitInfoUtil.createCommitData(newPackages, newObjects, changedObjects, detachedObjects);
String comment = "<replicate raw commits>"; //$NON-NLS-1$
- CDOCommitInfo commitInfo = manager.createCommitInfo(branch, toCommitTime, previousCommitTime, SYSTEM_USER_ID,
- comment, data);
- sessionManager.sendCommitNotification(replicatorSession, commitInfo, true, null);
+ final CDOCommitInfo commitInfo = manager.createCommitInfo( //
+ branch, toCommitTime, previousCommitTime, SYSTEM_USER_ID, comment, data);
+
+ CommitNotificationInfo info = new CommitNotificationInfo();
+ info.setSender(replicatorSession);
+ info.setCommitInfo(commitInfo);
+ info.setClearResourcePathCache(true);
+
+ sessionManager.sendCommitNotification(info);
}
CDOLockChangeInfo lockChangeInfo = CDOLockUtil.createLockChangeInfo();
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IPermissionManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IPermissionManager.java
index f07e7f3def..f8bf88db81 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IPermissionManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IPermissionManager.java
@@ -14,6 +14,8 @@ import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.security.CDOPermission;
+import java.util.Set;
+
/**
* Provides the protection level of {@link CDORevision revisions} in the context of a specific user.
*
@@ -34,4 +36,9 @@ public interface IPermissionManager
* @since 4.2
*/
public CDOPermission getPermission(CDORevision revision, CDOBranchPoint securityContext, ISession session);
+
+ /**
+ * @since 4.3
+ */
+ public boolean hasAnyRule(ISession session, Set<? extends Object> rules);
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
index e28716723a..11bab73187 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreAccessor.java
@@ -329,6 +329,11 @@ public interface IStoreAccessor extends IQueryHandlerProvider, BranchLoader, Com
public boolean isClearResourcePathCache();
/**
+ * @since 4.3
+ */
+ public boolean isClearPermissionCache();
+
+ /**
* @since 4.2
*/
public boolean isUsingEcore();
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 be490f99e0..6199122f0c 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
@@ -21,8 +21,6 @@ import org.eclipse.emf.cdo.spi.common.branch.InternalCDOBranch;
import org.eclipse.net4j.util.security.DiffieHellman.Client.Response;
import org.eclipse.net4j.util.security.DiffieHellman.Server.Challenge;
-import java.util.Set;
-
/**
* If the meaning of this type isn't clear, there really should be more of a description here...
*
@@ -72,7 +70,7 @@ public interface ISessionProtocol extends CDOProtocol
/**
* @since 4.2
- * @deprecated As of 4.3 use {@link #sendCommitNotification(CDOCommitInfo, boolean, Set)}.
+ * @deprecated As of 4.3 use {@link #sendCommitNotification(CommitNotificationInfo)}.
*/
@Deprecated
public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache) throws Exception;
@@ -80,8 +78,7 @@ public interface ISessionProtocol extends CDOProtocol
/**
* @since 4.3
*/
- public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache, Set<CDOID> readOnly)
- throws Exception;
+ public void sendCommitNotification(CommitNotificationInfo info) throws Exception;
public void sendRemoteSessionNotification(InternalSession sender, byte opcode) throws Exception;
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
index fe37f0445e..15cf8925ab 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/spi/server/InternalCommitContext.java
@@ -26,6 +26,7 @@ import org.eclipse.net4j.util.om.monitor.ProgressDistributor;
import org.eclipse.emf.ecore.EClass;
import java.util.Map;
+import java.util.Set;
/**
* If the meaning of this type isn't clear, there really should be more of a description here...
@@ -144,4 +145,9 @@ public interface InternalCommitContext extends IStoreAccessor.CommitContext
public void addIDMapping(CDOID oldID, CDOID newID);
public void applyIDMappings(OMMonitor monitor);
+
+ /**
+ * @since 4.3
+ */
+ public void setSecurityImpact(byte securityImpact, Set<? extends Object> impactedRules);
}
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 4b42ddfabf..91ba787ff7 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
@@ -17,10 +17,10 @@ import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lob.CDOLobHandler;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionHandler;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
import org.eclipse.emf.cdo.server.IQueryHandlerProvider;
import org.eclipse.emf.cdo.server.IRepository;
import org.eclipse.emf.cdo.server.IStoreAccessor;
@@ -181,7 +181,7 @@ public interface InternalRepository extends IRepository, PackageProcessor, Packa
/**
* @since 4.2
- * @deprecated As of 4.3 use {@link #sendCommitNotification(InternalSession, CDOCommitInfo, boolean, CDORevisionProvider)}.
+ * @deprecated As of 4.3 use {@link #sendCommitNotification(ISessionProtocol.CommitNotificationInfo)}.
*/
@Deprecated
public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache);
@@ -189,8 +189,7 @@ public interface InternalRepository extends IRepository, PackageProcessor, Packa
/**
* @since 4.3
*/
- public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- CDORevisionProvider revisionProvider);
+ public void sendCommitNotification(CommitNotificationInfo info);
public void setRootResourceID(CDOID rootResourceID);
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 6063004af6..cb8370f125 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
@@ -17,8 +17,8 @@ import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.common.revision.CDORevision;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
import org.eclipse.emf.cdo.common.security.CDOPermissionProvider;
import org.eclipse.emf.cdo.server.ISession;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
@@ -90,7 +90,7 @@ public interface InternalSession extends ISession, CDOIDProvider, CDOPermissionP
/**
* @since 4.2
- * @deprecated As of 4.3 use {@link #sendCommitNotification(CDOCommitInfo, boolean, CDORevisionProvider)}.
+ * @deprecated As of 4.3 use {@link #sendCommitNotification(CommitNotificationInfo)}.
*/
@Deprecated
public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache) throws Exception;
@@ -98,8 +98,7 @@ public interface InternalSession extends ISession, CDOIDProvider, CDOPermissionP
/**
* @since 4.3
*/
- public void sendCommitNotification(CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- CDORevisionProvider revisionProvider) throws Exception;
+ public void sendCommitNotification(CommitNotificationInfo info) throws Exception;
public void sendRemoteSessionNotification(InternalSession sender, byte opcode) throws Exception;
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 4d406f04d1..afb5bcdcc9 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
@@ -14,7 +14,7 @@ import org.eclipse.emf.cdo.common.CDOCommonRepository;
import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.lock.CDOLockChangeInfo;
-import org.eclipse.emf.cdo.common.revision.CDORevisionProvider;
+import org.eclipse.emf.cdo.common.protocol.CDOProtocol.CommitNotificationInfo;
import org.eclipse.emf.cdo.server.IPermissionManager;
import org.eclipse.emf.cdo.server.ISessionManager;
import org.eclipse.emf.cdo.session.remote.CDORemoteSessionMessage;
@@ -110,7 +110,7 @@ public interface InternalSessionManager extends ISessionManager
/**
* @since 4.2
- * @deprecated As of 4.3 use {@link #sendCommitNotification(InternalSession, CDOCommitInfo, boolean, CDORevisionProvider)}.
+ * @deprecated As of 4.3 use {@link #sendCommitNotification(ISessionProtocol.CommitNotificationInfo)}.
*/
@Deprecated
public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache);
@@ -118,8 +118,7 @@ public interface InternalSessionManager extends ISessionManager
/**
* @since 4.3
*/
- public void sendCommitNotification(InternalSession sender, CDOCommitInfo commitInfo, boolean clearResourcePathCache,
- CDORevisionProvider revisionProvider);
+ public void sendCommitNotification(CommitNotificationInfo info);
/**
* @since 4.1

Back to the top