{"action":"created","comment":{"url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments/215966297","pull_request_review_id":153351213,"id":215966297,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTk2NjI5Nw==","diff_hunk":"@@ -0,0 +1,70 @@\n+/*\n+ * (C) Copyright 2018 Nuxeo (http://nuxeo.com/) and others.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ *\n+ * Contributors:\n+ *     Funsho David\n+ */\n+\n+package org.nuxeo.ecm.core.bulk.actions;\n+\n+import java.io.Serializable;\n+import java.util.Collection;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.stream.Collectors;\n+\n+import org.nuxeo.ecm.core.api.CoreSession;\n+import org.nuxeo.ecm.core.api.DocumentModel;\n+import org.nuxeo.ecm.core.api.DocumentModelList;\n+import org.nuxeo.ecm.core.api.DocumentRef;\n+import org.nuxeo.ecm.core.api.IdRef;\n+import org.nuxeo.lib.stream.computation.Computation;\n+\n+/**\n+ * @since 10.3\n+ */\n+public class RemoveProxyAction extends AbstractBulkAction {\n+\n+    public static final String ACTION_NAME = \"removeProxy\";\n+\n+    public RemoveProxyAction() {\n+        super(ACTION_NAME);\n+    }\n+\n+    @Override\n+    protected Computation createComputation(int batchSize, int batchThresholdMs) {\n+        return new RemoveProxyComputation(getActionName(), batchSize, batchThresholdMs);\n+    }\n+\n+    public static class RemoveProxyComputation extends AbstractBulkComputation {\n+\n+        public RemoveProxyComputation(String name, int batchSize, int batchThresholdMs) {\n+            super(name, 1, 1, batchSize, batchThresholdMs);\n+        }\n+\n+        @Override\n+        protected void compute(CoreSession session, List<String> ids, Map<String, Serializable> properties) {\n+            Collection<DocumentRef> refs = ids.stream().map(IdRef::new).collect(Collectors.toList());\n+            DocumentModelList docs = session.getDocuments(refs.toArray(new DocumentRef[refs.size()]));\n+            Collection<DocumentRef> proxies = docs.stream()\n+                                                  .filter(DocumentModel::isProxy)\n+                                                  .map(DocumentModel::getRef)\n+                                                  .collect(Collectors.toList());\n+            session.removeDocuments(proxies.toArray(new DocumentRef[0]));\n+            session.save();\n+        }\n+\n+    }\n+}","path":"nuxeo-core/nuxeo-core-bulk/src/main/java/org/nuxeo/ecm/core/bulk/actions/RemoveProxyAction.java","position":70,"original_position":70,"commit_id":"747321f86b96a7b2bf78ee3aaa0de1a01272cd41","original_commit_id":"747321f86b96a7b2bf78ee3aaa0de1a01272cd41","user":{"login":"pierre-gautier","id":26608043,"node_id":"MDQ6VXNlcjI2NjA4MDQz","avatar_url":"https://avatars0.githubusercontent.com/u/26608043?v=4","gravatar_id":"","url":"https://api.github.com/users/pierre-gautier","html_url":"https://github.com/pierre-gautier","followers_url":"https://api.github.com/users/pierre-gautier/followers","following_url":"https://api.github.com/users/pierre-gautier/following{/other_user}","gists_url":"https://api.github.com/users/pierre-gautier/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre-gautier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre-gautier/subscriptions","organizations_url":"https://api.github.com/users/pierre-gautier/orgs","repos_url":"https://api.github.com/users/pierre-gautier/repos","events_url":"https://api.github.com/users/pierre-gautier/events{/privacy}","received_events_url":"https://api.github.com/users/pierre-gautier/received_events","type":"User","site_admin":false},"body":"Do you mean that we should move all implementations to nuxeo-core ?\r\nI don't have a strong opinion, but I would'nt mind having implementations requiring only nuxeo-core-api in the bulk module\r\n@kevinleturc @efge  ?","created_at":"2018-09-07T13:55:00Z","updated_at":"2018-09-07T13:55:01Z","html_url":"https://github.com/nuxeo/nuxeo/pull/2325#discussion_r215966297","pull_request_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments/215966297"},"html":{"href":"https://github.com/nuxeo/nuxeo/pull/2325#discussion_r215966297"},"pull_request":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325"}},"in_reply_to_id":215944096},"pull_request":{"url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325","id":213645697,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNjQ1Njk3","html_url":"https://github.com/nuxeo/nuxeo/pull/2325","diff_url":"https://github.com/nuxeo/nuxeo/pull/2325.diff","patch_url":"https://github.com/nuxeo/nuxeo/pull/2325.patch","issue_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/2325","number":2325,"state":"open","locked":false,"title":"Feature nxp 25378 use baf in trash","user":{"login":"pierre-gautier","id":26608043,"node_id":"MDQ6VXNlcjI2NjA4MDQz","avatar_url":"https://avatars0.githubusercontent.com/u/26608043?v=4","gravatar_id":"","url":"https://api.github.com/users/pierre-gautier","html_url":"https://github.com/pierre-gautier","followers_url":"https://api.github.com/users/pierre-gautier/followers","following_url":"https://api.github.com/users/pierre-gautier/following{/other_user}","gists_url":"https://api.github.com/users/pierre-gautier/gists{/gist_id}","starred_url":"https://api.github.com/users/pierre-gautier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierre-gautier/subscriptions","organizations_url":"https://api.github.com/users/pierre-gautier/orgs","repos_url":"https://api.github.com/users/pierre-gautier/repos","events_url":"https://api.github.com/users/pierre-gautier/events{/privacy}","received_events_url":"https://api.github.com/users/pierre-gautier/received_events","type":"User","site_admin":false},"body":"As 6 T&P's have timed out in a row, I create to PR manually to start review before it passes","created_at":"2018-09-06T14:47:48Z","updated_at":"2018-09-07T13:55:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0d78484c27a9301307fbc2e0817027153bfec9c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325/commits","review_comments_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325/comments","review_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/2325/comments","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/747321f86b96a7b2bf78ee3aaa0de1a01272cd41","head":{"label":"nuxeo:feature-NXP-25378-use-baf-in-trash","ref":"feature-NXP-25378-use-baf-in-trash","sha":"747321f86b96a7b2bf78ee3aaa0de1a01272cd41","user":{"login":"nuxeo","id":460607,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDYwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2988101,"node_id":"MDEwOlJlcG9zaXRvcnkyOTg4MTAx","name":"nuxeo","full_name":"nuxeo/nuxeo","owner":{"login":"nuxeo","id":460607,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDYwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo","description":"Content management platform to build modern business applications","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo","forks_url":"https://api.github.com/repos/nuxeo/nuxeo/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo/deployments","created_at":"2011-12-15T14:35:41Z","updated_at":"2018-09-07T09:25:51Z","pushed_at":"2018-09-07T13:50:52Z","git_url":"git://github.com/nuxeo/nuxeo.git","ssh_url":"git@github.com:nuxeo/nuxeo.git","clone_url":"https://github.com/nuxeo/nuxeo.git","svn_url":"https://github.com/nuxeo/nuxeo","homepage":"http://www.nuxeo.com","size":233268,"stargazers_count":240,"watchers_count":240,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":25,"license":null,"forks":161,"open_issues":25,"watchers":240,"default_branch":"master"}},"base":{"label":"nuxeo:master","ref":"master","sha":"c02d63a1ed41b31ee429178ebfd7c1d240ce6ab6","user":{"login":"nuxeo","id":460607,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDYwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2988101,"node_id":"MDEwOlJlcG9zaXRvcnkyOTg4MTAx","name":"nuxeo","full_name":"nuxeo/nuxeo","owner":{"login":"nuxeo","id":460607,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDYwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo","description":"Content management platform to build modern business applications","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo","forks_url":"https://api.github.com/repos/nuxeo/nuxeo/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo/deployments","created_at":"2011-12-15T14:35:41Z","updated_at":"2018-09-07T09:25:51Z","pushed_at":"2018-09-07T13:50:52Z","git_url":"git://github.com/nuxeo/nuxeo.git","ssh_url":"git@github.com:nuxeo/nuxeo.git","clone_url":"https://github.com/nuxeo/nuxeo.git","svn_url":"https://github.com/nuxeo/nuxeo","homepage":"http://www.nuxeo.com","size":233268,"stargazers_count":240,"watchers_count":240,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":161,"mirror_url":null,"archived":false,"open_issues_count":25,"license":null,"forks":161,"open_issues":25,"watchers":240,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325"},"html":{"href":"https://github.com/nuxeo/nuxeo/pull/2325"},"issue":{"href":"https://api.github.com/repos/nuxeo/nuxeo/issues/2325"},"comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo/issues/2325/comments"},"review_comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325/comments"},"review_comment":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/2325/commits"},"statuses":{"href":"https://api.github.com/repos/nuxeo/nuxeo/statuses/747321f86b96a7b2bf78ee3aaa0de1a01272cd41"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pierre-gautier"}}