summaryrefslogtreecommitdiffstats
path: root/collaboration/GSoC-2011-Eranda/couchdb/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'collaboration/GSoC-2011-Eranda/couchdb/src/main')
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Database.java60
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Group.java64
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Session.java62
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/SessionFactory.java22
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBDatatabase.java16
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBGroup.java47
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBSession.java33
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DatabaseNotFoundException.java26
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DuplicateEntryException.java25
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/EntryNotFoundException.java25
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/GroupNotFoundException.java25
-rw-r--r--collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/SessionException.java25
12 files changed, 315 insertions, 115 deletions
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Database.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Database.java
index ad80b06f04..8dfdee5356 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Database.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Database.java
@@ -1,26 +1,34 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.nosqldatastore;
-
-public interface Database {
- Group createGroup(String groupId);
- Group getGroup(String groupId);
- void deleteGroup(String groupId);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore;
+
+import org.apache.tuscany.nosqldatastore.exception.GroupNotFoundException;
+
+/*
+Database:
+Use to manipulate the groups, where groups are use to categorize the data
+1. Creating a group
+2. Retrieving a group
+3. Deleting a group
+*/
+public interface Database {
+ Group createGroup(String groupId);
+ Group getGroup(String groupId);
+ void deleteGroup(String groupId) throws GroupNotFoundException;
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Group.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Group.java
index 634ab59cf0..78eeffc383 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Group.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Group.java
@@ -1,27 +1,37 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.nosqldatastore;
-
-public interface Group {
- void addEntry(String key, Object value);
- void updateEntry(String key, Object value);
- void deleteEntry(String key);
- Object getValue(String key);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore;
+
+import org.apache.tuscany.nosqldatastore.exception.DuplicateEntryException;
+import org.apache.tuscany.nosqldatastore.exception.EntryNotFoundException;
+
+/*
+Group:
+Group use to categorize the data into different categories
+1. Add entry to the database
+2. Update an existing entry
+3. Delete an existing entry
+4. Get a existing entry
+ */
+public interface Group {
+ void addEntry(String key, String value) throws DuplicateEntryException;
+ void updateEntry(String key, String value) throws EntryNotFoundException;
+ void deleteEntry(String key) throws EntryNotFoundException;
+ String getEntry(String key) throws EntryNotFoundException;
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Session.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Session.java
index 5aa9641715..3d2b93cc4b 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Session.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/Session.java
@@ -1,26 +1,36 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.nosqldatastore;
-
-public interface Session {
- Database createDatabase(String databaseName);
- Database getDatabase(String databaseName);
- void deleteDatabase(String databaseName);
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore;
+
+import org.apache.tuscany.nosqldatastore.exception.DatabaseNotFoundException;
+import org.apache.tuscany.nosqldatastore.exception.GroupNotFoundException;
+import org.apache.tuscany.nosqldatastore.exception.SessionException;
+
+/*
+Session:
+Session is a database session use to access the database
+1. Create a database
+2. Get instance of existing database
+3. Delete a database
+*/
+public interface Session {
+ Database createDatabase(String databaseName) throws SessionException;
+ Database getDatabase(String databaseName) throws SessionException;
+ void deleteDatabase(String databaseName) throws DatabaseNotFoundException, SessionException;
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/SessionFactory.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/SessionFactory.java
index 2438adf228..534a6905c4 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/SessionFactory.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/SessionFactory.java
@@ -22,15 +22,15 @@ package org.apache.tuscany.nosqldatastore;
import org.apache.tuscany.nosqldatastore.couchdb.CouchDBSession;
public class SessionFactory {
-
- private static org.apache.tuscany.nosqldatastore.Session session;
-
- private SessionFactory(){
- }
-
- public static Session getCouchDBSession(){
- session = new CouchDBSession();
- return session;
- }
-
+
+ private org.apache.tuscany.nosqldatastore.Session session;
+
+ public SessionFactory(){
+ }
+
+ public Session getCouchDBSession(){
+ session = new CouchDBSession("couchdb");
+ return session;
+ }
+
}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBDatatabase.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBDatatabase.java
index 20e426a1c4..2e6cbc92e6 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBDatatabase.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBDatatabase.java
@@ -21,23 +21,25 @@ package org.apache.tuscany.nosqldatastore.couchdb;
import org.apache.tuscany.nosqldatastore.Database;
import org.apache.tuscany.nosqldatastore.Group;
+import org.apache.tuscany.nosqldatastore.exception.GroupNotFoundException;
import org.jcouchdb.db.Server;
import org.jcouchdb.document.DesignDocument;
+import org.jcouchdb.exception.CouchDBException;
public class CouchDBDatatabase implements Database{
private org.jcouchdb.db.Database db;
private String dbname;
- CouchDBDatatabase(String dbname){
+ CouchDBDatatabase(String dbname) throws CouchDBException{
this.dbname = dbname;
db = new org.jcouchdb.db.Database("localhost",dbname);
Server server = db.getServer();
if(!server.listDatabases().contains(dbname)){
server.createDatabase(dbname);
- System.out.println("New database created...");
+ return;
}
-
+ System.out.println("Connect to the existing database...");
}
public Group createGroup(String groupId) {
@@ -50,8 +52,12 @@ public class CouchDBDatatabase implements Database{
return group;
}
- public void deleteGroup(String groupId) {
+ public void deleteGroup(String groupId) throws GroupNotFoundException{
DesignDocument doc = db.getDesignDocument(groupId);
- db.delete(doc);
+ if(doc != null){
+ db.delete(doc);
+ return;
+ }
+ throw new GroupNotFoundException("Group does not exists "+groupId);
}
}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBGroup.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBGroup.java
index 2590dacc0c..485e87149d 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBGroup.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBGroup.java
@@ -20,6 +20,8 @@
package org.apache.tuscany.nosqldatastore.couchdb;
import org.apache.tuscany.nosqldatastore.Group;
+import org.apache.tuscany.nosqldatastore.exception.DuplicateEntryException;
+import org.apache.tuscany.nosqldatastore.exception.EntryNotFoundException;
import org.jcouchdb.document.DesignDocument;
import org.jcouchdb.document.DocumentHelper;
import org.jcouchdb.exception.UpdateConflictException;
@@ -42,33 +44,52 @@ public class CouchDBGroup implements Group {
try{
database.createOrUpdateDocument(doc);
}catch(UpdateConflictException e){
- System.out.println("Connect to the doc "+groupId);
+ System.out.println("Connect to the doc "+groupId);
}
}
- public void addEntry(String key, Object value) {
+ public void addEntry(String key, String value) throws DuplicateEntryException {
DesignDocument doc = database.getDesignDocument(groupId);
Map<String, String> lists = doc.getListFunctions();
- lists.put(key, (String)value);
- doc.setListFunctions(lists);
- database.updateDocument(doc);
+ if(!lists.containsKey(key)){
+ lists.put(key, value);
+ doc.setListFunctions(lists);
+ database.updateDocument(doc);
+ return;
+ }
+ throw new DuplicateEntryException("Entry already exist for key "+key);
}
- public void updateEntry(String key, Object value) {
- addEntry(key, value);
+ public void updateEntry(String key, String value) throws EntryNotFoundException{
+ DesignDocument doc = database.getDesignDocument(groupId);
+ Map<String, String> lists = doc.getListFunctions();
+ if(lists.containsKey(key)){
+ lists.put(key, value);
+ doc.setListFunctions(lists);
+ database.updateDocument(doc);
+ return;
+ }
+ throw new EntryNotFoundException("Entry does not exist for key "+key);
}
- public void deleteEntry(String key) {
+ public void deleteEntry(String key) throws EntryNotFoundException {
DesignDocument doc = database.getDesignDocument(groupId);
Map<String, String> lists = doc.getListFunctions();
- lists.remove(key);
- doc.setListFunctions(lists);
- database.updateDocument(doc);
+ if(lists.containsKey(key)){
+ lists.remove(key);
+ doc.setListFunctions(lists);
+ database.updateDocument(doc);
+ return;
+ }
+ throw new EntryNotFoundException("Entry does not exist for key "+key);
}
- public Object getValue(String key) {
+ public String getEntry(String key) throws EntryNotFoundException {
DesignDocument doc = database.getDesignDocument(groupId);
Map<String, String> lists = doc.getListFunctions();
- return lists.get(key);
+ if(lists.containsKey(key)){
+ return lists.get(key);
+ }
+ throw new EntryNotFoundException("Entry does not exist for key "+key);
}
}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBSession.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBSession.java
index 3805d03283..add2e258ff 100644
--- a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBSession.java
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/couchdb/CouchDBSession.java
@@ -21,25 +21,44 @@ package org.apache.tuscany.nosqldatastore.couchdb;
import org.apache.tuscany.nosqldatastore.Database;
import org.apache.tuscany.nosqldatastore.Session;
+import org.apache.tuscany.nosqldatastore.exception.DatabaseNotFoundException;
+import org.apache.tuscany.nosqldatastore.exception.SessionException;
import org.jcouchdb.db.Server;
+import org.jcouchdb.exception.CouchDBException;
public class CouchDBSession implements Session{
- public CouchDBSession(){
+ private String sessionName;
+
+ public CouchDBSession(String name){
+ sessionName = name;
}
- public Database createDatabase(String databaseName) {
- Database database = new CouchDBDatatabase(databaseName);
+ public Database createDatabase(String databaseName) throws SessionException {
+ Database database = null;
+ try{
+ database = new CouchDBDatatabase(databaseName);
+ } catch(CouchDBException e){
+ throw new SessionException("Session error");
+ }
return database;
}
- public Database getDatabase(String databaseName) {
- Database database = new CouchDBDatatabase(databaseName);
+ public Database getDatabase(String databaseName) throws SessionException {
+ Database database = createDatabase(databaseName);
return database;
}
- public void deleteDatabase(String databaseName) {
+ public void deleteDatabase(String databaseName) throws SessionException, DatabaseNotFoundException {
org.jcouchdb.db.Database db = new org.jcouchdb.db.Database("localhost",databaseName);
- db.getServer().deleteDatabase(databaseName);
+ if(db.getServer().listDatabases().contains(databaseName)){
+ try{
+ db.getServer().deleteDatabase(databaseName);
+ } catch(CouchDBException e){
+ throw new SessionException("Session error");
+ }
+ } else {
+ throw new DatabaseNotFoundException("Database "+databaseName+" not found");
+ }
}
}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DatabaseNotFoundException.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DatabaseNotFoundException.java
new file mode 100644
index 0000000000..871d0ac7ed
--- /dev/null
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DatabaseNotFoundException.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore.exception;
+
+public class DatabaseNotFoundException extends Exception{
+
+ public DatabaseNotFoundException(String msg){
+ super(msg);
+ }
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DuplicateEntryException.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DuplicateEntryException.java
new file mode 100644
index 0000000000..4bd19fcd99
--- /dev/null
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/DuplicateEntryException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore.exception;
+
+public class DuplicateEntryException extends Exception{
+ public DuplicateEntryException(String msg) {
+ super(msg);
+ }
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/EntryNotFoundException.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/EntryNotFoundException.java
new file mode 100644
index 0000000000..f2f459d200
--- /dev/null
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/EntryNotFoundException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore.exception;
+
+public class EntryNotFoundException extends Exception{
+ public EntryNotFoundException(String msg) {
+ super(msg);
+ }
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/GroupNotFoundException.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/GroupNotFoundException.java
new file mode 100644
index 0000000000..70f5326745
--- /dev/null
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/GroupNotFoundException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore.exception;
+
+public class GroupNotFoundException extends Exception{
+ public GroupNotFoundException(String msg){
+ super(msg);
+ }
+}
diff --git a/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/SessionException.java b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/SessionException.java
new file mode 100644
index 0000000000..016c7e6264
--- /dev/null
+++ b/collaboration/GSoC-2011-Eranda/couchdb/src/main/java/org/apache/tuscany/nosqldatastore/exception/SessionException.java
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.nosqldatastore.exception;
+
+public class SessionException extends Exception{
+ public SessionException(String msg){
+ super(msg);
+ }
+}