Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-04-07 07:03:21 +0000
committerEike Stepper2011-04-07 07:03:21 +0000
commit18daff40f4917cd0798856dc6ad8398c8ee0fddb (patch)
treec00a5c6ce6fc22d4dc063bcbf01c08614e87cddf /plugins/org.eclipse.emf.cdo.server.mongodb
parent889079ab082a434927b72a5a176931a4a633c0de (diff)
downloadcdo-18daff40f4917cd0798856dc6ad8398c8ee0fddb.tar.gz
cdo-18daff40f4917cd0798856dc6ad8398c8ee0fddb.tar.xz
cdo-18daff40f4917cd0798856dc6ad8398c8ee0fddb.zip
[337152] [Mongo] Create a MongoDBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337152
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.mongodb')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreFactory.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/CDOMongoDBUtil.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/IMongoDBStore.java7
4 files changed, 8 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
index 04790ac8d6..1e7e547bc5 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBBrowserPage.java
@@ -41,7 +41,7 @@ public class MongoDBBrowserPage extends AbstractPage
public void display(CDOServerBrowser browser, InternalRepository repository, PrintStream out)
{
IMongoDBStore store = (IMongoDBStore)repository.getStore();
- DB db = store.getDB();
+ DB db = (DB)store.getDB();
out.print("<table border=\"0\">\r\n");
out.print("<tr>\r\n");
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreFactory.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreFactory.java
index c90c5a2cd2..0c20fa71b6 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreFactory.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/internal/mongodb/MongoDBStoreFactory.java
@@ -62,7 +62,7 @@ public class MongoDBStoreFactory implements IStoreFactory
dropDatabase(mongoURI, dbName);
}
- return CDOMongoDBUtil.createStore(mongoURI, dbName);
+ return CDOMongoDBUtil.createStore(uri, dbName);
}
protected void dropDatabase(MongoURI mongoURI, String dbName)
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/CDOMongoDBUtil.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/CDOMongoDBUtil.java
index b8e1e85a63..9006b90afc 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/CDOMongoDBUtil.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/CDOMongoDBUtil.java
@@ -33,8 +33,9 @@ public final class CDOMongoDBUtil
container.registerFactory(new MongoDBBrowserPage.Factory());
}
- public static IMongoDBStore createStore(MongoURI mongoURI, String dbName)
+ public static IMongoDBStore createStore(String uri, String dbName)
{
+ MongoURI mongoURI = new MongoURI(uri);
MongoDBStore store = new MongoDBStore();
store.setMongoURI(mongoURI);
store.setDBName(dbName);
diff --git a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/IMongoDBStore.java b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/IMongoDBStore.java
index ba255770fb..04ed0b843b 100644
--- a/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/IMongoDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.mongodb/src/org/eclipse/emf/cdo/server/mongodb/IMongoDBStore.java
@@ -14,12 +14,13 @@ package org.eclipse.emf.cdo.server.mongodb;
import org.eclipse.emf.cdo.server.IStore;
-import com.mongodb.DB;
-
/**
* @author Eike Stepper
*/
public interface IMongoDBStore extends IStore
{
- public DB getDB();
+ /**
+ * The return value can be cast to {@link com.mongodb.DB}.
+ */
+ public Object getDB();
}

Back to the top