{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments/82942167","pull_request_review_id":3813185,"id":82942167,"diff_hunk":"@@ -167,4 +234,214 @@ private boolean isUserAccessAllowed(String username) {\n         }\n         return false;\n     }\n+\n+    /**\n+     * retrieve the existing application of given name\n+     *\n+     * @param applicationName application name\n+     * @param saasApp         value of IsSaasApp attribute of application.\n+     * @return existing Application\n+     */\n+    private OAuthApplicationInfo getExistingApp(String applicationName, boolean saasApp) {\n+\n+        OAuthApplicationInfo appToReturn = null;\n+        OAuthAdminService oAuthAdminService = new OAuthAdminService();\n+        try {\n+            OAuthConsumerAppDTO consumerAppDTO = oAuthAdminService.\n+                    getOAuthApplicationDataByAppName(applicationName);\n+            Map<String, String> valueMap = new HashMap<String, String>();\n+            valueMap.put(OAUTH_CLIENT_GRANT, consumerAppDTO.getGrantTypes());\n+\n+            appToReturn = this.fromAppDTOToApplicationInfo(consumerAppDTO.getOauthConsumerKey(),\n+                    consumerAppDTO.getApplicationName(), consumerAppDTO.getCallbackUrl(),\n+                    consumerAppDTO.getOauthConsumerSecret(), saasApp, null, valueMap);\n+\n+        } catch (IdentityOAuthAdminException e) {\n+            String errorMsg = \"error occur while tryng to get OAuth Application data\";\n+            log.error(errorMsg,e);","path":"components/apimgt/org.wso2.carbon.apimgt.rest.api.dcr/src/main/java/org/wso2/carbon/apimgt/rest/api/dcr/web/impl/RegistrationServiceImpl.java","position":224,"original_position":224,"commit_id":"d4acea083b74c2becfdecbe639f18ea27a8ed639","original_commit_id":"d4acea083b74c2becfdecbe639f18ea27a8ed639","user":{"login":"sajinidesilva","id":1833441,"avatar_url":"https://avatars.githubusercontent.com/u/1833441?v=3","gravatar_id":"","url":"https://api.github.com/users/sajinidesilva","html_url":"https://github.com/sajinidesilva","followers_url":"https://api.github.com/users/sajinidesilva/followers","following_url":"https://api.github.com/users/sajinidesilva/following{/other_user}","gists_url":"https://api.github.com/users/sajinidesilva/gists{/gist_id}","starred_url":"https://api.github.com/users/sajinidesilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sajinidesilva/subscriptions","organizations_url":"https://api.github.com/users/sajinidesilva/orgs","repos_url":"https://api.github.com/users/sajinidesilva/repos","events_url":"https://api.github.com/users/sajinidesilva/events{/privacy}","received_events_url":"https://api.github.com/users/sajinidesilva/received_events","type":"User","site_admin":false},"body":"WE can put the errorMsg string inside the log itself since errorMsg variable is not used in anywhere else. ","created_at":"2016-10-12T06:17:00Z","updated_at":"2016-10-12T06:17:00Z","html_url":"https://github.com/wso2/carbon-apimgt/pull/2975#discussion_r82942167","pull_request_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments/82942167"},"html":{"href":"https://github.com/wso2/carbon-apimgt/pull/2975#discussion_r82942167"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975","id":88958580,"html_url":"https://github.com/wso2/carbon-apimgt/pull/2975","diff_url":"https://github.com/wso2/carbon-apimgt/pull/2975.diff","patch_url":"https://github.com/wso2/carbon-apimgt/pull/2975.patch","issue_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/2975","number":2975,"state":"open","locked":false,"title":"Dcr endpoint feature","user":{"login":"knPerera","id":16643748,"avatar_url":"https://avatars.githubusercontent.com/u/16643748?v=3","gravatar_id":"","url":"https://api.github.com/users/knPerera","html_url":"https://github.com/knPerera","followers_url":"https://api.github.com/users/knPerera/followers","following_url":"https://api.github.com/users/knPerera/following{/other_user}","gists_url":"https://api.github.com/users/knPerera/gists{/gist_id}","starred_url":"https://api.github.com/users/knPerera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knPerera/subscriptions","organizations_url":"https://api.github.com/users/knPerera/orgs","repos_url":"https://api.github.com/users/knPerera/repos","events_url":"https://api.github.com/users/knPerera/events{/privacy}","received_events_url":"https://api.github.com/users/knPerera/received_events","type":"User","site_admin":false},"body":"changes on dcr endpoint to return the existing application credentials, when trying to register with already existing application name.","created_at":"2016-10-12T06:07:45Z","updated_at":"2016-10-12T06:17:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f67d4a0f1b38130da18b09a04c7f351c43c2fb1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/2975/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/d4acea083b74c2becfdecbe639f18ea27a8ed639","head":{"label":"knPerera:dcr-endpoint-feature","ref":"dcr-endpoint-feature","sha":"d4acea083b74c2becfdecbe639f18ea27a8ed639","user":{"login":"knPerera","id":16643748,"avatar_url":"https://avatars.githubusercontent.com/u/16643748?v=3","gravatar_id":"","url":"https://api.github.com/users/knPerera","html_url":"https://github.com/knPerera","followers_url":"https://api.github.com/users/knPerera/followers","following_url":"https://api.github.com/users/knPerera/following{/other_user}","gists_url":"https://api.github.com/users/knPerera/gists{/gist_id}","starred_url":"https://api.github.com/users/knPerera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knPerera/subscriptions","organizations_url":"https://api.github.com/users/knPerera/orgs","repos_url":"https://api.github.com/users/knPerera/repos","events_url":"https://api.github.com/users/knPerera/events{/privacy}","received_events_url":"https://api.github.com/users/knPerera/received_events","type":"User","site_admin":false},"repo":{"id":58910859,"name":"carbon-apimgt","full_name":"knPerera/carbon-apimgt","owner":{"login":"knPerera","id":16643748,"avatar_url":"https://avatars.githubusercontent.com/u/16643748?v=3","gravatar_id":"","url":"https://api.github.com/users/knPerera","html_url":"https://github.com/knPerera","followers_url":"https://api.github.com/users/knPerera/followers","following_url":"https://api.github.com/users/knPerera/following{/other_user}","gists_url":"https://api.github.com/users/knPerera/gists{/gist_id}","starred_url":"https://api.github.com/users/knPerera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knPerera/subscriptions","organizations_url":"https://api.github.com/users/knPerera/orgs","repos_url":"https://api.github.com/users/knPerera/repos","events_url":"https://api.github.com/users/knPerera/events{/privacy}","received_events_url":"https://api.github.com/users/knPerera/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/knPerera/carbon-apimgt","description":"","fork":true,"url":"https://api.github.com/repos/knPerera/carbon-apimgt","forks_url":"https://api.github.com/repos/knPerera/carbon-apimgt/forks","keys_url":"https://api.github.com/repos/knPerera/carbon-apimgt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/knPerera/carbon-apimgt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/knPerera/carbon-apimgt/teams","hooks_url":"https://api.github.com/repos/knPerera/carbon-apimgt/hooks","issue_events_url":"https://api.github.com/repos/knPerera/carbon-apimgt/issues/events{/number}","events_url":"https://api.github.com/repos/knPerera/carbon-apimgt/events","assignees_url":"https://api.github.com/repos/knPerera/carbon-apimgt/assignees{/user}","branches_url":"https://api.github.com/repos/knPerera/carbon-apimgt/branches{/branch}","tags_url":"https://api.github.com/repos/knPerera/carbon-apimgt/tags","blobs_url":"https://api.github.com/repos/knPerera/carbon-apimgt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/knPerera/carbon-apimgt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/knPerera/carbon-apimgt/git/refs{/sha}","trees_url":"https://api.github.com/repos/knPerera/carbon-apimgt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/knPerera/carbon-apimgt/statuses/{sha}","languages_url":"https://api.github.com/repos/knPerera/carbon-apimgt/languages","stargazers_url":"https://api.github.com/repos/knPerera/carbon-apimgt/stargazers","contributors_url":"https://api.github.com/repos/knPerera/carbon-apimgt/contributors","subscribers_url":"https://api.github.com/repos/knPerera/carbon-apimgt/subscribers","subscription_url":"https://api.github.com/repos/knPerera/carbon-apimgt/subscription","commits_url":"https://api.github.com/repos/knPerera/carbon-apimgt/commits{/sha}","git_commits_url":"https://api.github.com/repos/knPerera/carbon-apimgt/git/commits{/sha}","comments_url":"https://api.github.com/repos/knPerera/carbon-apimgt/comments{/number}","issue_comment_url":"https://api.github.com/repos/knPerera/carbon-apimgt/issues/comments{/number}","contents_url":"https://api.github.com/repos/knPerera/carbon-apimgt/contents/{+path}","compare_url":"https://api.github.com/repos/knPerera/carbon-apimgt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/knPerera/carbon-apimgt/merges","archive_url":"https://api.github.com/repos/knPerera/carbon-apimgt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/knPerera/carbon-apimgt/downloads","issues_url":"https://api.github.com/repos/knPerera/carbon-apimgt/issues{/number}","pulls_url":"https://api.github.com/repos/knPerera/carbon-apimgt/pulls{/number}","milestones_url":"https://api.github.com/repos/knPerera/carbon-apimgt/milestones{/number}","notifications_url":"https://api.github.com/repos/knPerera/carbon-apimgt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/knPerera/carbon-apimgt/labels{/name}","releases_url":"https://api.github.com/repos/knPerera/carbon-apimgt/releases{/id}","deployments_url":"https://api.github.com/repos/knPerera/carbon-apimgt/deployments","created_at":"2016-05-16T07:01:40Z","updated_at":"2016-05-16T07:02:00Z","pushed_at":"2016-10-12T05:57:58Z","git_url":"git://github.com/knPerera/carbon-apimgt.git","ssh_url":"git@github.com:knPerera/carbon-apimgt.git","clone_url":"https://github.com/knPerera/carbon-apimgt.git","svn_url":"https://github.com/knPerera/carbon-apimgt","homepage":null,"size":152836,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:master","ref":"master","sha":"c9283f41d9892b18a144af9518161438707a33fd","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":17201744,"name":"carbon-apimgt","full_name":"wso2/carbon-apimgt","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-apimgt","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-apimgt","forks_url":"https://api.github.com/repos/wso2/carbon-apimgt/forks","keys_url":"https://api.github.com/repos/wso2/carbon-apimgt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-apimgt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-apimgt/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-apimgt/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-apimgt/events","assignees_url":"https://api.github.com/repos/wso2/carbon-apimgt/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-apimgt/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-apimgt/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-apimgt/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-apimgt/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-apimgt/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-apimgt/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-apimgt/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-apimgt/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-apimgt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-apimgt/merges","archive_url":"https://api.github.com/repos/wso2/carbon-apimgt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-apimgt/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-apimgt/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-apimgt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-apimgt/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-apimgt/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/carbon-apimgt/deployments","created_at":"2014-02-26T06:46:48Z","updated_at":"2016-10-08T14:32:13Z","pushed_at":"2016-10-12T06:07:45Z","git_url":"git://github.com/wso2/carbon-apimgt.git","ssh_url":"git@github.com:wso2/carbon-apimgt.git","clone_url":"https://github.com/wso2/carbon-apimgt.git","svn_url":"https://github.com/wso2/carbon-apimgt","homepage":null,"size":183247,"stargazers_count":19,"watchers_count":19,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":193,"mirror_url":null,"open_issues_count":9,"forks":193,"open_issues":9,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975"},"html":{"href":"https://github.com/wso2/carbon-apimgt/pull/2975"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/issues/2975"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/issues/2975/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/2975/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/d4acea083b74c2becfdecbe639f18ea27a8ed639"}}}}
{"actor":{"display_login":"sajinidesilva"}}