{"action":"created","comment":{"url":"https://api.github.com/repos/apache/bookkeeper/pulls/comments/141218462","pull_request_review_id":65398947,"id":141218462,"diff_hunk":"@@ -0,0 +1,135 @@\n+/**\n+ *\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  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+ */\n+package org.apache.bookkeeper.http;\n+\n+/**\n+ * Abstract handler factory which provide interface\n+ * to create handlers for bookkeeper http endpoints.\n+ */\n+public abstract class AbstractHttpHandlerFactory<Handler> {\n+    private HttpServiceProvider httpServiceProvider;\n+\n+    public AbstractHttpHandlerFactory(HttpServiceProvider httpServiceProvider) {\n+        this.httpServiceProvider = httpServiceProvider;\n+    }\n+\n+    public HttpServiceProvider getHttpServiceProvider() {\n+        return httpServiceProvider;\n+    }\n+\n+    /**\n+     * Create a handler for heartbeat api.\n+     */\n+    public abstract Handler newHeartbeatHandler();","path":"bookkeeper-http/http-server/src/main/java/org/apache/bookkeeper/http/AbstractHttpHandlerFactory.java","position":41,"original_position":41,"commit_id":"37ce40c095ffcf380116c1142f4eb8635496c9f7","original_commit_id":"37ce40c095ffcf380116c1142f4eb8635496c9f7","user":{"login":"zhaijack","id":26834121,"avatar_url":"https://avatars0.githubusercontent.com/u/26834121?v=4","gravatar_id":"","url":"https://api.github.com/users/zhaijack","html_url":"https://github.com/zhaijack","followers_url":"https://api.github.com/users/zhaijack/followers","following_url":"https://api.github.com/users/zhaijack/following{/other_user}","gists_url":"https://api.github.com/users/zhaijack/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaijack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaijack/subscriptions","organizations_url":"https://api.github.com/users/zhaijack/orgs","repos_url":"https://api.github.com/users/zhaijack/repos","events_url":"https://api.github.com/users/zhaijack/events{/privacy}","received_events_url":"https://api.github.com/users/zhaijack/received_events","type":"User","site_admin":false},"body":"Thanks. This is following the structure of @yzang's solid work in #278.  It seems be a good structure, with good abstract, and easy to extend for me. :) . Maybe we could change it later, when we found it is indeed not good extensible.\r\n@yzang to comments on this idea. ","created_at":"2017-09-27T00:19:11Z","updated_at":"2017-09-27T00:19:11Z","html_url":"https://github.com/apache/bookkeeper/pull/521#discussion_r141218462","pull_request_url":"https://api.github.com/repos/apache/bookkeeper/pulls/521","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/comments/141218462"},"html":{"href":"https://github.com/apache/bookkeeper/pull/521#discussion_r141218462"},"pull_request":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/521"}},"in_reply_to_id":140982513},"pull_request":{"url":"https://api.github.com/repos/apache/bookkeeper/pulls/521","id":142751774,"html_url":"https://github.com/apache/bookkeeper/pull/521","diff_url":"https://github.com/apache/bookkeeper/pull/521.diff","patch_url":"https://github.com/apache/bookkeeper/pull/521.patch","issue_url":"https://api.github.com/repos/apache/bookkeeper/issues/521","number":521,"state":"open","locked":false,"title":"Issue 520: Add more http endpoint","user":{"login":"zhaijack","id":26834121,"avatar_url":"https://avatars0.githubusercontent.com/u/26834121?v=4","gravatar_id":"","url":"https://api.github.com/users/zhaijack","html_url":"https://github.com/zhaijack","followers_url":"https://api.github.com/users/zhaijack/followers","following_url":"https://api.github.com/users/zhaijack/following{/other_user}","gists_url":"https://api.github.com/users/zhaijack/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaijack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaijack/subscriptions","organizations_url":"https://api.github.com/users/zhaijack/orgs","repos_url":"https://api.github.com/users/zhaijack/repos","events_url":"https://api.github.com/users/zhaijack/events{/privacy}","received_events_url":"https://api.github.com/users/zhaijack/received_events","type":"User","site_admin":false},"body":"Descriptions of the changes in this PR:\r\n\r\n#278 introduces BookKeeper Http Endpoint module. However there are only two endpoints, which is “/heartbeat” and “/api/config/serverConfig”. In order to fully leverage the http modules, The goal is to add more endpoints to this modules.\r\nPlease reference BP-17 for more details.\r\n\r\n> ---\r\n> Be sure to do all of the following to help us incorporate your contribution\r\n> quickly and easily:\r\n> \r\n> - [x] Make sure the PR title is formatted like:\r\n>     `<Issue # or BOOKKEEPER-#>: Description of pull request`\r\n>     `e.g. Issue 123: Description ...`\r\n>     `e.g. BOOKKEEPER-1234: Description ...`\r\n> - [x] Make sure tests pass via `mvn clean apache-rat:check install findbugs:check`.\r\n> - [x] Replace `<Issue # or BOOKKEEPER-#>` in the title with the actual Issue/JIRA number.\r\n> \r\n> ---\r\n","created_at":"2017-09-24T12:21:37Z","updated_at":"2017-09-27T00:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f739f031703731ea8676bd8af54930c6a4a8ea06","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/bookkeeper/pulls/521/commits","review_comments_url":"https://api.github.com/repos/apache/bookkeeper/pulls/521/comments","review_comment_url":"https://api.github.com/repos/apache/bookkeeper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/bookkeeper/issues/521/comments","statuses_url":"https://api.github.com/repos/apache/bookkeeper/statuses/37ce40c095ffcf380116c1142f4eb8635496c9f7","head":{"label":"zhaijack:http_endpoint","ref":"http_endpoint","sha":"37ce40c095ffcf380116c1142f4eb8635496c9f7","user":{"login":"zhaijack","id":26834121,"avatar_url":"https://avatars0.githubusercontent.com/u/26834121?v=4","gravatar_id":"","url":"https://api.github.com/users/zhaijack","html_url":"https://github.com/zhaijack","followers_url":"https://api.github.com/users/zhaijack/followers","following_url":"https://api.github.com/users/zhaijack/following{/other_user}","gists_url":"https://api.github.com/users/zhaijack/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaijack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaijack/subscriptions","organizations_url":"https://api.github.com/users/zhaijack/orgs","repos_url":"https://api.github.com/users/zhaijack/repos","events_url":"https://api.github.com/users/zhaijack/events{/privacy}","received_events_url":"https://api.github.com/users/zhaijack/received_events","type":"User","site_admin":false},"repo":{"id":89754301,"name":"bookkeeper","full_name":"zhaijack/bookkeeper","owner":{"login":"zhaijack","id":26834121,"avatar_url":"https://avatars0.githubusercontent.com/u/26834121?v=4","gravatar_id":"","url":"https://api.github.com/users/zhaijack","html_url":"https://github.com/zhaijack","followers_url":"https://api.github.com/users/zhaijack/followers","following_url":"https://api.github.com/users/zhaijack/following{/other_user}","gists_url":"https://api.github.com/users/zhaijack/gists{/gist_id}","starred_url":"https://api.github.com/users/zhaijack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhaijack/subscriptions","organizations_url":"https://api.github.com/users/zhaijack/orgs","repos_url":"https://api.github.com/users/zhaijack/repos","events_url":"https://api.github.com/users/zhaijack/events{/privacy}","received_events_url":"https://api.github.com/users/zhaijack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhaijack/bookkeeper","description":"Mirror of Apache Bookkeeper","fork":true,"url":"https://api.github.com/repos/zhaijack/bookkeeper","forks_url":"https://api.github.com/repos/zhaijack/bookkeeper/forks","keys_url":"https://api.github.com/repos/zhaijack/bookkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhaijack/bookkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhaijack/bookkeeper/teams","hooks_url":"https://api.github.com/repos/zhaijack/bookkeeper/hooks","issue_events_url":"https://api.github.com/repos/zhaijack/bookkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/zhaijack/bookkeeper/events","assignees_url":"https://api.github.com/repos/zhaijack/bookkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/zhaijack/bookkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/zhaijack/bookkeeper/tags","blobs_url":"https://api.github.com/repos/zhaijack/bookkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhaijack/bookkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhaijack/bookkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhaijack/bookkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhaijack/bookkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/zhaijack/bookkeeper/languages","stargazers_url":"https://api.github.com/repos/zhaijack/bookkeeper/stargazers","contributors_url":"https://api.github.com/repos/zhaijack/bookkeeper/contributors","subscribers_url":"https://api.github.com/repos/zhaijack/bookkeeper/subscribers","subscription_url":"https://api.github.com/repos/zhaijack/bookkeeper/subscription","commits_url":"https://api.github.com/repos/zhaijack/bookkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhaijack/bookkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhaijack/bookkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhaijack/bookkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhaijack/bookkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/zhaijack/bookkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhaijack/bookkeeper/merges","archive_url":"https://api.github.com/repos/zhaijack/bookkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhaijack/bookkeeper/downloads","issues_url":"https://api.github.com/repos/zhaijack/bookkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/zhaijack/bookkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/zhaijack/bookkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/zhaijack/bookkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhaijack/bookkeeper/labels{/name}","releases_url":"https://api.github.com/repos/zhaijack/bookkeeper/releases{/id}","deployments_url":"https://api.github.com/repos/zhaijack/bookkeeper/deployments","created_at":"2017-04-29T00:27:57Z","updated_at":"2017-04-29T00:28:00Z","pushed_at":"2017-09-26T15:09:16Z","git_url":"git://github.com/zhaijack/bookkeeper.git","ssh_url":"git@github.com:zhaijack/bookkeeper.git","clone_url":"https://github.com/zhaijack/bookkeeper.git","svn_url":"https://github.com/zhaijack/bookkeeper","homepage":null,"size":12710,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"apache:master","ref":"master","sha":"31bef62d7e63d5a8b198dd09ca2e72646a6bffc8","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":1575956,"name":"bookkeeper","full_name":"apache/bookkeeper","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/bookkeeper","description":"Apache Bookkeeper","fork":false,"url":"https://api.github.com/repos/apache/bookkeeper","forks_url":"https://api.github.com/repos/apache/bookkeeper/forks","keys_url":"https://api.github.com/repos/apache/bookkeeper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/bookkeeper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/bookkeeper/teams","hooks_url":"https://api.github.com/repos/apache/bookkeeper/hooks","issue_events_url":"https://api.github.com/repos/apache/bookkeeper/issues/events{/number}","events_url":"https://api.github.com/repos/apache/bookkeeper/events","assignees_url":"https://api.github.com/repos/apache/bookkeeper/assignees{/user}","branches_url":"https://api.github.com/repos/apache/bookkeeper/branches{/branch}","tags_url":"https://api.github.com/repos/apache/bookkeeper/tags","blobs_url":"https://api.github.com/repos/apache/bookkeeper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/bookkeeper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/bookkeeper/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/bookkeeper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/bookkeeper/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/bookkeeper/languages","stargazers_url":"https://api.github.com/repos/apache/bookkeeper/stargazers","contributors_url":"https://api.github.com/repos/apache/bookkeeper/contributors","subscribers_url":"https://api.github.com/repos/apache/bookkeeper/subscribers","subscription_url":"https://api.github.com/repos/apache/bookkeeper/subscription","commits_url":"https://api.github.com/repos/apache/bookkeeper/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/bookkeeper/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/bookkeeper/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/bookkeeper/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/bookkeeper/contents/{+path}","compare_url":"https://api.github.com/repos/apache/bookkeeper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/bookkeeper/merges","archive_url":"https://api.github.com/repos/apache/bookkeeper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/bookkeeper/downloads","issues_url":"https://api.github.com/repos/apache/bookkeeper/issues{/number}","pulls_url":"https://api.github.com/repos/apache/bookkeeper/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/bookkeeper/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/bookkeeper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/bookkeeper/labels{/name}","releases_url":"https://api.github.com/repos/apache/bookkeeper/releases{/id}","deployments_url":"https://api.github.com/repos/apache/bookkeeper/deployments","created_at":"2011-04-06T07:00:07Z","updated_at":"2017-09-24T04:07:55Z","pushed_at":"2017-09-26T14:09:44Z","git_url":"git://github.com/apache/bookkeeper.git","ssh_url":"git@github.com:apache/bookkeeper.git","clone_url":"https://github.com/apache/bookkeeper.git","svn_url":"https://github.com/apache/bookkeeper","homepage":"https://bookkeeper.apache.org","size":16488,"stargazers_count":187,"watchers_count":187,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":121,"mirror_url":null,"open_issues_count":65,"forks":121,"open_issues":65,"watchers":187,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/521"},"html":{"href":"https://github.com/apache/bookkeeper/pull/521"},"issue":{"href":"https://api.github.com/repos/apache/bookkeeper/issues/521"},"comments":{"href":"https://api.github.com/repos/apache/bookkeeper/issues/521/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/521/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/bookkeeper/pulls/521/commits"},"statuses":{"href":"https://api.github.com/repos/apache/bookkeeper/statuses/37ce40c095ffcf380116c1142f4eb8635496c9f7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zhaijack"}}