{"action":"created","comment":{"url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/comments/204204163","pull_request_review_id":139250746,"id":204204163,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDIwNDE2Mw==","diff_hunk":"@@ -0,0 +1,66 @@\n+package org.sunbird.init.dao.impl;\n+\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import java.io.IOException;\n+import java.util.List;\n+import java.util.Map;\n+import org.apache.commons.collections.CollectionUtils;\n+import org.sunbird.cassandra.CassandraOperation;\n+import org.sunbird.common.models.response.Response;\n+import org.sunbird.common.models.util.JsonKey;\n+import org.sunbird.common.models.util.ProjectLogger;\n+import org.sunbird.helper.ServiceFactory;\n+import org.sunbird.init.dao.SystemSettingDao;\n+import org.sunbird.init.model.SystemSetting;\n+\n+/**\n+ * This class implements the cassandra db operation DAO methods (insert,read) for system settings\n+ *\n+ * @author Loganathan\n+ */\n+public class SystemSettingDaoImpl implements SystemSettingDao {\n+\n+  private CassandraOperation cassandraOperation = ServiceFactory.getInstance();\n+  private ObjectMapper mapper = new ObjectMapper();\n+  private static final String KEYSPACE_NAME = JsonKey.SUNBIRD;\n+  private static final String TABLE_NAME = JsonKey.SYSTEM_SETTINGS_DB;\n+\n+  /**\n+   * This methods inserts the given settings record into cassandra table through CassandraOperation\n+   * methods\n+   *\n+   * @param systemSetting instance of SystemSetting class conatins elements like id,field,value\n+   * @return response instance of Response class returned by CassandraOperation insert method\n+   */\n+  @Override\n+  public Response write(SystemSetting systemSetting) {\n+    Map<String, Object> map = mapper.convertValue(systemSetting, Map.class);\n+    Response response = cassandraOperation.insertRecord(KEYSPACE_NAME, TABLE_NAME, map);\n+    response.put(JsonKey.ID, map.get(JsonKey.ID));\n+    return response;\n+  }\n+\n+  /**\n+   * This methods fetch the settings record using given id from cassandra table through\n+   * CassandraOperation methods\n+   *\n+   * @param id id of the settings record to be fetched\n+   * @return instance of SystemSetting class with mapped field values(id,field,value) from cassandra\n+   *     table\n+   */\n+  @Override\n+  public SystemSetting readById(String id) {\n+    Response response = cassandraOperation.getRecordById(KEYSPACE_NAME, TABLE_NAME, id);\n+    List<Map<String, Object>> list = (List<Map<String, Object>>) response.get(JsonKey.RESPONSE);\n+    if (CollectionUtils.isEmpty(list)) {\n+      return null;\n+    }\n+    try {\n+      String jsonString = mapper.writeValueAsString((Map<String, Object>) list.get(0));\n+      return mapper.readValue(jsonString, SystemSetting.class);\n+    } catch (IOException e) {\n+      ProjectLogger.log(e.getMessage(), e);","path":"actors/init/src/main/java/org/sunbird/init/dao/impl/SystemSettingDaoImpl.java","position":62,"original_position":62,"commit_id":"37201352bd7fd5e920862aa64594439300f02d2e","original_commit_id":"37201352bd7fd5e920862aa64594439300f02d2e","user":{"login":"kochhar","id":103850,"node_id":"MDQ6VXNlcjEwMzg1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/103850?v=4","gravatar_id":"","url":"https://api.github.com/users/kochhar","html_url":"https://github.com/kochhar","followers_url":"https://api.github.com/users/kochhar/followers","following_url":"https://api.github.com/users/kochhar/following{/other_user}","gists_url":"https://api.github.com/users/kochhar/gists{/gist_id}","starred_url":"https://api.github.com/users/kochhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kochhar/subscriptions","organizations_url":"https://api.github.com/users/kochhar/orgs","repos_url":"https://api.github.com/users/kochhar/repos","events_url":"https://api.github.com/users/kochhar/events{/privacy}","received_events_url":"https://api.github.com/users/kochhar/received_events","type":"User","site_admin":false},"body":"Is this wise? Swallowing exceptions will give false success value...","created_at":"2018-07-21T06:47:43Z","updated_at":"2018-07-21T06:49:04Z","html_url":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85#discussion_r204204163","pull_request_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/comments/204204163"},"html":{"href":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85#discussion_r204204163"},"pull_request":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85"}}},"pull_request":{"url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85","id":200575914,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNTc1OTE0","html_url":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85","diff_url":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85.diff","patch_url":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85.patch","issue_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/85","number":85,"state":"open","locked":false,"title":"Issue #SB-4881 feat: Initialise API actor impl.","user":{"login":"loganathan1989","id":27200774,"node_id":"MDQ6VXNlcjI3MjAwNzc0","avatar_url":"https://avatars3.githubusercontent.com/u/27200774?v=4","gravatar_id":"","url":"https://api.github.com/users/loganathan1989","html_url":"https://github.com/loganathan1989","followers_url":"https://api.github.com/users/loganathan1989/followers","following_url":"https://api.github.com/users/loganathan1989/following{/other_user}","gists_url":"https://api.github.com/users/loganathan1989/gists{/gist_id}","starred_url":"https://api.github.com/users/loganathan1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganathan1989/subscriptions","organizations_url":"https://api.github.com/users/loganathan1989/orgs","repos_url":"https://api.github.com/users/loganathan1989/repos","events_url":"https://api.github.com/users/loganathan1989/events{/privacy}","received_events_url":"https://api.github.com/users/loganathan1989/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-07-11T03:14:19Z","updated_at":"2018-07-21T06:49:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d9b016af5043ded3cabb7d4a5359a2a8ce8c5ebd","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85/commits","review_comments_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85/comments","review_comment_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/comments{/number}","comments_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/85/comments","statuses_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/statuses/37201352bd7fd5e920862aa64594439300f02d2e","head":{"label":"loganathan1989:SB-4881-initalise-api","ref":"SB-4881-initalise-api","sha":"37201352bd7fd5e920862aa64594439300f02d2e","user":{"login":"loganathan1989","id":27200774,"node_id":"MDQ6VXNlcjI3MjAwNzc0","avatar_url":"https://avatars3.githubusercontent.com/u/27200774?v=4","gravatar_id":"","url":"https://api.github.com/users/loganathan1989","html_url":"https://github.com/loganathan1989","followers_url":"https://api.github.com/users/loganathan1989/followers","following_url":"https://api.github.com/users/loganathan1989/following{/other_user}","gists_url":"https://api.github.com/users/loganathan1989/gists{/gist_id}","starred_url":"https://api.github.com/users/loganathan1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganathan1989/subscriptions","organizations_url":"https://api.github.com/users/loganathan1989/orgs","repos_url":"https://api.github.com/users/loganathan1989/repos","events_url":"https://api.github.com/users/loganathan1989/events{/privacy}","received_events_url":"https://api.github.com/users/loganathan1989/received_events","type":"User","site_admin":false},"repo":{"id":139046716,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwNDY3MTY=","name":"sunbird-lms-mw","full_name":"loganathan1989/sunbird-lms-mw","owner":{"login":"loganathan1989","id":27200774,"node_id":"MDQ6VXNlcjI3MjAwNzc0","avatar_url":"https://avatars3.githubusercontent.com/u/27200774?v=4","gravatar_id":"","url":"https://api.github.com/users/loganathan1989","html_url":"https://github.com/loganathan1989","followers_url":"https://api.github.com/users/loganathan1989/followers","following_url":"https://api.github.com/users/loganathan1989/following{/other_user}","gists_url":"https://api.github.com/users/loganathan1989/gists{/gist_id}","starred_url":"https://api.github.com/users/loganathan1989/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganathan1989/subscriptions","organizations_url":"https://api.github.com/users/loganathan1989/orgs","repos_url":"https://api.github.com/users/loganathan1989/repos","events_url":"https://api.github.com/users/loganathan1989/events{/privacy}","received_events_url":"https://api.github.com/users/loganathan1989/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/loganathan1989/sunbird-lms-mw","description":"Middleware components of Sunbird learning management system","fork":true,"url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw","forks_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/forks","keys_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/teams","hooks_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/hooks","issue_events_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/issues/events{/number}","events_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/events","assignees_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/assignees{/user}","branches_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/branches{/branch}","tags_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/tags","blobs_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/git/refs{/sha}","trees_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/statuses/{sha}","languages_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/languages","stargazers_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/stargazers","contributors_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/contributors","subscribers_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/subscribers","subscription_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/subscription","commits_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/commits{/sha}","git_commits_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/git/commits{/sha}","comments_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/comments{/number}","issue_comment_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/issues/comments{/number}","contents_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/contents/{+path}","compare_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/merges","archive_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/downloads","issues_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/issues{/number}","pulls_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/pulls{/number}","milestones_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/milestones{/number}","notifications_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/labels{/name}","releases_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/releases{/id}","deployments_url":"https://api.github.com/repos/loganathan1989/sunbird-lms-mw/deployments","created_at":"2018-06-28T17:02:15Z","updated_at":"2018-06-28T17:02:17Z","pushed_at":"2018-07-19T04:37:35Z","git_url":"git://github.com/loganathan1989/sunbird-lms-mw.git","ssh_url":"git@github.com:loganathan1989/sunbird-lms-mw.git","clone_url":"https://github.com/loganathan1989/sunbird-lms-mw.git","svn_url":"https://github.com/loganathan1989/sunbird-lms-mw","homepage":null,"size":10207,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"project-sunbird:release-1.9","ref":"release-1.9","sha":"2c8b4002e6a74630f726346a085dd7a234a0faa2","user":{"login":"project-sunbird","id":26705730,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2NzA1NzMw","avatar_url":"https://avatars1.githubusercontent.com/u/26705730?v=4","gravatar_id":"","url":"https://api.github.com/users/project-sunbird","html_url":"https://github.com/project-sunbird","followers_url":"https://api.github.com/users/project-sunbird/followers","following_url":"https://api.github.com/users/project-sunbird/following{/other_user}","gists_url":"https://api.github.com/users/project-sunbird/gists{/gist_id}","starred_url":"https://api.github.com/users/project-sunbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-sunbird/subscriptions","organizations_url":"https://api.github.com/users/project-sunbird/orgs","repos_url":"https://api.github.com/users/project-sunbird/repos","events_url":"https://api.github.com/users/project-sunbird/events{/privacy}","received_events_url":"https://api.github.com/users/project-sunbird/received_events","type":"Organization","site_admin":false},"repo":{"id":96122408,"node_id":"MDEwOlJlcG9zaXRvcnk5NjEyMjQwOA==","name":"sunbird-lms-mw","full_name":"project-sunbird/sunbird-lms-mw","owner":{"login":"project-sunbird","id":26705730,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2NzA1NzMw","avatar_url":"https://avatars1.githubusercontent.com/u/26705730?v=4","gravatar_id":"","url":"https://api.github.com/users/project-sunbird","html_url":"https://github.com/project-sunbird","followers_url":"https://api.github.com/users/project-sunbird/followers","following_url":"https://api.github.com/users/project-sunbird/following{/other_user}","gists_url":"https://api.github.com/users/project-sunbird/gists{/gist_id}","starred_url":"https://api.github.com/users/project-sunbird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/project-sunbird/subscriptions","organizations_url":"https://api.github.com/users/project-sunbird/orgs","repos_url":"https://api.github.com/users/project-sunbird/repos","events_url":"https://api.github.com/users/project-sunbird/events{/privacy}","received_events_url":"https://api.github.com/users/project-sunbird/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/project-sunbird/sunbird-lms-mw","description":"Middleware components of Sunbird learning management system","fork":false,"url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw","forks_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/forks","keys_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/keys{/key_id}","collaborators_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/teams","hooks_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/hooks","issue_events_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/events{/number}","events_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/events","assignees_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/assignees{/user}","branches_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/branches{/branch}","tags_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/tags","blobs_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/git/refs{/sha}","trees_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/git/trees{/sha}","statuses_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/statuses/{sha}","languages_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/languages","stargazers_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/stargazers","contributors_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/contributors","subscribers_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/subscribers","subscription_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/subscription","commits_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/commits{/sha}","git_commits_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/git/commits{/sha}","comments_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/comments{/number}","issue_comment_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/comments{/number}","contents_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/contents/{+path}","compare_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/compare/{base}...{head}","merges_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/merges","archive_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/downloads","issues_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues{/number}","pulls_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls{/number}","milestones_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/milestones{/number}","notifications_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/labels{/name}","releases_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/releases{/id}","deployments_url":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/deployments","created_at":"2017-07-03T14:57:51Z","updated_at":"2018-07-17T08:37:07Z","pushed_at":"2018-07-20T14:24:37Z","git_url":"git://github.com/project-sunbird/sunbird-lms-mw.git","ssh_url":"git@github.com:project-sunbird/sunbird-lms-mw.git","clone_url":"https://github.com/project-sunbird/sunbird-lms-mw.git","svn_url":"https://github.com/project-sunbird/sunbird-lms-mw","homepage":null,"size":10224,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":7,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85"},"html":{"href":"https://github.com/project-sunbird/sunbird-lms-mw/pull/85"},"issue":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/85"},"comments":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/issues/85/comments"},"review_comments":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85/comments"},"review_comment":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/pulls/85/commits"},"statuses":{"href":"https://api.github.com/repos/project-sunbird/sunbird-lms-mw/statuses/37201352bd7fd5e920862aa64594439300f02d2e"}},"author_association":"NONE"}}
{"actor":{"display_login":"kochhar"}}