add comment in resource directory
authoreunok.shin <eunok.shin@samsung.com>
Wed, 28 Sep 2016 08:24:38 +0000 (17:24 +0900)
committerJee Hyeok Kim <jihyeok13.kim@samsung.com>
Wed, 28 Sep 2016 09:50:54 +0000 (09:50 +0000)
Change-Id: I32b5bfe52b860ec3671d0317cf4c59835f06507a
Signed-off-by: eunok.shin <eunok.shin@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12403
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jee Hyeok Kim <jihyeok13.kim@samsung.com>
cloud/resourcedirectory/src/main/java/org/iotivity/cloud/rdserver/db/MongoDB.java

index 8abde68..d15100c 100644 (file)
@@ -115,6 +115,15 @@ public class MongoDB {
         return db;
     }
 
+    /**
+     * API for inserting a record into DB table. the record will not be inserted
+     * if duplicated one.
+     * 
+     * @param tableName
+     *            table name to be inserted
+     * @param doc
+     *            document to be inserted
+     */
     public Boolean insertRecord(String tableName, Document doc) {
 
         if (tableName == null || doc == null)
@@ -145,6 +154,19 @@ public class MongoDB {
         return true;
     }
 
+    /**
+     * API for inserting a record into DB table. the record will be replaced if
+     * duplicated one.
+     * 
+     * @param tableName
+     *            table name to be inserted
+     * @param filter
+     *            document filter
+     * @param doc
+     *            document to be inserted
+     * @return returns true if the record is inserted and replaced successfully,
+     *         or returns false
+     */
     public Boolean insertAndReplaceRecord(String tableName, Document filter,
             Document doc) {
 
@@ -171,6 +193,18 @@ public class MongoDB {
         return true;
     }
 
+    /**
+     * API for updating a record into DB table.
+     * 
+     * @param tableName
+     *            table name to be updated
+     * @param filter
+     *            document filter
+     * @param record
+     *            record to be updated
+     * @return returns true if the record is updated successfully, or returns
+     *         false
+     */
     public Boolean updateRecord(String tableName, Document filter,
             Document record) {
 
@@ -190,6 +224,16 @@ public class MongoDB {
         return true;
     }
 
+    /**
+     * API for deleting records from DB table.
+     * 
+     * @param tableName
+     *            table name for the record to be deleted
+     * @param record
+     *            record filter to be deleted
+     * @return returns true if the record is deleted successfully, or returns
+     *         false
+     */
     public Boolean deleteRecord(String tableName, Document record) {
 
         if (tableName == null || record == null)
@@ -212,6 +256,15 @@ public class MongoDB {
         return true;
     }
 
+    /**
+     * API for selecting records from DB table.
+     * 
+     * @param tableName
+     *            table name for the record to be selected
+     * @param doc
+     *            document filter to be selected
+     * @return record list according to the filter document
+     */
     public ArrayList<HashMap<String, Object>> selectRecord(String tableName,
             Document doc) {