{"action":"created","comment":{"url":"https://api.github.com/repos/paypal/squbs/pulls/comments/42768367","id":42768367,"diff_hunk":"@@ -227,611 +220,848 @@ HttpClientPathBuilder is a trait used to generate uri path based on the path & p\n * Char\n * Boolean\n \n-### HttpClient Message Based API\n+### HttpClient API\n+\n+This is the API most developers would interact with. Most of the API is Future-based allowing developers to make calls asynchronously.\n \n #### Get HttpClient\n \n-```scala\n+The first step to all HttpClient calls is to obtain the HttpClient from the factory.\n \n-val httpClientManager = HttpClientManager(system: ActorSystem).httpClientManager\n-httpClientManager ! Get(name: String, env: Environment = Default)\n+**Scala**\n \n+```scala\n+import org.squbs.httpclient._\n+...\n+val client: HttpClient = HttpClientFactory.get(name: String, env: Environment = Default)\n ```\n - name(Mandatory): Service Name\n - env(Optional): Service Call Environment, by default is Default\n \n-response:\n-- Success: HttpClientActor Reference\n-\n Note: If httpClient is not exist, it will create a new one.\n \n-![Get HttpClient Message Flow](../docs/img/get-httpclient.png)\n-\n-#### Delete HttpClient\n-\n-```scala\n+**Java**\n \n-val httpClientManager = HttpClientManager(system: ActorSystem).httpClientManager\n-httpClientManager ! Delete(name: String, env: Environment = Default)\n+```java\n+import org.squbs.httpclient.japi.*;\n+...\n+//Needs an ActorSystem, system.\n+HttpClient client = HttpClientFactory.get(String name, Environment env, ActorSystem system);\n \n+//or the shortcut with default environment\n+HttpClient client = HttpClientFactory.get(String name, ActorSystem system);\n ```\n-- name(Mandatory): Service Name\n-- env(Optional): Service Call Environment, by default is Default\n-\n-response:\n-- Success: DeleteSuccess\n-- Failure: HttpClientNotExistException\n \n-![Delete HttpClient Message Flow](../docs/img/delete-httpclient.png)\n \n-#### Delete All HttpClients\n+#### Update\n \n-```scala\n+Update Configuration:\n \n-val httpClientManager = HttpClientManager(system: ActorSystem).httpClientManager\n-httpClientManager ! DeleteAll\n+**Scala**\n \n+```scala\n+val client: HttpClient = HttpClientFactory.get(name: String, env: Environment = Default).withConfig(config: Configuration)\n ```\n \n-response:\n-- Success: DeleteAllSuccess\n+**Java**\n \n-![Delete All HttpClients Message Flow](../docs/img/deleteall-httpclients.png)\n+```java\n+HttpClient client = HttpClientFactory.get(name, system).withConfig(config);\n+```\n \n+Update Settings:\n \n-#### Get All HttpClients\n+**Scala**\n \n ```scala\n+val client: HttpClient = HttpClientFactory.get(name: String, env: Environment = Default).withSettings(settings: Settings)\n+```\n \n-val httpClientManager = HttpClientManager(system: ActorSystem).httpClientManager\n-httpClientManager ! GetAll\n+**Java**\n \n+```java\n+HttpClient client = HttpClientFactory.get(name, system).withSettings(settings);\n ```\n \n-response:\n-- Success: TrieMap[(String, Environment), HttpClient]\n-\n-![Get All HttpClients Message Flow](../docs/img/getall-httpclients.png)\n+Update Pipeline:\n \n-#### Update HttpClient Configuration\n+**Scala**\n \n ```scala\n+val client: HttpClient = HttpClientFactory.get(name: String, env: Environment = Default).withPipeline(pipeline: Option[SimplePipelineConfig])\n+```\n \n-//get HttpClientActor Ref from Get HttpClient Message Call\n-httpClientActorRef ! UpdateConfig(config: Configuration)\n+**Java**\n \n+```java\n+HttpClient client = HttpClientFactory.get(name, system).withPipeline(Optional.of(pipeline));\n ```\n-- config: new Configuration\n-\n-response:\n-- Success: HttpClientActor Reference\n \n-![Update HttpClient Configuration Message Flow](../docs/img/update-httpclient-config.png)\n+#### MarkDown\n \n-#### Update HttpClient Settings\n+**Scala**\n \n ```scala\n+val status: Future[MarkDownSuccess.type] = client.markDown\n+```\n \n-//get HttpClientActor Ref from Get HttpClient Message Call\n-httpClientActorRef ! UpdateSettings(settings: Settings)\n+**Java**\n \n+```java\n+Future<HttpClientActorMessage.MarkDownSuccess$> success = client.markDown();\n ```\n-- settings: new Settings\n \n-response:\n-- Success: HttpClientActor Reference\n+The type `HttpClientActorMessage.MarkDownSuccess$` is usually not used. We usually attach a onComplete callback such as `client.markUp().onComplete(...)`\n+directly.\n \n-![Update HttpClient Settings Message Flow](../docs/img/update-httpclient-settings.png)\n+#### MarkUp\n \n-#### Update HttpClient Pipeline\n+**Scala**\n \n ```scala\n+val status: Future[MarkUpSuccess.type] = client.markUp\n+```\n \n-//get HttpClientActor Ref from Get HttpClient Message Call\n-httpClientActorRef ! UpdatePipeline(pipeline: Option[SimplePipelineConfig])\n+**Java**\n \n+```java\n+Future<HttpClientActorMessage.MarkUpSuccess$> success = client.markUp();","path":"docs/httpclient.md","position":234,"original_position":234,"commit_id":"3d059d345831a6b0105c3744da2942bcec6090c3","original_commit_id":"3d059d345831a6b0105c3744da2942bcec6090c3","user":{"login":"anilgursel","id":3316621,"avatar_url":"https://avatars.githubusercontent.com/u/3316621?v=3","gravatar_id":"","url":"https://api.github.com/users/anilgursel","html_url":"https://github.com/anilgursel","followers_url":"https://api.github.com/users/anilgursel/followers","following_url":"https://api.github.com/users/anilgursel/following{/other_user}","gists_url":"https://api.github.com/users/anilgursel/gists{/gist_id}","starred_url":"https://api.github.com/users/anilgursel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anilgursel/subscriptions","organizations_url":"https://api.github.com/users/anilgursel/orgs","repos_url":"https://api.github.com/users/anilgursel/repos","events_url":"https://api.github.com/users/anilgursel/events{/privacy}","received_events_url":"https://api.github.com/users/anilgursel/received_events","type":"User","site_admin":false},"body":"Hmm..  I thought we were eliminating the `$`..  Something to address with Akka Http work..","created_at":"2015-10-22T16:04:46Z","updated_at":"2015-10-22T16:04:46Z","html_url":"https://github.com/paypal/squbs/pull/108#discussion_r42768367","pull_request_url":"https://api.github.com/repos/paypal/squbs/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/paypal/squbs/pulls/comments/42768367"},"html":{"href":"https://github.com/paypal/squbs/pull/108#discussion_r42768367"},"pull_request":{"href":"https://api.github.com/repos/paypal/squbs/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/paypal/squbs/pulls/108","id":48154366,"html_url":"https://github.com/paypal/squbs/pull/108","diff_url":"https://github.com/paypal/squbs/pull/108.diff","patch_url":"https://github.com/paypal/squbs/pull/108.patch","issue_url":"https://api.github.com/repos/paypal/squbs/issues/108","number":108,"state":"open","locked":false,"title":"https://github.com/paypal/squbs/issues/28: Reviewed and fixed HttpCli…","user":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"body":"…ent documentation. Also few code cleanups after tracing through the code while documenting.","created_at":"2015-10-20T03:55:41Z","updated_at":"2015-10-22T16:04:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e8fe7d5ab84bdd4bf1d402cc04902c91a361eba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/paypal/squbs/pulls/108/commits","review_comments_url":"https://api.github.com/repos/paypal/squbs/pulls/108/comments","review_comment_url":"https://api.github.com/repos/paypal/squbs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paypal/squbs/issues/108/comments","statuses_url":"https://api.github.com/repos/paypal/squbs/statuses/3d059d345831a6b0105c3744da2942bcec6090c3","head":{"label":"akara:RELEASE-0.7.X","ref":"RELEASE-0.7.X","sha":"3d059d345831a6b0105c3744da2942bcec6090c3","user":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"repo":{"id":40934086,"name":"squbs","full_name":"akara/squbs","owner":{"login":"akara","id":77111,"avatar_url":"https://avatars.githubusercontent.com/u/77111?v=3","gravatar_id":"","url":"https://api.github.com/users/akara","html_url":"https://github.com/akara","followers_url":"https://api.github.com/users/akara/followers","following_url":"https://api.github.com/users/akara/following{/other_user}","gists_url":"https://api.github.com/users/akara/gists{/gist_id}","starred_url":"https://api.github.com/users/akara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akara/subscriptions","organizations_url":"https://api.github.com/users/akara/orgs","repos_url":"https://api.github.com/users/akara/repos","events_url":"https://api.github.com/users/akara/events{/privacy}","received_events_url":"https://api.github.com/users/akara/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akara/squbs","description":"","fork":true,"url":"https://api.github.com/repos/akara/squbs","forks_url":"https://api.github.com/repos/akara/squbs/forks","keys_url":"https://api.github.com/repos/akara/squbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akara/squbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akara/squbs/teams","hooks_url":"https://api.github.com/repos/akara/squbs/hooks","issue_events_url":"https://api.github.com/repos/akara/squbs/issues/events{/number}","events_url":"https://api.github.com/repos/akara/squbs/events","assignees_url":"https://api.github.com/repos/akara/squbs/assignees{/user}","branches_url":"https://api.github.com/repos/akara/squbs/branches{/branch}","tags_url":"https://api.github.com/repos/akara/squbs/tags","blobs_url":"https://api.github.com/repos/akara/squbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akara/squbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akara/squbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/akara/squbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akara/squbs/statuses/{sha}","languages_url":"https://api.github.com/repos/akara/squbs/languages","stargazers_url":"https://api.github.com/repos/akara/squbs/stargazers","contributors_url":"https://api.github.com/repos/akara/squbs/contributors","subscribers_url":"https://api.github.com/repos/akara/squbs/subscribers","subscription_url":"https://api.github.com/repos/akara/squbs/subscription","commits_url":"https://api.github.com/repos/akara/squbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/akara/squbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/akara/squbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/akara/squbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/akara/squbs/contents/{+path}","compare_url":"https://api.github.com/repos/akara/squbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akara/squbs/merges","archive_url":"https://api.github.com/repos/akara/squbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akara/squbs/downloads","issues_url":"https://api.github.com/repos/akara/squbs/issues{/number}","pulls_url":"https://api.github.com/repos/akara/squbs/pulls{/number}","milestones_url":"https://api.github.com/repos/akara/squbs/milestones{/number}","notifications_url":"https://api.github.com/repos/akara/squbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akara/squbs/labels{/name}","releases_url":"https://api.github.com/repos/akara/squbs/releases{/id}","created_at":"2015-08-17T22:35:29Z","updated_at":"2015-08-17T22:35:30Z","pushed_at":"2015-10-20T04:19:23Z","git_url":"git://github.com/akara/squbs.git","ssh_url":"git@github.com:akara/squbs.git","clone_url":"https://github.com/akara/squbs.git","svn_url":"https://github.com/akara/squbs","homepage":null,"size":5747,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"paypal:RELEASE-0.7.X","ref":"RELEASE-0.7.X","sha":"ea720272786b6abd476ea51fcdb59753c0935d84","user":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"repo":{"id":38714007,"name":"squbs","full_name":"paypal/squbs","owner":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paypal/squbs","description":"Akka/Spray for Large-Scale Production Deployments","fork":false,"url":"https://api.github.com/repos/paypal/squbs","forks_url":"https://api.github.com/repos/paypal/squbs/forks","keys_url":"https://api.github.com/repos/paypal/squbs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paypal/squbs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paypal/squbs/teams","hooks_url":"https://api.github.com/repos/paypal/squbs/hooks","issue_events_url":"https://api.github.com/repos/paypal/squbs/issues/events{/number}","events_url":"https://api.github.com/repos/paypal/squbs/events","assignees_url":"https://api.github.com/repos/paypal/squbs/assignees{/user}","branches_url":"https://api.github.com/repos/paypal/squbs/branches{/branch}","tags_url":"https://api.github.com/repos/paypal/squbs/tags","blobs_url":"https://api.github.com/repos/paypal/squbs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paypal/squbs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paypal/squbs/git/refs{/sha}","trees_url":"https://api.github.com/repos/paypal/squbs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paypal/squbs/statuses/{sha}","languages_url":"https://api.github.com/repos/paypal/squbs/languages","stargazers_url":"https://api.github.com/repos/paypal/squbs/stargazers","contributors_url":"https://api.github.com/repos/paypal/squbs/contributors","subscribers_url":"https://api.github.com/repos/paypal/squbs/subscribers","subscription_url":"https://api.github.com/repos/paypal/squbs/subscription","commits_url":"https://api.github.com/repos/paypal/squbs/commits{/sha}","git_commits_url":"https://api.github.com/repos/paypal/squbs/git/commits{/sha}","comments_url":"https://api.github.com/repos/paypal/squbs/comments{/number}","issue_comment_url":"https://api.github.com/repos/paypal/squbs/issues/comments{/number}","contents_url":"https://api.github.com/repos/paypal/squbs/contents/{+path}","compare_url":"https://api.github.com/repos/paypal/squbs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paypal/squbs/merges","archive_url":"https://api.github.com/repos/paypal/squbs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paypal/squbs/downloads","issues_url":"https://api.github.com/repos/paypal/squbs/issues{/number}","pulls_url":"https://api.github.com/repos/paypal/squbs/pulls{/number}","milestones_url":"https://api.github.com/repos/paypal/squbs/milestones{/number}","notifications_url":"https://api.github.com/repos/paypal/squbs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paypal/squbs/labels{/name}","releases_url":"https://api.github.com/repos/paypal/squbs/releases{/id}","created_at":"2015-07-07T20:48:12Z","updated_at":"2015-09-28T20:26:05Z","pushed_at":"2015-10-20T04:19:24Z","git_url":"git://github.com/paypal/squbs.git","ssh_url":"git@github.com:paypal/squbs.git","clone_url":"https://github.com/paypal/squbs.git","svn_url":"https://github.com/paypal/squbs","homepage":"","size":6179,"stargazers_count":9,"watchers_count":9,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":26,"forks":14,"open_issues":26,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paypal/squbs/pulls/108"},"html":{"href":"https://github.com/paypal/squbs/pull/108"},"issue":{"href":"https://api.github.com/repos/paypal/squbs/issues/108"},"comments":{"href":"https://api.github.com/repos/paypal/squbs/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/paypal/squbs/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/paypal/squbs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paypal/squbs/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/paypal/squbs/statuses/3d059d345831a6b0105c3744da2942bcec6090c3"}}}}