{"action":"created","comment":{"url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/comments/34224241","id":34224241,"diff_hunk":"@@ -0,0 +1,61 @@\n+package com.griddynamics.cd.nrp.internal.uploading.impl.factories;\n+\n+import com.griddynamics.cd.nrp.internal.model.config.ReplicationPluginConfigurationStorage;\n+import com.sun.jersey.api.client.Client;\n+import com.sun.jersey.api.client.config.ClientConfig;\n+import com.sun.jersey.api.client.config.DefaultClientConfig;\n+import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import javax.inject.Inject;\n+import javax.inject.Singleton;\n+import java.util.concurrent.ExecutorService;\n+import java.util.concurrent.LinkedBlockingQueue;\n+import java.util.concurrent.ThreadPoolExecutor;\n+import java.util.concurrent.TimeUnit;\n+\n+@Singleton\n+public class JerseyClientFactory {\n+\n+    private Logger log = LoggerFactory.getLogger(JerseyClientFactory.class);\n+\n+    private ExecutorService executorService;\n+    private final ReplicationPluginConfigurationStorage\n+            replicationPluginConfigurationStorage;\n+\n+    @Inject\n+    public JerseyClientFactory(\n+            ReplicationPluginConfigurationStorage\n+                    replicationPluginConfigurationStorage ) {\n+        this.replicationPluginConfigurationStorage = replicationPluginConfigurationStorage;\n+\n+    }\n+\n+    public void onActivate(){\n+        int requestQueueSize = replicationPluginConfigurationStorage.getRequestQueueSize();\n+        this.executorService = new ThreadPoolExecutor(\n+                replicationPluginConfigurationStorage.getRequestSendingThreadCount(),\n+                replicationPluginConfigurationStorage.getRequestSendingThreadCount(),\n+                30,\n+                TimeUnit.SECONDS,\n+                new LinkedBlockingQueue<Runnable>(\n+                        requestQueueSize));\n+    }\n+\n+    public Client getClient(String login, String password) {\n+        ClientConfig config = new DefaultClientConfig();\n+        config.getProperties().put(ClientConfig.PROPERTY_CONNECT_TIMEOUT, 1000);\n+        config.getProperties().put(ClientConfig.PROPERTY_READ_TIMEOUT, 2000);","path":"src/main/java/com/griddynamics/cd/nrp/internal/uploading/impl/factories/JerseyClientFactory.java","position":49,"original_position":49,"commit_id":"dfed1fa779a5f8fb566e70f0e9bb5c8a9a3801e3","original_commit_id":"dfed1fa779a5f8fb566e70f0e9bb5c8a9a3801e3","user":{"login":"ctapobep","id":702510,"avatar_url":"https://avatars.githubusercontent.com/u/702510?v=3","gravatar_id":"","url":"https://api.github.com/users/ctapobep","html_url":"https://github.com/ctapobep","followers_url":"https://api.github.com/users/ctapobep/followers","following_url":"https://api.github.com/users/ctapobep/following{/other_user}","gists_url":"https://api.github.com/users/ctapobep/gists{/gist_id}","starred_url":"https://api.github.com/users/ctapobep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctapobep/subscriptions","organizations_url":"https://api.github.com/users/ctapobep/orgs","repos_url":"https://api.github.com/users/ctapobep/repos","events_url":"https://api.github.com/users/ctapobep/events{/privacy}","received_events_url":"https://api.github.com/users/ctapobep/received_events","type":"User","site_admin":false},"body":"Could you also leave comments on why you set those values and why particularly _these_ values?","created_at":"2015-07-09T05:14:44Z","updated_at":"2015-07-09T05:14:44Z","html_url":"https://github.com/griddynamics/nexus-replication-plugin/pull/32#discussion_r34224241","pull_request_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32","_links":{"self":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/comments/34224241"},"html":{"href":"https://github.com/griddynamics/nexus-replication-plugin/pull/32#discussion_r34224241"},"pull_request":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32"}}},"pull_request":{"url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32","id":39476923,"html_url":"https://github.com/griddynamics/nexus-replication-plugin/pull/32","diff_url":"https://github.com/griddynamics/nexus-replication-plugin/pull/32.diff","patch_url":"https://github.com/griddynamics/nexus-replication-plugin/pull/32.patch","issue_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/32","number":32,"state":"open","locked":false,"title":"Nexus configuration via UI","user":{"login":"gd-tmagrys","id":13015486,"avatar_url":"https://avatars.githubusercontent.com/u/13015486?v=3","gravatar_id":"","url":"https://api.github.com/users/gd-tmagrys","html_url":"https://github.com/gd-tmagrys","followers_url":"https://api.github.com/users/gd-tmagrys/followers","following_url":"https://api.github.com/users/gd-tmagrys/following{/other_user}","gists_url":"https://api.github.com/users/gd-tmagrys/gists{/gist_id}","starred_url":"https://api.github.com/users/gd-tmagrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gd-tmagrys/subscriptions","organizations_url":"https://api.github.com/users/gd-tmagrys/orgs","repos_url":"https://api.github.com/users/gd-tmagrys/repos","events_url":"https://api.github.com/users/gd-tmagrys/events{/privacy}","received_events_url":"https://api.github.com/users/gd-tmagrys/received_events","type":"User","site_admin":false},"body":"Implementation #6.\r\n\r\nNOT YET COMPLETED.\r\n\r\nPR created to pre-review.","created_at":"2015-07-08T13:31:47Z","updated_at":"2015-07-09T05:14:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cece6a3e2887e51bced1eef8b43842fd1cb0160","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32/commits","review_comments_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32/comments","review_comment_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/32/comments","statuses_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/statuses/dfed1fa779a5f8fb566e70f0e9bb5c8a9a3801e3","head":{"label":"gd-tmagrys:capabilities","ref":"capabilities","sha":"dfed1fa779a5f8fb566e70f0e9bb5c8a9a3801e3","user":{"login":"gd-tmagrys","id":13015486,"avatar_url":"https://avatars.githubusercontent.com/u/13015486?v=3","gravatar_id":"","url":"https://api.github.com/users/gd-tmagrys","html_url":"https://github.com/gd-tmagrys","followers_url":"https://api.github.com/users/gd-tmagrys/followers","following_url":"https://api.github.com/users/gd-tmagrys/following{/other_user}","gists_url":"https://api.github.com/users/gd-tmagrys/gists{/gist_id}","starred_url":"https://api.github.com/users/gd-tmagrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gd-tmagrys/subscriptions","organizations_url":"https://api.github.com/users/gd-tmagrys/orgs","repos_url":"https://api.github.com/users/gd-tmagrys/repos","events_url":"https://api.github.com/users/gd-tmagrys/events{/privacy}","received_events_url":"https://api.github.com/users/gd-tmagrys/received_events","type":"User","site_admin":false},"repo":{"id":38042696,"name":"nexus-replication-plugin","full_name":"gd-tmagrys/nexus-replication-plugin","owner":{"login":"gd-tmagrys","id":13015486,"avatar_url":"https://avatars.githubusercontent.com/u/13015486?v=3","gravatar_id":"","url":"https://api.github.com/users/gd-tmagrys","html_url":"https://github.com/gd-tmagrys","followers_url":"https://api.github.com/users/gd-tmagrys/followers","following_url":"https://api.github.com/users/gd-tmagrys/following{/other_user}","gists_url":"https://api.github.com/users/gd-tmagrys/gists{/gist_id}","starred_url":"https://api.github.com/users/gd-tmagrys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gd-tmagrys/subscriptions","organizations_url":"https://api.github.com/users/gd-tmagrys/orgs","repos_url":"https://api.github.com/users/gd-tmagrys/repos","events_url":"https://api.github.com/users/gd-tmagrys/events{/privacy}","received_events_url":"https://api.github.com/users/gd-tmagrys/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gd-tmagrys/nexus-replication-plugin","description":"Replication plugin for Sonatype Nexus","fork":true,"url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin","forks_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/forks","keys_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/teams","hooks_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/hooks","issue_events_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/events","assignees_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/tags","blobs_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/languages","stargazers_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/stargazers","contributors_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/contributors","subscribers_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/subscribers","subscription_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/subscription","commits_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/merges","archive_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/downloads","issues_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/labels{/name}","releases_url":"https://api.github.com/repos/gd-tmagrys/nexus-replication-plugin/releases{/id}","created_at":"2015-06-25T10:17:28Z","updated_at":"2015-06-25T10:17:28Z","pushed_at":"2015-07-08T21:33:06Z","git_url":"git://github.com/gd-tmagrys/nexus-replication-plugin.git","ssh_url":"git@github.com:gd-tmagrys/nexus-replication-plugin.git","clone_url":"https://github.com/gd-tmagrys/nexus-replication-plugin.git","svn_url":"https://github.com/gd-tmagrys/nexus-replication-plugin","homepage":null,"size":341,"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":"griddynamics:master","ref":"master","sha":"7f8c5341595bff4d03fe8649e69a2e0700d7009c","user":{"login":"griddynamics","id":54911,"avatar_url":"https://avatars.githubusercontent.com/u/54911?v=3","gravatar_id":"","url":"https://api.github.com/users/griddynamics","html_url":"https://github.com/griddynamics","followers_url":"https://api.github.com/users/griddynamics/followers","following_url":"https://api.github.com/users/griddynamics/following{/other_user}","gists_url":"https://api.github.com/users/griddynamics/gists{/gist_id}","starred_url":"https://api.github.com/users/griddynamics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griddynamics/subscriptions","organizations_url":"https://api.github.com/users/griddynamics/orgs","repos_url":"https://api.github.com/users/griddynamics/repos","events_url":"https://api.github.com/users/griddynamics/events{/privacy}","received_events_url":"https://api.github.com/users/griddynamics/received_events","type":"Organization","site_admin":false},"repo":{"id":34394534,"name":"nexus-replication-plugin","full_name":"griddynamics/nexus-replication-plugin","owner":{"login":"griddynamics","id":54911,"avatar_url":"https://avatars.githubusercontent.com/u/54911?v=3","gravatar_id":"","url":"https://api.github.com/users/griddynamics","html_url":"https://github.com/griddynamics","followers_url":"https://api.github.com/users/griddynamics/followers","following_url":"https://api.github.com/users/griddynamics/following{/other_user}","gists_url":"https://api.github.com/users/griddynamics/gists{/gist_id}","starred_url":"https://api.github.com/users/griddynamics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griddynamics/subscriptions","organizations_url":"https://api.github.com/users/griddynamics/orgs","repos_url":"https://api.github.com/users/griddynamics/repos","events_url":"https://api.github.com/users/griddynamics/events{/privacy}","received_events_url":"https://api.github.com/users/griddynamics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/griddynamics/nexus-replication-plugin","description":"Replication plugin for Sonatype Nexus","fork":false,"url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin","forks_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/forks","keys_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/teams","hooks_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/hooks","issue_events_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/events","assignees_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/tags","blobs_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/languages","stargazers_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/stargazers","contributors_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/contributors","subscribers_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/subscribers","subscription_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/subscription","commits_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/merges","archive_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/downloads","issues_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/labels{/name}","releases_url":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/releases{/id}","created_at":"2015-04-22T14:16:48Z","updated_at":"2015-06-29T17:34:44Z","pushed_at":"2015-07-08T21:33:06Z","git_url":"git://github.com/griddynamics/nexus-replication-plugin.git","ssh_url":"git@github.com:griddynamics/nexus-replication-plugin.git","clone_url":"https://github.com/griddynamics/nexus-replication-plugin.git","svn_url":"https://github.com/griddynamics/nexus-replication-plugin","homepage":null,"size":609,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":10,"forks":4,"open_issues":10,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32"},"html":{"href":"https://github.com/griddynamics/nexus-replication-plugin/pull/32"},"issue":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/32"},"comments":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/griddynamics/nexus-replication-plugin/statuses/dfed1fa779a5f8fb566e70f0e9bb5c8a9a3801e3"}}}}