summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-16 10:37:22 (EDT)
committerEike Stepper2007-08-16 10:37:22 (EDT)
commit12519fe81c08ea733343dffc7d05f0e0281adb51 (patch)
treeea299e2f7b18d5e54459c47e3b0067164ca1a1e6
parent3e1b65f3fe98c57ca7bb5dcd2224818296c04b6b (diff)
downloadcdo-12519fe81c08ea733343dffc7d05f0e0281adb51.zip
cdo-12519fe81c08ea733343dffc7d05f0e0281adb51.tar.gz
cdo-12519fe81c08ea733343dffc7d05f0e0281adb51.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java16
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java41
5 files changed, 21 insertions, 79 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
index d511f77..183c50b 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreReader.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOTypeImpl;
import org.eclipse.emf.cdo.protocol.CDOID;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import org.eclipse.emf.cdo.server.IStoreReader;
@@ -73,33 +74,19 @@ public class DBStoreReader implements IStoreReader
return store;
}
- public Collection<PackageInfo> readPackageInfos()
+ public Collection<CDOPackageInfo> readPackageInfos()
{
- final Collection<PackageInfo> result = new ArrayList(0);
+ final Collection<CDOPackageInfo> result = new ArrayList(0);
IDBRowHandler rowHandler = new IDBRowHandler()
{
public boolean handle(int row, final Object... values)
{
- result.add(new PackageInfo()
- {
- public String getPackageURI()
- {
- return (String)values[0];
- }
-
- public boolean isDynamic()
- {
- return values[1] != null;
- }
-
- public CDOIDRange getMetaIDRange()
- {
- long rangeLB = (Long)values[2];
- long rangeUB = (Long)values[3];
- return CDOIDRangeImpl.create(rangeLB, rangeUB);
- }
- });
-
+ String packageURI = (String)values[0];
+ boolean dynamic = values[1] != null;
+ long rangeLB = (Long)values[2];
+ long rangeUB = (Long)values[3];
+ CDOIDRange metaIDRange = CDOIDRangeImpl.create(rangeLB, rangeUB);
+ result.add(new CDOPackageInfo(packageURI, dynamic, metaIDRange));
return true;
}
};
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
index 8aa96b2..6f3de93 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/internal/server/PackageManager.java
@@ -12,10 +12,10 @@ package org.eclipse.emf.cdo.internal.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
+import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.server.IPackageManager;
import org.eclipse.emf.cdo.server.IStoreReader;
import org.eclipse.emf.cdo.server.IStoreWriter;
-import org.eclipse.emf.cdo.server.IStoreReader.PackageInfo;
import org.eclipse.net4j.util.transaction.ITransaction;
import org.eclipse.net4j.util.transaction.ITransactionalOperation;
@@ -70,8 +70,8 @@ public class PackageManager extends CDOPackageManagerImpl implements IPackageMan
{
super.doActivate();
IStoreReader storeReader = repository.getStore().getReader();
- Collection<PackageInfo> packageInfos = storeReader.readPackageInfos();
- for (PackageInfo info : packageInfos)
+ Collection<CDOPackageInfo> packageInfos = storeReader.readPackageInfos();
+ for (CDOPackageInfo info : packageInfos)
{
addPackage(new CDOPackageImpl(this, info.getPackageURI(), info.isDynamic(), info.getMetaIDRange()));
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
index 3a1b288..a95c259 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/IStoreReader.java
@@ -13,8 +13,8 @@ package org.eclipse.emf.cdo.server;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.server.StoreUtil;
import org.eclipse.emf.cdo.protocol.CDOID;
-import org.eclipse.emf.cdo.protocol.CDOIDRange;
import org.eclipse.emf.cdo.protocol.model.CDOClassRef;
+import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
import java.util.Collection;
@@ -25,7 +25,7 @@ import java.util.Collection;
*/
public interface IStoreReader extends IStoreAccessor
{
- public Collection<PackageInfo> readPackageInfos();
+ public Collection<CDOPackageInfo> readPackageInfos();
/**
* Demand loads a given package proxy that has been created on startup of the
@@ -43,16 +43,4 @@ public interface IStoreReader extends IStoreAccessor
public CDORevision readRevision(CDOID id, long timeStamp);
public CDOClassRef readObjectType(CDOID id);
-
- /**
- * @author Eike Stepper
- */
- public interface PackageInfo
- {
- public String getPackageURI();
-
- public boolean isDynamic();
-
- public CDOIDRange getMetaIDRange();
- }
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
index 8817e81..a2dce90 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOSessionPackageManager.java
@@ -13,13 +13,13 @@ package org.eclipse.emf.internal.cdo;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.CDOPackageManagerImpl;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import org.eclipse.emf.cdo.protocol.util.TransportException;
import org.eclipse.emf.cdo.util.EMFUtil;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.protocol.LoadPackageRequest;
-import org.eclipse.emf.internal.cdo.protocol.OpenSessionResult.PackageInfo;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
import java.util.Collection;
@@ -42,9 +42,9 @@ public class CDOSessionPackageManager extends CDOPackageManagerImpl
return session;
}
- public void addPackageProxies(Collection<PackageInfo> packageInfos)
+ public void addPackageProxies(Collection<CDOPackageInfo> packageInfos)
{
- for (PackageInfo info : packageInfos)
+ for (CDOPackageInfo info : packageInfos)
{
String packageURI = info.getPackageURI();
boolean dynamic = info.isDynamic();
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
index c00cd78..34115d7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/protocol/OpenSessionResult.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.internal.cdo.protocol;
import org.eclipse.emf.cdo.protocol.CDOIDRange;
+import org.eclipse.emf.cdo.protocol.model.CDOPackageInfo;
import java.util.ArrayList;
import java.util.List;
@@ -24,7 +25,7 @@ public final class OpenSessionResult
private String repositoryUUID;
- private List<PackageInfo> packageInfos = new ArrayList();
+ private List<CDOPackageInfo> packageInfos = new ArrayList();
public OpenSessionResult(int sessionID, String repositoryUUID)
{
@@ -42,47 +43,13 @@ public final class OpenSessionResult
return repositoryUUID;
}
- public List<PackageInfo> getPackageInfos()
+ public List<CDOPackageInfo> getPackageInfos()
{
return packageInfos;
}
void addPackageInfo(String packageURI, boolean dynamic, CDOIDRange metaIDRange)
{
- packageInfos.add(new PackageInfo(packageURI, dynamic, metaIDRange));
- }
-
- /**
- * @author Eike Stepper
- */
- public static final class PackageInfo
- {
- private String packageURI;
-
- private boolean dynamic;
-
- private CDOIDRange metaIDRange;
-
- public PackageInfo(String packageURI, boolean dynamic, CDOIDRange metaIDRange)
- {
- this.packageURI = packageURI;
- this.dynamic = dynamic;
- this.metaIDRange = metaIDRange;
- }
-
- public String getPackageURI()
- {
- return packageURI;
- }
-
- public boolean isDynamic()
- {
- return dynamic;
- }
-
- public CDOIDRange getMetaIDRange()
- {
- return metaIDRange;
- }
+ packageInfos.add(new CDOPackageInfo(packageURI, dynamic, metaIDRange));
}
}