{"action":"created","comment":{"url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/comments/54622789","id":54622789,"diff_hunk":"@@ -0,0 +1,98 @@\n+package ru.cdecl.pub.iota.endpoints;\n+\n+import ru.cdecl.pub.iota.models.UserLoginRequest;\n+import ru.cdecl.pub.iota.models.UserLoginResponse;\n+import ru.cdecl.pub.iota.models.UserProfile;\n+import ru.cdecl.pub.iota.models.base.BaseApiResponse;\n+import ru.cdecl.pub.iota.models.base.BaseUserIdResponse;\n+import ru.cdecl.pub.iota.services.AuthenticationService;\n+import ru.cdecl.pub.iota.services.UserProfileService;\n+\n+import javax.inject.Singleton;\n+import javax.servlet.http.HttpServletRequest;\n+import javax.servlet.http.HttpSession;\n+import javax.ws.rs.*;\n+import javax.ws.rs.core.Context;\n+import javax.ws.rs.core.MediaType;\n+import javax.ws.rs.core.Response;\n+\n+@Singleton\n+@Path(\"/session\")\n+@Consumes(MediaType.APPLICATION_JSON)\n+@Produces(MediaType.APPLICATION_JSON)\n+public class SessionEndpoint {\n+\n+    private final UserProfileService userProfileService;\n+    private final AuthenticationService authenticationService;\n+\n+    public SessionEndpoint(UserProfileService userProfileService, AuthenticationService authenticationService) {\n+        this.userProfileService = userProfileService;\n+        this.authenticationService = authenticationService;\n+    }\n+\n+    @GET\n+    public Response getUserId(@Context HttpServletRequest httpServletRequest) {\n+        final HttpSession httpSession = httpServletRequest.getSession(false);\n+\n+        if (httpSession != null) {\n+            synchronized (httpSession.getId().intern()) {","path":"src/main/java/ru/cdecl/pub/iota/endpoints/SessionEndpoint.java","position":38,"original_position":38,"commit_id":"e67897d3fb7490a904082de79a91c943534a58fd","original_commit_id":"e67897d3fb7490a904082de79a91c943534a58fd","user":{"login":"KSolovyev","id":4122313,"avatar_url":"https://avatars.githubusercontent.com/u/4122313?v=3","gravatar_id":"","url":"https://api.github.com/users/KSolovyev","html_url":"https://github.com/KSolovyev","followers_url":"https://api.github.com/users/KSolovyev/followers","following_url":"https://api.github.com/users/KSolovyev/following{/other_user}","gists_url":"https://api.github.com/users/KSolovyev/gists{/gist_id}","starred_url":"https://api.github.com/users/KSolovyev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KSolovyev/subscriptions","organizations_url":"https://api.github.com/users/KSolovyev/orgs","repos_url":"https://api.github.com/users/KSolovyev/repos","events_url":"https://api.github.com/users/KSolovyev/events{/privacy}","received_events_url":"https://api.github.com/users/KSolovyev/received_events","type":"User","site_admin":false},"body":"нет, так мы делать не будем. Synchronized надо убрать.","created_at":"2016-03-01T19:40:31Z","updated_at":"2016-03-01T19:40:31Z","html_url":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1#discussion_r54622789","pull_request_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/comments/54622789"},"html":{"href":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1#discussion_r54622789"},"pull_request":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1","id":61186984,"html_url":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1","diff_url":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1.diff","patch_url":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1.patch","issue_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/1","number":1,"state":"open","locked":false,"title":"rk1-api","user":{"login":"darkwrat","id":1160968,"avatar_url":"https://avatars.githubusercontent.com/u/1160968?v=3","gravatar_id":"","url":"https://api.github.com/users/darkwrat","html_url":"https://github.com/darkwrat","followers_url":"https://api.github.com/users/darkwrat/followers","following_url":"https://api.github.com/users/darkwrat/following{/other_user}","gists_url":"https://api.github.com/users/darkwrat/gists{/gist_id}","starred_url":"https://api.github.com/users/darkwrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkwrat/subscriptions","organizations_url":"https://api.github.com/users/darkwrat/orgs","repos_url":"https://api.github.com/users/darkwrat/repos","events_url":"https://api.github.com/users/darkwrat/events{/privacy}","received_events_url":"https://api.github.com/users/darkwrat/received_events","type":"User","site_admin":false},"body":"http://iota.ian.corp.cdecl.ru","created_at":"2016-03-01T03:24:21Z","updated_at":"2016-03-01T19:40:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c41d6a2bd4fa9ab66d4c2f58a6702422b7ce7af3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1/commits","review_comments_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1/comments","review_comment_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/1/comments","statuses_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/statuses/e67897d3fb7490a904082de79a91c943534a58fd","head":{"label":"darkwrat:master","ref":"master","sha":"e67897d3fb7490a904082de79a91c943534a58fd","user":{"login":"darkwrat","id":1160968,"avatar_url":"https://avatars.githubusercontent.com/u/1160968?v=3","gravatar_id":"","url":"https://api.github.com/users/darkwrat","html_url":"https://github.com/darkwrat","followers_url":"https://api.github.com/users/darkwrat/followers","following_url":"https://api.github.com/users/darkwrat/following{/other_user}","gists_url":"https://api.github.com/users/darkwrat/gists{/gist_id}","starred_url":"https://api.github.com/users/darkwrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkwrat/subscriptions","organizations_url":"https://api.github.com/users/darkwrat/orgs","repos_url":"https://api.github.com/users/darkwrat/repos","events_url":"https://api.github.com/users/darkwrat/events{/privacy}","received_events_url":"https://api.github.com/users/darkwrat/received_events","type":"User","site_admin":false},"repo":{"id":51742556,"name":"2016-02-IOTA","full_name":"darkwrat/2016-02-IOTA","owner":{"login":"darkwrat","id":1160968,"avatar_url":"https://avatars.githubusercontent.com/u/1160968?v=3","gravatar_id":"","url":"https://api.github.com/users/darkwrat","html_url":"https://github.com/darkwrat","followers_url":"https://api.github.com/users/darkwrat/followers","following_url":"https://api.github.com/users/darkwrat/following{/other_user}","gists_url":"https://api.github.com/users/darkwrat/gists{/gist_id}","starred_url":"https://api.github.com/users/darkwrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkwrat/subscriptions","organizations_url":"https://api.github.com/users/darkwrat/orgs","repos_url":"https://api.github.com/users/darkwrat/repos","events_url":"https://api.github.com/users/darkwrat/events{/privacy}","received_events_url":"https://api.github.com/users/darkwrat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darkwrat/2016-02-IOTA","description":"Настольная игра IOTA","fork":true,"url":"https://api.github.com/repos/darkwrat/2016-02-IOTA","forks_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/forks","keys_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/teams","hooks_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/hooks","issue_events_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/issues/events{/number}","events_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/events","assignees_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/assignees{/user}","branches_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/branches{/branch}","tags_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/tags","blobs_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/git/refs{/sha}","trees_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/statuses/{sha}","languages_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/languages","stargazers_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/stargazers","contributors_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/contributors","subscribers_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/subscribers","subscription_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/subscription","commits_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/commits{/sha}","git_commits_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/git/commits{/sha}","comments_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/comments{/number}","issue_comment_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/issues/comments{/number}","contents_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/contents/{+path}","compare_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/merges","archive_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/downloads","issues_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/issues{/number}","pulls_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/pulls{/number}","milestones_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/milestones{/number}","notifications_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/labels{/name}","releases_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/releases{/id}","deployments_url":"https://api.github.com/repos/darkwrat/2016-02-IOTA/deployments","created_at":"2016-02-15T08:54:50Z","updated_at":"2016-03-01T03:22:29Z","pushed_at":"2016-03-01T18:15:04Z","git_url":"git://github.com/darkwrat/2016-02-IOTA.git","ssh_url":"git@github.com:darkwrat/2016-02-IOTA.git","clone_url":"https://github.com/darkwrat/2016-02-IOTA.git","svn_url":"https://github.com/darkwrat/2016-02-IOTA","homepage":null,"size":228,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":0,"forks":3,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"java-park-mail-ru:master","ref":"master","sha":"9cd26a3b4786ea8f3d2a75e04c126b8be19896cd","user":{"login":"java-park-mail-ru","id":17194939,"avatar_url":"https://avatars.githubusercontent.com/u/17194939?v=3","gravatar_id":"","url":"https://api.github.com/users/java-park-mail-ru","html_url":"https://github.com/java-park-mail-ru","followers_url":"https://api.github.com/users/java-park-mail-ru/followers","following_url":"https://api.github.com/users/java-park-mail-ru/following{/other_user}","gists_url":"https://api.github.com/users/java-park-mail-ru/gists{/gist_id}","starred_url":"https://api.github.com/users/java-park-mail-ru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-park-mail-ru/subscriptions","organizations_url":"https://api.github.com/users/java-park-mail-ru/orgs","repos_url":"https://api.github.com/users/java-park-mail-ru/repos","events_url":"https://api.github.com/users/java-park-mail-ru/events{/privacy}","received_events_url":"https://api.github.com/users/java-park-mail-ru/received_events","type":"Organization","site_admin":false},"repo":{"id":51739068,"name":"2016-02-IOTA","full_name":"java-park-mail-ru/2016-02-IOTA","owner":{"login":"java-park-mail-ru","id":17194939,"avatar_url":"https://avatars.githubusercontent.com/u/17194939?v=3","gravatar_id":"","url":"https://api.github.com/users/java-park-mail-ru","html_url":"https://github.com/java-park-mail-ru","followers_url":"https://api.github.com/users/java-park-mail-ru/followers","following_url":"https://api.github.com/users/java-park-mail-ru/following{/other_user}","gists_url":"https://api.github.com/users/java-park-mail-ru/gists{/gist_id}","starred_url":"https://api.github.com/users/java-park-mail-ru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/java-park-mail-ru/subscriptions","organizations_url":"https://api.github.com/users/java-park-mail-ru/orgs","repos_url":"https://api.github.com/users/java-park-mail-ru/repos","events_url":"https://api.github.com/users/java-park-mail-ru/events{/privacy}","received_events_url":"https://api.github.com/users/java-park-mail-ru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/java-park-mail-ru/2016-02-IOTA","description":"Настольная игра IOTA","fork":false,"url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA","forks_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/forks","keys_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/teams","hooks_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/hooks","issue_events_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/events{/number}","events_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/events","assignees_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/assignees{/user}","branches_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/branches{/branch}","tags_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/tags","blobs_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/git/refs{/sha}","trees_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/statuses/{sha}","languages_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/languages","stargazers_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/stargazers","contributors_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/contributors","subscribers_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/subscribers","subscription_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/subscription","commits_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/commits{/sha}","git_commits_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/git/commits{/sha}","comments_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/comments{/number}","issue_comment_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/comments{/number}","contents_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/contents/{+path}","compare_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/merges","archive_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/downloads","issues_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues{/number}","pulls_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls{/number}","milestones_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/milestones{/number}","notifications_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/labels{/name}","releases_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/releases{/id}","deployments_url":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/deployments","created_at":"2016-02-15T07:48:16Z","updated_at":"2016-02-15T07:48:16Z","pushed_at":"2016-03-01T18:01:00Z","git_url":"git://github.com/java-park-mail-ru/2016-02-IOTA.git","ssh_url":"git@github.com:java-park-mail-ru/2016-02-IOTA.git","clone_url":"https://github.com/java-park-mail-ru/2016-02-IOTA.git","svn_url":"https://github.com/java-park-mail-ru/2016-02-IOTA","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":1,"forks":4,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1"},"html":{"href":"https://github.com/java-park-mail-ru/2016-02-IOTA/pull/1"},"issue":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/1"},"comments":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/java-park-mail-ru/2016-02-IOTA/statuses/e67897d3fb7490a904082de79a91c943534a58fd"}}}}