{"action":"created","comment":{"url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/comments/43892985","id":43892985,"diff_hunk":"@@ -322,7 +333,58 @@ public void onFailure(Exception e) {\n \t}\n \t\n \t\n-\tpublic synchronized void sendCallStatsConferenceStats(String stats, UserInfo userInfo) {\n+\tpublic synchronized void startStatsReportingForUser(String userID) {\n+\t\tif (userID == null) {\n+\t\t\tlogger.error(\"startStatsReportingForUser: Arguments cannot be null \");\n+\t\t\tthrow new IllegalArgumentException(\"startStatsReportingForUser: Arguments cannot be null\");\n+\t\t}\n+\t\tList<ConferenceStats> tempStats = confereneStatsMap.get(userID);\n+\t\tif (tempStats == null) {\n+\t\t\ttempStats = new ArrayList<ConferenceStats>();\n+\t\t\tconfereneStatsMap.put(userID, tempStats);\n+\t\t}\n+\t}\n+\n+\tpublic synchronized void stopStatsReportingForUser(String userID) {\n+\t\tif (userID == null) {\n+\t\t\tlogger.error(\"stopStatsReportingForUser: Arguments cannot be null \");\n+\t\t\tthrow new IllegalArgumentException(\"stopStatsReportingForUser: Arguments cannot be null\");\n+\t\t}\n+\t\tList<ConferenceStats> tempStats = confereneStatsMap.get(userID);\n+\n+\t\tif (tempStats != null && tempStats.size() > 0) {\n+\t\t\tStreamStats streamStats;\n+\t\t\tStreamStatsData streamStatsData;\n+\t\t\tConferenceStats conferenceStats = tempStats.get(0);\n+\t\t\tConferenceStatsData conferenceStatsData = new ConferenceStatsData(conferenceStats.getLocalUserID());\n+\t\t\tUserInfo info = new UserInfo(conferenceStats.getConfID(), conferenceStats.getLocalUserID(), conferenceStats.getUcID());\n+\t\t\tfor (ConferenceStats stats : tempStats) {\n+\t\t\t\tstreamStatsData = new StreamStatsData(stats.getRtt(), stats.getPacketsSent(), stats.getBytesSent(), stats.getJitter());\n+\t\t\t\tstreamStats = new StreamStats(stats.getFromUserID(), stats.getToUserID(), stats.getStatsType(), streamStatsData);\n+\t\t\t\tconferenceStatsData.addStreamStats(stats.getSsrc(), streamStats);\n+\t\t\t}\n+\n+\t\t\tString statsString = gson.toJson(conferenceStatsData);\n+\t\t\tlogger.debug(\"Stats string is \" + statsString);\n+\t\t\tsendCallStatsConferenceStats(statsString, info);\n+\t\t}\n+\t}\n+\n+\tpublic synchronized void sendConferenceStats(String userID, ConferenceStats stats) {\n+\t\tif (stats == null || userID == null) {\n+\t\t\tlogger.error(\"sendConferenceStats: Arguments cannot be null \");\n+\t\t\tthrow new IllegalArgumentException(\"sendConferenceStats: Arguments cannot be null\");\n+\t\t}\n+\t\tList<ConferenceStats> tempStats = confereneStatsMap.get(userID);\n+\t\tif (tempStats == null) {\n+\t\t\ttempStats = new ArrayList<ConferenceStats>();","path":"callstats-java-sdk/src/main/java/io/callstats/sdk/CallStats.java","position":78,"original_position":78,"commit_id":"b00b1bb5540ec517b82c9bd7aade33c21c1763a4","original_commit_id":"b00b1bb5540ec517b82c9bd7aade33c21c1763a4","user":{"login":"marcinag","id":1918281,"avatar_url":"https://avatars.githubusercontent.com/u/1918281?v=3","gravatar_id":"","url":"https://api.github.com/users/marcinag","html_url":"https://github.com/marcinag","followers_url":"https://api.github.com/users/marcinag/followers","following_url":"https://api.github.com/users/marcinag/following{/other_user}","gists_url":"https://api.github.com/users/marcinag/gists{/gist_id}","starred_url":"https://api.github.com/users/marcinag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcinag/subscriptions","organizations_url":"https://api.github.com/users/marcinag/orgs","repos_url":"https://api.github.com/users/marcinag/repos","events_url":"https://api.github.com/users/marcinag/events{/privacy}","received_events_url":"https://api.github.com/users/marcinag/received_events","type":"User","site_admin":false},"body":"if tempStats is null, it means that startReportingForUser() wasn't called. Should we throw an exception here?","created_at":"2015-11-04T15:23:12Z","updated_at":"2015-11-04T15:23:12Z","html_url":"https://github.com/callstats-io/callstats.java/pull/11#discussion_r43892985","pull_request_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/comments/43892985"},"html":{"href":"https://github.com/callstats-io/callstats.java/pull/11#discussion_r43892985"},"pull_request":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11","id":49692205,"html_url":"https://github.com/callstats-io/callstats.java/pull/11","diff_url":"https://github.com/callstats-io/callstats.java/pull/11.diff","patch_url":"https://github.com/callstats-io/callstats.java/pull/11.patch","issue_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/11","number":11,"state":"open","locked":false,"title":"Callstats conference stats handling with new object and start/stop way.","user":{"login":"karthikbr82","id":12692403,"avatar_url":"https://avatars.githubusercontent.com/u/12692403?v=3","gravatar_id":"","url":"https://api.github.com/users/karthikbr82","html_url":"https://github.com/karthikbr82","followers_url":"https://api.github.com/users/karthikbr82/followers","following_url":"https://api.github.com/users/karthikbr82/following{/other_user}","gists_url":"https://api.github.com/users/karthikbr82/gists{/gist_id}","starred_url":"https://api.github.com/users/karthikbr82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karthikbr82/subscriptions","organizations_url":"https://api.github.com/users/karthikbr82/orgs","repos_url":"https://api.github.com/users/karthikbr82/repos","events_url":"https://api.github.com/users/karthikbr82/events{/privacy}","received_events_url":"https://api.github.com/users/karthikbr82/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-11-04T14:09:07Z","updated_at":"2015-11-04T15:23:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02659883c572866835b8207ba125ca957c5d68e5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11/commits","review_comments_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11/comments","review_comment_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/11/comments","statuses_url":"https://api.github.com/repos/callstats-io/callstats.java/statuses/b00b1bb5540ec517b82c9bd7aade33c21c1763a4","head":{"label":"callstats-io:106949076-handling-conference-stats","ref":"106949076-handling-conference-stats","sha":"b00b1bb5540ec517b82c9bd7aade33c21c1763a4","user":{"login":"callstats-io","id":6125819,"avatar_url":"https://avatars.githubusercontent.com/u/6125819?v=3","gravatar_id":"","url":"https://api.github.com/users/callstats-io","html_url":"https://github.com/callstats-io","followers_url":"https://api.github.com/users/callstats-io/followers","following_url":"https://api.github.com/users/callstats-io/following{/other_user}","gists_url":"https://api.github.com/users/callstats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/callstats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callstats-io/subscriptions","organizations_url":"https://api.github.com/users/callstats-io/orgs","repos_url":"https://api.github.com/users/callstats-io/repos","events_url":"https://api.github.com/users/callstats-io/events{/privacy}","received_events_url":"https://api.github.com/users/callstats-io/received_events","type":"Organization","site_admin":false},"repo":{"id":23653549,"name":"callstats.java","full_name":"callstats-io/callstats.java","owner":{"login":"callstats-io","id":6125819,"avatar_url":"https://avatars.githubusercontent.com/u/6125819?v=3","gravatar_id":"","url":"https://api.github.com/users/callstats-io","html_url":"https://github.com/callstats-io","followers_url":"https://api.github.com/users/callstats-io/followers","following_url":"https://api.github.com/users/callstats-io/following{/other_user}","gists_url":"https://api.github.com/users/callstats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/callstats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callstats-io/subscriptions","organizations_url":"https://api.github.com/users/callstats-io/orgs","repos_url":"https://api.github.com/users/callstats-io/repos","events_url":"https://api.github.com/users/callstats-io/events{/privacy}","received_events_url":"https://api.github.com/users/callstats-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/callstats-io/callstats.java","description":"A java library to connect Android and java-based WebRTC apps to callstats.io. Also useful for integrating infrastructure components like the jitsi-videobridge, turn-server.","fork":false,"url":"https://api.github.com/repos/callstats-io/callstats.java","forks_url":"https://api.github.com/repos/callstats-io/callstats.java/forks","keys_url":"https://api.github.com/repos/callstats-io/callstats.java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/callstats-io/callstats.java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/callstats-io/callstats.java/teams","hooks_url":"https://api.github.com/repos/callstats-io/callstats.java/hooks","issue_events_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/events{/number}","events_url":"https://api.github.com/repos/callstats-io/callstats.java/events","assignees_url":"https://api.github.com/repos/callstats-io/callstats.java/assignees{/user}","branches_url":"https://api.github.com/repos/callstats-io/callstats.java/branches{/branch}","tags_url":"https://api.github.com/repos/callstats-io/callstats.java/tags","blobs_url":"https://api.github.com/repos/callstats-io/callstats.java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/callstats-io/callstats.java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/callstats-io/callstats.java/git/refs{/sha}","trees_url":"https://api.github.com/repos/callstats-io/callstats.java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/callstats-io/callstats.java/statuses/{sha}","languages_url":"https://api.github.com/repos/callstats-io/callstats.java/languages","stargazers_url":"https://api.github.com/repos/callstats-io/callstats.java/stargazers","contributors_url":"https://api.github.com/repos/callstats-io/callstats.java/contributors","subscribers_url":"https://api.github.com/repos/callstats-io/callstats.java/subscribers","subscription_url":"https://api.github.com/repos/callstats-io/callstats.java/subscription","commits_url":"https://api.github.com/repos/callstats-io/callstats.java/commits{/sha}","git_commits_url":"https://api.github.com/repos/callstats-io/callstats.java/git/commits{/sha}","comments_url":"https://api.github.com/repos/callstats-io/callstats.java/comments{/number}","issue_comment_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/comments{/number}","contents_url":"https://api.github.com/repos/callstats-io/callstats.java/contents/{+path}","compare_url":"https://api.github.com/repos/callstats-io/callstats.java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/callstats-io/callstats.java/merges","archive_url":"https://api.github.com/repos/callstats-io/callstats.java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/callstats-io/callstats.java/downloads","issues_url":"https://api.github.com/repos/callstats-io/callstats.java/issues{/number}","pulls_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls{/number}","milestones_url":"https://api.github.com/repos/callstats-io/callstats.java/milestones{/number}","notifications_url":"https://api.github.com/repos/callstats-io/callstats.java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/callstats-io/callstats.java/labels{/name}","releases_url":"https://api.github.com/repos/callstats-io/callstats.java/releases{/id}","created_at":"2014-09-04T07:53:44Z","updated_at":"2015-09-07T16:15:29Z","pushed_at":"2015-11-04T14:09:08Z","git_url":"git://github.com/callstats-io/callstats.java.git","ssh_url":"git@github.com:callstats-io/callstats.java.git","clone_url":"https://github.com/callstats-io/callstats.java.git","svn_url":"https://github.com/callstats-io/callstats.java","homepage":null,"size":648,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"callstats-io:master","ref":"master","sha":"4bfb69dc14262847c10ead9238edebc32a6a5e93","user":{"login":"callstats-io","id":6125819,"avatar_url":"https://avatars.githubusercontent.com/u/6125819?v=3","gravatar_id":"","url":"https://api.github.com/users/callstats-io","html_url":"https://github.com/callstats-io","followers_url":"https://api.github.com/users/callstats-io/followers","following_url":"https://api.github.com/users/callstats-io/following{/other_user}","gists_url":"https://api.github.com/users/callstats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/callstats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callstats-io/subscriptions","organizations_url":"https://api.github.com/users/callstats-io/orgs","repos_url":"https://api.github.com/users/callstats-io/repos","events_url":"https://api.github.com/users/callstats-io/events{/privacy}","received_events_url":"https://api.github.com/users/callstats-io/received_events","type":"Organization","site_admin":false},"repo":{"id":23653549,"name":"callstats.java","full_name":"callstats-io/callstats.java","owner":{"login":"callstats-io","id":6125819,"avatar_url":"https://avatars.githubusercontent.com/u/6125819?v=3","gravatar_id":"","url":"https://api.github.com/users/callstats-io","html_url":"https://github.com/callstats-io","followers_url":"https://api.github.com/users/callstats-io/followers","following_url":"https://api.github.com/users/callstats-io/following{/other_user}","gists_url":"https://api.github.com/users/callstats-io/gists{/gist_id}","starred_url":"https://api.github.com/users/callstats-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callstats-io/subscriptions","organizations_url":"https://api.github.com/users/callstats-io/orgs","repos_url":"https://api.github.com/users/callstats-io/repos","events_url":"https://api.github.com/users/callstats-io/events{/privacy}","received_events_url":"https://api.github.com/users/callstats-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/callstats-io/callstats.java","description":"A java library to connect Android and java-based WebRTC apps to callstats.io. Also useful for integrating infrastructure components like the jitsi-videobridge, turn-server.","fork":false,"url":"https://api.github.com/repos/callstats-io/callstats.java","forks_url":"https://api.github.com/repos/callstats-io/callstats.java/forks","keys_url":"https://api.github.com/repos/callstats-io/callstats.java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/callstats-io/callstats.java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/callstats-io/callstats.java/teams","hooks_url":"https://api.github.com/repos/callstats-io/callstats.java/hooks","issue_events_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/events{/number}","events_url":"https://api.github.com/repos/callstats-io/callstats.java/events","assignees_url":"https://api.github.com/repos/callstats-io/callstats.java/assignees{/user}","branches_url":"https://api.github.com/repos/callstats-io/callstats.java/branches{/branch}","tags_url":"https://api.github.com/repos/callstats-io/callstats.java/tags","blobs_url":"https://api.github.com/repos/callstats-io/callstats.java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/callstats-io/callstats.java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/callstats-io/callstats.java/git/refs{/sha}","trees_url":"https://api.github.com/repos/callstats-io/callstats.java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/callstats-io/callstats.java/statuses/{sha}","languages_url":"https://api.github.com/repos/callstats-io/callstats.java/languages","stargazers_url":"https://api.github.com/repos/callstats-io/callstats.java/stargazers","contributors_url":"https://api.github.com/repos/callstats-io/callstats.java/contributors","subscribers_url":"https://api.github.com/repos/callstats-io/callstats.java/subscribers","subscription_url":"https://api.github.com/repos/callstats-io/callstats.java/subscription","commits_url":"https://api.github.com/repos/callstats-io/callstats.java/commits{/sha}","git_commits_url":"https://api.github.com/repos/callstats-io/callstats.java/git/commits{/sha}","comments_url":"https://api.github.com/repos/callstats-io/callstats.java/comments{/number}","issue_comment_url":"https://api.github.com/repos/callstats-io/callstats.java/issues/comments{/number}","contents_url":"https://api.github.com/repos/callstats-io/callstats.java/contents/{+path}","compare_url":"https://api.github.com/repos/callstats-io/callstats.java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/callstats-io/callstats.java/merges","archive_url":"https://api.github.com/repos/callstats-io/callstats.java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/callstats-io/callstats.java/downloads","issues_url":"https://api.github.com/repos/callstats-io/callstats.java/issues{/number}","pulls_url":"https://api.github.com/repos/callstats-io/callstats.java/pulls{/number}","milestones_url":"https://api.github.com/repos/callstats-io/callstats.java/milestones{/number}","notifications_url":"https://api.github.com/repos/callstats-io/callstats.java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/callstats-io/callstats.java/labels{/name}","releases_url":"https://api.github.com/repos/callstats-io/callstats.java/releases{/id}","created_at":"2014-09-04T07:53:44Z","updated_at":"2015-09-07T16:15:29Z","pushed_at":"2015-11-04T14:09:08Z","git_url":"git://github.com/callstats-io/callstats.java.git","ssh_url":"git@github.com:callstats-io/callstats.java.git","clone_url":"https://github.com/callstats-io/callstats.java.git","svn_url":"https://github.com/callstats-io/callstats.java","homepage":null,"size":648,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11"},"html":{"href":"https://github.com/callstats-io/callstats.java/pull/11"},"issue":{"href":"https://api.github.com/repos/callstats-io/callstats.java/issues/11"},"comments":{"href":"https://api.github.com/repos/callstats-io/callstats.java/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/callstats-io/callstats.java/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/callstats-io/callstats.java/statuses/b00b1bb5540ec517b82c9bd7aade33c21c1763a4"}}}}