Change database components to include appname instead of hostname in the database keys.

git-svn-id: https://svn.apache.org/repos/asf/incubator/nuvem/trunk@1301970 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/nuvem-parallel/nuvem/app.py b/nuvem-parallel/nuvem/app.py
new file mode 100644
index 0000000..d17ca78
--- /dev/null
+++ b/nuvem-parallel/nuvem/app.py
@@ -0,0 +1,20 @@
+#  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.
+
+def get(r, prop):
+    return prop.eval()
+
diff --git a/nuvem-parallel/nuvem/filedb.py b/nuvem-parallel/nuvem/filedb.py
index a5816d1..8b69665 100644
--- a/nuvem-parallel/nuvem/filedb.py
+++ b/nuvem-parallel/nuvem/filedb.py
@@ -15,15 +15,15 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, db, host):
-    return db.get((host.eval(),) + id)
+def get(id, db, appname):
+    return db.get(("'filedb", appname.eval()) + id)
 
-def post(id, val, db, host):
-    return db.post((host.eval(),) + id, val)
+def post(id, val, db, appname):
+    return db.post(("'filedb", appname.eval()) + id, val)
 
-def put(id, val, db, host):
-    return db.put((host.eval(),) + id, val)
+def put(id, val, db, appname):
+    return db.put(("'filedb", appname.eval()) + id, val)
 
-def delete(id, db, host):
-    return db.delete((host.eval(),) + id)
+def delete(id, db, appname):
+    return db.delete(("'filedb", appname.eval()) + id)
 
diff --git a/nuvem-parallel/nuvem/nosqldb.py b/nuvem-parallel/nuvem/nosqldb.py
index 041321c..6458940 100644
--- a/nuvem-parallel/nuvem/nosqldb.py
+++ b/nuvem-parallel/nuvem/nosqldb.py
@@ -15,15 +15,15 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, db, host):
-    return db.get((host.eval(),) + id);
+def get(id, db, appname):
+    return db.get(("'nosqldb", appname.eval()) + id);
 
-def post(id, val, db, host):
-    return db.post((host.eval(),) + id, val);
+def post(id, val, db, appname):
+    return db.post(("'nosqldb", appname.eval()) + id, val);
 
-def put(id, val, db, host):
-    return db.put((host.eval(),) + id, val);
+def put(id, val, db, appname):
+    return db.put(("'nosqldb", appname.eval()) + id, val);
 
-def delete(id, db, host):
-    return db.delete((host.eval(),) + id);
+def delete(id, db, appname):
+    return db.delete(("'nosqldb", appname.eval()) + id);
 
diff --git a/nuvem-parallel/nuvem/sqldb.py b/nuvem-parallel/nuvem/sqldb.py
index 041321c..184d83a 100644
--- a/nuvem-parallel/nuvem/sqldb.py
+++ b/nuvem-parallel/nuvem/sqldb.py
@@ -15,15 +15,15 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-def get(id, db, host):
-    return db.get((host.eval(),) + id);
+def get(id, db, appname):
+    return db.get(("'sqldb", appname.eval()) + id);
 
-def post(id, val, db, host):
-    return db.post((host.eval(),) + id, val);
+def post(id, val, db, appname):
+    return db.post(("'sqldb", appname.eval()) + id, val);
 
-def put(id, val, db, host):
-    return db.put((host.eval(),) + id, val);
+def put(id, val, db, appname):
+    return db.put(("'sqldb", appname.eval()) + id, val);
 
-def delete(id, db, host):
-    return db.delete((host.eval(),) + id);
+def delete(id, db, appname):
+    return db.delete(("'sqldb", appname.eval()) + id);