{"action":"created","comment":{"url":"https://api.github.com/repos/linagora/james-project/pulls/comments/129539166","pull_request_review_id":52321179,"id":129539166,"diff_hunk":"@@ -59,17 +77,73 @@ public DomainRoutes(DomainList domainList, JsonTransformer jsonTransformer) {\n \n     @Override\n     public void define(Service service) {\n-        service.get(DOMAINS,\n-            (request, response) -> domainList.getDomains(),\n-            jsonTransformer);\n+        this.service = service;\n \n-        service.get(SPECIFIC_DOMAIN, this::exists);\n+        getDomains();\n \n-        service.put(SPECIFIC_DOMAIN, this::addDomain);\n+        domainIsExisted();\n+\n+        addDomain();\n \n+        deleteDomain();\n+    }\n+\n+    @DELETE\n+    @Path(\"/{domainName}\")\n+    @ApiOperation(value = \"Deleting a domain\")\n+    @ApiImplicitParams({\n+            @ApiImplicitParam(required = true, dataType = \"string\", name = \"domainName\", paramType = \"path\")\n+    })\n+    @ApiResponses(value = {\n+            @ApiResponse(code = 204, message = \"OK. Domain is removed.\"),\n+            @ApiResponse(code = 500, message = \"Internal server error - Something went bad on the server side.\")\n+    })\n+    public void deleteDomain() {\n         service.delete(SPECIFIC_DOMAIN, this::removeDomain);\n     }\n \n+    @PUT\n+    @Path(\"/{domainName}\")\n+    @ApiOperation(value = \"Creating new domain\")\n+    @ApiImplicitParams({\n+            @ApiImplicitParam(required = true, dataType = \"string\", name = \"domainName\", paramType = \"path\")\n+    })\n+    @ApiResponses(value = {\n+            @ApiResponse(code = 204, message = \"OK. New domain is created.\"),\n+            @ApiResponse(code = 400, message = \"Invalid request for domain creation\"),\n+            @ApiResponse(code = 500, message = \"Internal server error - Something went bad on the server side.\")\n+    })\n+    public void addDomain() {\n+        service.put(SPECIFIC_DOMAIN, this::addDomain);\n+    }\n+\n+    @GET\n+    @Path(\"/{domainName}\")\n+    @ApiImplicitParams({\n+            @ApiImplicitParam(required = true, dataType = \"string\", name = \"domainName\", paramType = \"path\")\n+    })\n+    @ApiOperation(value = \"Testing existence of a domain.\")\n+    @ApiResponses(value = {\n+            @ApiResponse(code = 204, message = \"The domain exists\", response=String.class),\n+            @ApiResponse(code = 404, message = \"The domain does not exist.\"),\n+            @ApiResponse(code = 500, message = \"Internal server error - Something went bad on the server side.\")\n+    })\n+    public void domainIsExisted() {\n+        service.get(SPECIFIC_DOMAIN, this::exists);\n+    }\n+\n+    @GET\n+    @ApiOperation(value = \"Getting all domains\")\n+    @ApiResponses(value = {\n+            @ApiResponse(code = 204, message = \"OK\", response = List.class),","path":"server/protocols/webadmin/webadmin-data/src/main/java/org/apache/james/webadmin/routes/DomainRoutes.java","position":113,"original_position":113,"commit_id":"8bd4f31fd760603b0c83684f07c498894283b0a9","original_commit_id":"8bd4f31fd760603b0c83684f07c498894283b0a9","user":{"login":"chibenwa","id":6928740,"avatar_url":"https://avatars1.githubusercontent.com/u/6928740?v=4","gravatar_id":"","url":"https://api.github.com/users/chibenwa","html_url":"https://github.com/chibenwa","followers_url":"https://api.github.com/users/chibenwa/followers","following_url":"https://api.github.com/users/chibenwa/following{/other_user}","gists_url":"https://api.github.com/users/chibenwa/gists{/gist_id}","starred_url":"https://api.github.com/users/chibenwa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chibenwa/subscriptions","organizations_url":"https://api.github.com/users/chibenwa/orgs","repos_url":"https://api.github.com/users/chibenwa/repos","events_url":"https://api.github.com/users/chibenwa/events{/privacy}","received_events_url":"https://api.github.com/users/chibenwa/received_events","type":"User","site_admin":false},"body":"List of what?","created_at":"2017-07-26T10:47:39Z","updated_at":"2017-07-26T10:47:39Z","html_url":"https://github.com/linagora/james-project/pull/905#discussion_r129539166","pull_request_url":"https://api.github.com/repos/linagora/james-project/pulls/905","_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments/129539166"},"html":{"href":"https://github.com/linagora/james-project/pull/905#discussion_r129539166"},"pull_request":{"href":"https://api.github.com/repos/linagora/james-project/pulls/905"}}},"pull_request":{"url":"https://api.github.com/repos/linagora/james-project/pulls/905","id":132191624,"html_url":"https://github.com/linagora/james-project/pull/905","diff_url":"https://github.com/linagora/james-project/pull/905.diff","patch_url":"https://github.com/linagora/james-project/pull/905.patch","issue_url":"https://api.github.com/repos/linagora/james-project/issues/905","number":905,"state":"open","locked":false,"title":"JAMES-2099: Add James REST API to expose the swagger API","user":{"login":"quynhn","id":296170,"avatar_url":"https://avatars2.githubusercontent.com/u/296170?v=4","gravatar_id":"","url":"https://api.github.com/users/quynhn","html_url":"https://github.com/quynhn","followers_url":"https://api.github.com/users/quynhn/followers","following_url":"https://api.github.com/users/quynhn/following{/other_user}","gists_url":"https://api.github.com/users/quynhn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhn/subscriptions","organizations_url":"https://api.github.com/users/quynhn/orgs","repos_url":"https://api.github.com/users/quynhn/repos","events_url":"https://api.github.com/users/quynhn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhn/received_events","type":"User","site_admin":false},"body":"- It exposes new API which contain swagger json value\r\n- It still contains hard code to point to the james webadmin server --> need to find a way to configure it\r\n","created_at":"2017-07-25T03:57:11Z","updated_at":"2017-07-26T10:47:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d29e2745982d38f7cce949ea0eb9dd0f60eaff97","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/linagora/james-project/pulls/905/commits","review_comments_url":"https://api.github.com/repos/linagora/james-project/pulls/905/comments","review_comment_url":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linagora/james-project/issues/905/comments","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/8bd4f31fd760603b0c83684f07c498894283b0a9","head":{"label":"quynhn:JAMES-2099","ref":"JAMES-2099","sha":"8bd4f31fd760603b0c83684f07c498894283b0a9","user":{"login":"quynhn","id":296170,"avatar_url":"https://avatars2.githubusercontent.com/u/296170?v=4","gravatar_id":"","url":"https://api.github.com/users/quynhn","html_url":"https://github.com/quynhn","followers_url":"https://api.github.com/users/quynhn/followers","following_url":"https://api.github.com/users/quynhn/following{/other_user}","gists_url":"https://api.github.com/users/quynhn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhn/subscriptions","organizations_url":"https://api.github.com/users/quynhn/orgs","repos_url":"https://api.github.com/users/quynhn/repos","events_url":"https://api.github.com/users/quynhn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhn/received_events","type":"User","site_admin":false},"repo":{"id":58912828,"name":"james-project","full_name":"quynhn/james-project","owner":{"login":"quynhn","id":296170,"avatar_url":"https://avatars2.githubusercontent.com/u/296170?v=4","gravatar_id":"","url":"https://api.github.com/users/quynhn","html_url":"https://github.com/quynhn","followers_url":"https://api.github.com/users/quynhn/followers","following_url":"https://api.github.com/users/quynhn/following{/other_user}","gists_url":"https://api.github.com/users/quynhn/gists{/gist_id}","starred_url":"https://api.github.com/users/quynhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quynhn/subscriptions","organizations_url":"https://api.github.com/users/quynhn/orgs","repos_url":"https://api.github.com/users/quynhn/repos","events_url":"https://api.github.com/users/quynhn/events{/privacy}","received_events_url":"https://api.github.com/users/quynhn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/quynhn/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/quynhn/james-project","forks_url":"https://api.github.com/repos/quynhn/james-project/forks","keys_url":"https://api.github.com/repos/quynhn/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quynhn/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quynhn/james-project/teams","hooks_url":"https://api.github.com/repos/quynhn/james-project/hooks","issue_events_url":"https://api.github.com/repos/quynhn/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/quynhn/james-project/events","assignees_url":"https://api.github.com/repos/quynhn/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/quynhn/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/quynhn/james-project/tags","blobs_url":"https://api.github.com/repos/quynhn/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quynhn/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quynhn/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/quynhn/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quynhn/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/quynhn/james-project/languages","stargazers_url":"https://api.github.com/repos/quynhn/james-project/stargazers","contributors_url":"https://api.github.com/repos/quynhn/james-project/contributors","subscribers_url":"https://api.github.com/repos/quynhn/james-project/subscribers","subscription_url":"https://api.github.com/repos/quynhn/james-project/subscription","commits_url":"https://api.github.com/repos/quynhn/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/quynhn/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/quynhn/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/quynhn/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/quynhn/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/quynhn/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quynhn/james-project/merges","archive_url":"https://api.github.com/repos/quynhn/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quynhn/james-project/downloads","issues_url":"https://api.github.com/repos/quynhn/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/quynhn/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/quynhn/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/quynhn/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quynhn/james-project/labels{/name}","releases_url":"https://api.github.com/repos/quynhn/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/quynhn/james-project/deployments","created_at":"2016-05-16T07:35:33Z","updated_at":"2016-05-16T07:35:44Z","pushed_at":"2017-07-26T09:00:15Z","git_url":"git://github.com/quynhn/james-project.git","ssh_url":"git@github.com:quynhn/james-project.git","clone_url":"https://github.com/quynhn/james-project.git","svn_url":"https://github.com/quynhn/james-project","homepage":null,"size":23413,"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":"linagora:master","ref":"master","sha":"f635520cd3e5b6011ee6b921c826cbfdb670506a","user":{"login":"linagora","id":1230365,"avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"repo":{"id":39182136,"name":"james-project","full_name":"linagora/james-project","owner":{"login":"linagora","id":1230365,"avatar_url":"https://avatars3.githubusercontent.com/u/1230365?v=4","gravatar_id":"","url":"https://api.github.com/users/linagora","html_url":"https://github.com/linagora","followers_url":"https://api.github.com/users/linagora/followers","following_url":"https://api.github.com/users/linagora/following{/other_user}","gists_url":"https://api.github.com/users/linagora/gists{/gist_id}","starred_url":"https://api.github.com/users/linagora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagora/subscriptions","organizations_url":"https://api.github.com/users/linagora/orgs","repos_url":"https://api.github.com/users/linagora/repos","events_url":"https://api.github.com/users/linagora/events{/privacy}","received_events_url":"https://api.github.com/users/linagora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linagora/james-project","description":"Mirror of Apache James Project","fork":true,"url":"https://api.github.com/repos/linagora/james-project","forks_url":"https://api.github.com/repos/linagora/james-project/forks","keys_url":"https://api.github.com/repos/linagora/james-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linagora/james-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linagora/james-project/teams","hooks_url":"https://api.github.com/repos/linagora/james-project/hooks","issue_events_url":"https://api.github.com/repos/linagora/james-project/issues/events{/number}","events_url":"https://api.github.com/repos/linagora/james-project/events","assignees_url":"https://api.github.com/repos/linagora/james-project/assignees{/user}","branches_url":"https://api.github.com/repos/linagora/james-project/branches{/branch}","tags_url":"https://api.github.com/repos/linagora/james-project/tags","blobs_url":"https://api.github.com/repos/linagora/james-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linagora/james-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linagora/james-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/linagora/james-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linagora/james-project/statuses/{sha}","languages_url":"https://api.github.com/repos/linagora/james-project/languages","stargazers_url":"https://api.github.com/repos/linagora/james-project/stargazers","contributors_url":"https://api.github.com/repos/linagora/james-project/contributors","subscribers_url":"https://api.github.com/repos/linagora/james-project/subscribers","subscription_url":"https://api.github.com/repos/linagora/james-project/subscription","commits_url":"https://api.github.com/repos/linagora/james-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/linagora/james-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/linagora/james-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/linagora/james-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/linagora/james-project/contents/{+path}","compare_url":"https://api.github.com/repos/linagora/james-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linagora/james-project/merges","archive_url":"https://api.github.com/repos/linagora/james-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linagora/james-project/downloads","issues_url":"https://api.github.com/repos/linagora/james-project/issues{/number}","pulls_url":"https://api.github.com/repos/linagora/james-project/pulls{/number}","milestones_url":"https://api.github.com/repos/linagora/james-project/milestones{/number}","notifications_url":"https://api.github.com/repos/linagora/james-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linagora/james-project/labels{/name}","releases_url":"https://api.github.com/repos/linagora/james-project/releases{/id}","deployments_url":"https://api.github.com/repos/linagora/james-project/deployments","created_at":"2015-07-16T07:04:59Z","updated_at":"2017-06-30T07:13:12Z","pushed_at":"2017-07-26T09:00:16Z","git_url":"git://github.com/linagora/james-project.git","ssh_url":"git@github.com:linagora/james-project.git","clone_url":"https://github.com/linagora/james-project.git","svn_url":"https://github.com/linagora/james-project","homepage":null,"size":22636,"stargazers_count":11,"watchers_count":11,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":26,"forks":17,"open_issues":26,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linagora/james-project/pulls/905"},"html":{"href":"https://github.com/linagora/james-project/pull/905"},"issue":{"href":"https://api.github.com/repos/linagora/james-project/issues/905"},"comments":{"href":"https://api.github.com/repos/linagora/james-project/issues/905/comments"},"review_comments":{"href":"https://api.github.com/repos/linagora/james-project/pulls/905/comments"},"review_comment":{"href":"https://api.github.com/repos/linagora/james-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linagora/james-project/pulls/905/commits"},"statuses":{"href":"https://api.github.com/repos/linagora/james-project/statuses/8bd4f31fd760603b0c83684f07c498894283b0a9"}}}}
{"actor":{"display_login":"chibenwa"}}