{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/charon/pulls/comments/100981762","pull_request_review_id":21699006,"id":100981762,"diff_hunk":"@@ -0,0 +1,199 @@\n+/*\n+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+*\n+*  WSO2 Inc. licenses this file to you under the Apache License,\n+*  Version 2.0 (the \"License\"); you may not use this file except\n+*  in compliance with the License.\n+*  You may obtain a copy of the License at\n+*\n+*    http://www.apache.org/licenses/LICENSE-2.0\n+*\n+* Unless required by applicable law or agreed to in writing,\n+* software distributed under the License is distributed on an\n+* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+* KIND, either express or implied.  See the License for the\n+* specific language governing permissions and limitations\n+* under the License.\n+*/\n+package org.wso2.charon3.core.protocol;\n+\n+\n+import org.wso2.charon3.core.exceptions.BadRequestException;\n+import org.wso2.charon3.core.extensions.UserManager;\n+import org.wso2.charon3.core.objects.bulk.BulkRequestContent;\n+import org.wso2.charon3.core.objects.bulk.BulkRequestData;\n+import org.wso2.charon3.core.objects.bulk.BulkResponseContent;\n+import org.wso2.charon3.core.objects.bulk.BulkResponseData;\n+import org.wso2.charon3.core.protocol.endpoints.GroupResourceManager;\n+import org.wso2.charon3.core.protocol.endpoints.ResourceManager;\n+import org.wso2.charon3.core.protocol.endpoints.UserResourceManager;\n+import org.wso2.charon3.core.schema.SCIMConstants;\n+\n+/**\n+ *\n+ */\n+public class BulkRequestProcessor {\n+    private UserResourceManager userResourceManager;\n+    private GroupResourceManager groupResourceManager;\n+    private int failOnError;\n+    private int errors;\n+    private UserManager userManager;\n+\n+\n+    public UserResourceManager getUserResourceManager() {\n+        return userResourceManager;\n+    }\n+\n+    public void setUserResourceManager(UserResourceManager userResourceManager) {\n+        this.userResourceManager = userResourceManager;\n+    }\n+\n+    public GroupResourceManager getGroupResourceManager() {\n+        return groupResourceManager;\n+    }\n+\n+    public void setGroupResourceManager(GroupResourceManager groupResourceManager) {\n+        this.groupResourceManager = groupResourceManager;\n+    }\n+\n+    public int getFailOnError() {\n+        return failOnError;\n+    }\n+\n+    public void setFailOnError(int failOnError) {\n+        this.failOnError = failOnError;\n+    }\n+\n+    public int getErrors() {\n+        return errors;\n+    }\n+\n+    public void setErrors(int errors) {\n+        this.errors = errors;\n+    }\n+\n+    public UserManager getUserManager() {\n+        return userManager;\n+    }\n+\n+    public void setUserManager(UserManager userManager) {\n+        this.userManager = userManager;\n+    }\n+\n+    public BulkRequestProcessor() {\n+        userResourceManager = new UserResourceManager();\n+        groupResourceManager = new GroupResourceManager();\n+        failOnError = 0;\n+        errors = 0;\n+        userManager = null;\n+    }\n+\n+    public BulkResponseData processBulkRequests(BulkRequestData bulkRequestData) throws BadRequestException {\n+\n+        BulkResponseData bulkResponseData = new BulkResponseData();\n+        SCIMResponse response = null;\n+\n+        for (BulkRequestContent bulkRequestContent : bulkRequestData.getUserOperationRequests()) {\n+            if (failOnError == 0) {\n+                bulkResponseData.addUserOperation\n+                            (getBulkResponseContent(bulkRequestContent, userResourceManager));\n+            } else {\n+                if (errors < failOnError) {","path":"modules/charon-core/src/main/java/org/wso2/charon3/core/protocol/BulkRequestProcessor.java","position":101,"original_position":101,"commit_id":"3c763c316518fbaf8cd8c4324dbfb984d78e1c92","original_commit_id":"3c763c316518fbaf8cd8c4324dbfb984d78e1c92","user":{"login":"GayanM","id":3436694,"avatar_url":"https://avatars.githubusercontent.com/u/3436694?v=3","gravatar_id":"","url":"https://api.github.com/users/GayanM","html_url":"https://github.com/GayanM","followers_url":"https://api.github.com/users/GayanM/followers","following_url":"https://api.github.com/users/GayanM/following{/other_user}","gists_url":"https://api.github.com/users/GayanM/gists{/gist_id}","starred_url":"https://api.github.com/users/GayanM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GayanM/subscriptions","organizations_url":"https://api.github.com/users/GayanM/orgs","repos_url":"https://api.github.com/users/GayanM/repos","events_url":"https://api.github.com/users/GayanM/events{/privacy}","received_events_url":"https://api.github.com/users/GayanM/received_events","type":"User","site_admin":false},"body":"can optimize if else ","created_at":"2017-02-14T08:41:27Z","updated_at":"2017-02-14T08:41:27Z","html_url":"https://github.com/wso2/charon/pull/59#discussion_r100981762","pull_request_url":"https://api.github.com/repos/wso2/charon/pulls/59","_links":{"self":{"href":"https://api.github.com/repos/wso2/charon/pulls/comments/100981762"},"html":{"href":"https://github.com/wso2/charon/pull/59#discussion_r100981762"},"pull_request":{"href":"https://api.github.com/repos/wso2/charon/pulls/59"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/charon/pulls/59","id":100087166,"html_url":"https://github.com/wso2/charon/pull/59","diff_url":"https://github.com/wso2/charon/pull/59.diff","patch_url":"https://github.com/wso2/charon/pull/59.patch","issue_url":"https://api.github.com/repos/wso2/charon/issues/59","number":59,"state":"open","locked":false,"title":"Adding Charon 3.0.0","user":{"login":"Vindulamj","id":12431869,"avatar_url":"https://avatars.githubusercontent.com/u/12431869?v=3","gravatar_id":"","url":"https://api.github.com/users/Vindulamj","html_url":"https://github.com/Vindulamj","followers_url":"https://api.github.com/users/Vindulamj/followers","following_url":"https://api.github.com/users/Vindulamj/following{/other_user}","gists_url":"https://api.github.com/users/Vindulamj/gists{/gist_id}","starred_url":"https://api.github.com/users/Vindulamj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vindulamj/subscriptions","organizations_url":"https://api.github.com/users/Vindulamj/orgs","repos_url":"https://api.github.com/users/Vindulamj/repos","events_url":"https://api.github.com/users/Vindulamj/events{/privacy}","received_events_url":"https://api.github.com/users/Vindulamj/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-01-04T09:49:59Z","updated_at":"2017-02-14T08:41:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e4938b01de296bdf40c46bc70d62d9a4933bdd7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/charon/pulls/59/commits","review_comments_url":"https://api.github.com/repos/wso2/charon/pulls/59/comments","review_comment_url":"https://api.github.com/repos/wso2/charon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/charon/issues/59/comments","statuses_url":"https://api.github.com/repos/wso2/charon/statuses/3c763c316518fbaf8cd8c4324dbfb984d78e1c92","head":{"label":"Vindulamj:3.0.x","ref":"3.0.x","sha":"3c763c316518fbaf8cd8c4324dbfb984d78e1c92","user":{"login":"Vindulamj","id":12431869,"avatar_url":"https://avatars.githubusercontent.com/u/12431869?v=3","gravatar_id":"","url":"https://api.github.com/users/Vindulamj","html_url":"https://github.com/Vindulamj","followers_url":"https://api.github.com/users/Vindulamj/followers","following_url":"https://api.github.com/users/Vindulamj/following{/other_user}","gists_url":"https://api.github.com/users/Vindulamj/gists{/gist_id}","starred_url":"https://api.github.com/users/Vindulamj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vindulamj/subscriptions","organizations_url":"https://api.github.com/users/Vindulamj/orgs","repos_url":"https://api.github.com/users/Vindulamj/repos","events_url":"https://api.github.com/users/Vindulamj/events{/privacy}","received_events_url":"https://api.github.com/users/Vindulamj/received_events","type":"User","site_admin":false},"repo":{"id":78002000,"name":"charon","full_name":"Vindulamj/charon","owner":{"login":"Vindulamj","id":12431869,"avatar_url":"https://avatars.githubusercontent.com/u/12431869?v=3","gravatar_id":"","url":"https://api.github.com/users/Vindulamj","html_url":"https://github.com/Vindulamj","followers_url":"https://api.github.com/users/Vindulamj/followers","following_url":"https://api.github.com/users/Vindulamj/following{/other_user}","gists_url":"https://api.github.com/users/Vindulamj/gists{/gist_id}","starred_url":"https://api.github.com/users/Vindulamj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vindulamj/subscriptions","organizations_url":"https://api.github.com/users/Vindulamj/orgs","repos_url":"https://api.github.com/users/Vindulamj/repos","events_url":"https://api.github.com/users/Vindulamj/events{/privacy}","received_events_url":"https://api.github.com/users/Vindulamj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Vindulamj/charon","description":null,"fork":true,"url":"https://api.github.com/repos/Vindulamj/charon","forks_url":"https://api.github.com/repos/Vindulamj/charon/forks","keys_url":"https://api.github.com/repos/Vindulamj/charon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Vindulamj/charon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Vindulamj/charon/teams","hooks_url":"https://api.github.com/repos/Vindulamj/charon/hooks","issue_events_url":"https://api.github.com/repos/Vindulamj/charon/issues/events{/number}","events_url":"https://api.github.com/repos/Vindulamj/charon/events","assignees_url":"https://api.github.com/repos/Vindulamj/charon/assignees{/user}","branches_url":"https://api.github.com/repos/Vindulamj/charon/branches{/branch}","tags_url":"https://api.github.com/repos/Vindulamj/charon/tags","blobs_url":"https://api.github.com/repos/Vindulamj/charon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Vindulamj/charon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Vindulamj/charon/git/refs{/sha}","trees_url":"https://api.github.com/repos/Vindulamj/charon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Vindulamj/charon/statuses/{sha}","languages_url":"https://api.github.com/repos/Vindulamj/charon/languages","stargazers_url":"https://api.github.com/repos/Vindulamj/charon/stargazers","contributors_url":"https://api.github.com/repos/Vindulamj/charon/contributors","subscribers_url":"https://api.github.com/repos/Vindulamj/charon/subscribers","subscription_url":"https://api.github.com/repos/Vindulamj/charon/subscription","commits_url":"https://api.github.com/repos/Vindulamj/charon/commits{/sha}","git_commits_url":"https://api.github.com/repos/Vindulamj/charon/git/commits{/sha}","comments_url":"https://api.github.com/repos/Vindulamj/charon/comments{/number}","issue_comment_url":"https://api.github.com/repos/Vindulamj/charon/issues/comments{/number}","contents_url":"https://api.github.com/repos/Vindulamj/charon/contents/{+path}","compare_url":"https://api.github.com/repos/Vindulamj/charon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Vindulamj/charon/merges","archive_url":"https://api.github.com/repos/Vindulamj/charon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Vindulamj/charon/downloads","issues_url":"https://api.github.com/repos/Vindulamj/charon/issues{/number}","pulls_url":"https://api.github.com/repos/Vindulamj/charon/pulls{/number}","milestones_url":"https://api.github.com/repos/Vindulamj/charon/milestones{/number}","notifications_url":"https://api.github.com/repos/Vindulamj/charon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Vindulamj/charon/labels{/name}","releases_url":"https://api.github.com/repos/Vindulamj/charon/releases{/id}","deployments_url":"https://api.github.com/repos/Vindulamj/charon/deployments","created_at":"2017-01-04T09:38:28Z","updated_at":"2017-01-04T09:38:31Z","pushed_at":"2017-02-07T17:48:48Z","git_url":"git://github.com/Vindulamj/charon.git","ssh_url":"git@github.com:Vindulamj/charon.git","clone_url":"https://github.com/Vindulamj/charon.git","svn_url":"https://github.com/Vindulamj/charon","homepage":null,"size":980,"stargazers_count":0,"watchers_count":0,"language":"Java","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:3.0.x","ref":"3.0.x","sha":"3b0dadef29c6a5e160b805bb47081b6d4089f45a","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":19238551,"name":"charon","full_name":"wso2/charon","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/charon","description":null,"fork":false,"url":"https://api.github.com/repos/wso2/charon","forks_url":"https://api.github.com/repos/wso2/charon/forks","keys_url":"https://api.github.com/repos/wso2/charon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/charon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/charon/teams","hooks_url":"https://api.github.com/repos/wso2/charon/hooks","issue_events_url":"https://api.github.com/repos/wso2/charon/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/charon/events","assignees_url":"https://api.github.com/repos/wso2/charon/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/charon/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/charon/tags","blobs_url":"https://api.github.com/repos/wso2/charon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/charon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/charon/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/charon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/charon/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/charon/languages","stargazers_url":"https://api.github.com/repos/wso2/charon/stargazers","contributors_url":"https://api.github.com/repos/wso2/charon/contributors","subscribers_url":"https://api.github.com/repos/wso2/charon/subscribers","subscription_url":"https://api.github.com/repos/wso2/charon/subscription","commits_url":"https://api.github.com/repos/wso2/charon/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/charon/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/charon/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/charon/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/charon/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/charon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/charon/merges","archive_url":"https://api.github.com/repos/wso2/charon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/charon/downloads","issues_url":"https://api.github.com/repos/wso2/charon/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/charon/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/charon/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/charon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/charon/labels{/name}","releases_url":"https://api.github.com/repos/wso2/charon/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/charon/deployments","created_at":"2014-04-28T12:55:15Z","updated_at":"2016-03-23T09:25:14Z","pushed_at":"2017-02-13T06:26:31Z","git_url":"git://github.com/wso2/charon.git","ssh_url":"git@github.com:wso2/charon.git","clone_url":"https://github.com/wso2/charon.git","svn_url":"https://github.com/wso2/charon","homepage":null,"size":925,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":3,"forks":24,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/charon/pulls/59"},"html":{"href":"https://github.com/wso2/charon/pull/59"},"issue":{"href":"https://api.github.com/repos/wso2/charon/issues/59"},"comments":{"href":"https://api.github.com/repos/wso2/charon/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/charon/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/charon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/charon/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/charon/statuses/3c763c316518fbaf8cd8c4324dbfb984d78e1c92"}}}}
{"actor":{"display_login":"GayanM"}}