{"action":"created","comment":{"url":"https://api.github.com/repos/qualfacul/poseidon/pulls/comments/63298037","id":63298037,"diff_hunk":"@@ -0,0 +1,53 @@\n+package com.poseidon.college;\n+\n+import static javax.ws.rs.core.HttpHeaders.AUTHORIZATION;\n+import static javax.ws.rs.core.HttpHeaders.CONTENT_TYPE;\n+import static javax.ws.rs.core.MediaType.APPLICATION_JSON;\n+\n+import javax.ws.rs.client.Client;\n+import javax.ws.rs.client.Entity;\n+import javax.ws.rs.core.Response;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.beans.factory.annotation.Value;\n+import org.springframework.stereotype.Component;\n+\n+import com.fasterxml.jackson.core.JsonProcessingException;\n+import com.fasterxml.jackson.databind.ObjectMapper;\n+import com.hermes.college.CollegeMecDTO;\n+\n+@Component\n+class JerseyCollegeDAO implements CollegeRepository {\n+\t\n+\tprivate static final Logger LOGGER = LoggerFactory.getLogger(JerseyCollegeDAO.class);\n+\tprivate static final String COLLEGES_ENDPOINT = \"https://localhost:6660/admin/colleges\";\n+\t\n+\t@Value(\"${internal.key}\")\n+\tprivate String internalKey;\n+\t\n+\t@Autowired\n+\tprivate ObjectMapper mapper;\n+\t\n+\t@Autowired\n+\tprivate Client client;\n+\t\n+\t@Override\n+\tpublic void updateOrSave(CollegeMecDTO dto) {\n+\t\ttry {\n+\t\t\tString json = mapper.writeValueAsString(dto);\n+\t\t\tResponse response = client.target(COLLEGES_ENDPOINT)\n+\t\t\t\t  .request(APPLICATION_JSON)\n+\t\t\t\t  .header(CONTENT_TYPE, APPLICATION_JSON)\n+\t\t\t\t  .header(AUTHORIZATION, internalKey)\n+\t\t\t\t  .post(Entity.entity(json, APPLICATION_JSON));\n+\t\t\tif (response.getStatus() != 201 ) {\n+\t\t\t\tLOGGER.error(\"Error update or save college {}\",dto);\n+\t\t\t}\n+\t\t} catch (JsonProcessingException e) {\n+\t\t\tLOGGER.error(\"Error on Parse JSON of object {}\",dto, e);","path":"src/main/java/com/poseidon/college/JerseyCollegeDAO.java","position":49,"original_position":49,"commit_id":"98cd2fe64db73bdae72905807c40a4bf952f4b4f","original_commit_id":"98cd2fe64db73bdae72905807c40a4bf952f4b4f","user":{"login":"ericdallo","id":7820865,"avatar_url":"https://avatars.githubusercontent.com/u/7820865?v=3","gravatar_id":"","url":"https://api.github.com/users/ericdallo","html_url":"https://github.com/ericdallo","followers_url":"https://api.github.com/users/ericdallo/followers","following_url":"https://api.github.com/users/ericdallo/following{/other_user}","gists_url":"https://api.github.com/users/ericdallo/gists{/gist_id}","starred_url":"https://api.github.com/users/ericdallo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericdallo/subscriptions","organizations_url":"https://api.github.com/users/ericdallo/orgs","repos_url":"https://api.github.com/users/ericdallo/repos","events_url":"https://api.github.com/users/ericdallo/events{/privacy}","received_events_url":"https://api.github.com/users/ericdallo/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2016-05-15T21:08:18Z","updated_at":"2016-05-15T21:08:18Z","html_url":"https://github.com/qualfacul/poseidon/pull/1#discussion_r63298037","pull_request_url":"https://api.github.com/repos/qualfacul/poseidon/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/comments/63298037"},"html":{"href":"https://github.com/qualfacul/poseidon/pull/1#discussion_r63298037"},"pull_request":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/qualfacul/poseidon/pulls/1","id":69258982,"html_url":"https://github.com/qualfacul/poseidon/pull/1","diff_url":"https://github.com/qualfacul/poseidon/pull/1.diff","patch_url":"https://github.com/qualfacul/poseidon/pull/1.patch","issue_url":"https://api.github.com/repos/qualfacul/poseidon/issues/1","number":1,"state":"open","locked":false,"title":"[62] - Adiciona Task para popular faculdades do Brasil","user":{"login":"ericdallo","id":7820865,"avatar_url":"https://avatars.githubusercontent.com/u/7820865?v=3","gravatar_id":"","url":"https://api.github.com/users/ericdallo","html_url":"https://github.com/ericdallo","followers_url":"https://api.github.com/users/ericdallo/followers","following_url":"https://api.github.com/users/ericdallo/following{/other_user}","gists_url":"https://api.github.com/users/ericdallo/gists{/gist_id}","starred_url":"https://api.github.com/users/ericdallo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericdallo/subscriptions","organizations_url":"https://api.github.com/users/ericdallo/orgs","repos_url":"https://api.github.com/users/ericdallo/repos","events_url":"https://api.github.com/users/ericdallo/events{/privacy}","received_events_url":"https://api.github.com/users/ericdallo/received_events","type":"User","site_admin":false},"body":"@ericdallo\r\n\r\n:warning: A task demora em torno de 20 minutos a execução e faz ``O(n²)`` requisições. :warning: \r\n\r\n### TO TEST\r\nAlterar o cron da task para poder executar, ex:\r\n\r\n```java\r\n@Scheduled(fixedDelay = 10_000_000)\r\n```\r\n\r\n- [ ] Executar a task e verificar se foi populado aproximadamente 1916 faculdades na tabela ``college`` com suas respectivas notas na ``college_grade``\r\n","created_at":"2016-05-08T02:49:40Z","updated_at":"2016-05-15T21:08:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cf06f39e0523ac643e0dcb6bd9d2fbb7c0d6f9d5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/qualfacul/poseidon/pulls/1/commits","review_comments_url":"https://api.github.com/repos/qualfacul/poseidon/pulls/1/comments","review_comment_url":"https://api.github.com/repos/qualfacul/poseidon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qualfacul/poseidon/issues/1/comments","statuses_url":"https://api.github.com/repos/qualfacul/poseidon/statuses/98cd2fe64db73bdae72905807c40a4bf952f4b4f","head":{"label":"qualfacul:62","ref":"62","sha":"98cd2fe64db73bdae72905807c40a4bf952f4b4f","user":{"login":"qualfacul","id":19375297,"avatar_url":"https://avatars.githubusercontent.com/u/19375297?v=3","gravatar_id":"","url":"https://api.github.com/users/qualfacul","html_url":"https://github.com/qualfacul","followers_url":"https://api.github.com/users/qualfacul/followers","following_url":"https://api.github.com/users/qualfacul/following{/other_user}","gists_url":"https://api.github.com/users/qualfacul/gists{/gist_id}","starred_url":"https://api.github.com/users/qualfacul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualfacul/subscriptions","organizations_url":"https://api.github.com/users/qualfacul/orgs","repos_url":"https://api.github.com/users/qualfacul/repos","events_url":"https://api.github.com/users/qualfacul/events{/privacy}","received_events_url":"https://api.github.com/users/qualfacul/received_events","type":"Organization","site_admin":false},"repo":{"id":58237731,"name":"poseidon","full_name":"qualfacul/poseidon","owner":{"login":"qualfacul","id":19375297,"avatar_url":"https://avatars.githubusercontent.com/u/19375297?v=3","gravatar_id":"","url":"https://api.github.com/users/qualfacul","html_url":"https://github.com/qualfacul","followers_url":"https://api.github.com/users/qualfacul/followers","following_url":"https://api.github.com/users/qualfacul/following{/other_user}","gists_url":"https://api.github.com/users/qualfacul/gists{/gist_id}","starred_url":"https://api.github.com/users/qualfacul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualfacul/subscriptions","organizations_url":"https://api.github.com/users/qualfacul/orgs","repos_url":"https://api.github.com/users/qualfacul/repos","events_url":"https://api.github.com/users/qualfacul/events{/privacy}","received_events_url":"https://api.github.com/users/qualfacul/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qualfacul/poseidon","description":"","fork":false,"url":"https://api.github.com/repos/qualfacul/poseidon","forks_url":"https://api.github.com/repos/qualfacul/poseidon/forks","keys_url":"https://api.github.com/repos/qualfacul/poseidon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qualfacul/poseidon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qualfacul/poseidon/teams","hooks_url":"https://api.github.com/repos/qualfacul/poseidon/hooks","issue_events_url":"https://api.github.com/repos/qualfacul/poseidon/issues/events{/number}","events_url":"https://api.github.com/repos/qualfacul/poseidon/events","assignees_url":"https://api.github.com/repos/qualfacul/poseidon/assignees{/user}","branches_url":"https://api.github.com/repos/qualfacul/poseidon/branches{/branch}","tags_url":"https://api.github.com/repos/qualfacul/poseidon/tags","blobs_url":"https://api.github.com/repos/qualfacul/poseidon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qualfacul/poseidon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qualfacul/poseidon/git/refs{/sha}","trees_url":"https://api.github.com/repos/qualfacul/poseidon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qualfacul/poseidon/statuses/{sha}","languages_url":"https://api.github.com/repos/qualfacul/poseidon/languages","stargazers_url":"https://api.github.com/repos/qualfacul/poseidon/stargazers","contributors_url":"https://api.github.com/repos/qualfacul/poseidon/contributors","subscribers_url":"https://api.github.com/repos/qualfacul/poseidon/subscribers","subscription_url":"https://api.github.com/repos/qualfacul/poseidon/subscription","commits_url":"https://api.github.com/repos/qualfacul/poseidon/commits{/sha}","git_commits_url":"https://api.github.com/repos/qualfacul/poseidon/git/commits{/sha}","comments_url":"https://api.github.com/repos/qualfacul/poseidon/comments{/number}","issue_comment_url":"https://api.github.com/repos/qualfacul/poseidon/issues/comments{/number}","contents_url":"https://api.github.com/repos/qualfacul/poseidon/contents/{+path}","compare_url":"https://api.github.com/repos/qualfacul/poseidon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qualfacul/poseidon/merges","archive_url":"https://api.github.com/repos/qualfacul/poseidon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qualfacul/poseidon/downloads","issues_url":"https://api.github.com/repos/qualfacul/poseidon/issues{/number}","pulls_url":"https://api.github.com/repos/qualfacul/poseidon/pulls{/number}","milestones_url":"https://api.github.com/repos/qualfacul/poseidon/milestones{/number}","notifications_url":"https://api.github.com/repos/qualfacul/poseidon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qualfacul/poseidon/labels{/name}","releases_url":"https://api.github.com/repos/qualfacul/poseidon/releases{/id}","deployments_url":"https://api.github.com/repos/qualfacul/poseidon/deployments","created_at":"2016-05-06T22:15:51Z","updated_at":"2016-05-15T16:40:40Z","pushed_at":"2016-05-15T18:56:30Z","git_url":"git://github.com/qualfacul/poseidon.git","ssh_url":"git@github.com:qualfacul/poseidon.git","clone_url":"https://github.com/qualfacul/poseidon.git","svn_url":"https://github.com/qualfacul/poseidon","homepage":null,"size":168,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"qualfacul:master","ref":"master","sha":"39729296d17d728bf9493b70fe9826cf3d747533","user":{"login":"qualfacul","id":19375297,"avatar_url":"https://avatars.githubusercontent.com/u/19375297?v=3","gravatar_id":"","url":"https://api.github.com/users/qualfacul","html_url":"https://github.com/qualfacul","followers_url":"https://api.github.com/users/qualfacul/followers","following_url":"https://api.github.com/users/qualfacul/following{/other_user}","gists_url":"https://api.github.com/users/qualfacul/gists{/gist_id}","starred_url":"https://api.github.com/users/qualfacul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualfacul/subscriptions","organizations_url":"https://api.github.com/users/qualfacul/orgs","repos_url":"https://api.github.com/users/qualfacul/repos","events_url":"https://api.github.com/users/qualfacul/events{/privacy}","received_events_url":"https://api.github.com/users/qualfacul/received_events","type":"Organization","site_admin":false},"repo":{"id":58237731,"name":"poseidon","full_name":"qualfacul/poseidon","owner":{"login":"qualfacul","id":19375297,"avatar_url":"https://avatars.githubusercontent.com/u/19375297?v=3","gravatar_id":"","url":"https://api.github.com/users/qualfacul","html_url":"https://github.com/qualfacul","followers_url":"https://api.github.com/users/qualfacul/followers","following_url":"https://api.github.com/users/qualfacul/following{/other_user}","gists_url":"https://api.github.com/users/qualfacul/gists{/gist_id}","starred_url":"https://api.github.com/users/qualfacul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualfacul/subscriptions","organizations_url":"https://api.github.com/users/qualfacul/orgs","repos_url":"https://api.github.com/users/qualfacul/repos","events_url":"https://api.github.com/users/qualfacul/events{/privacy}","received_events_url":"https://api.github.com/users/qualfacul/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qualfacul/poseidon","description":"","fork":false,"url":"https://api.github.com/repos/qualfacul/poseidon","forks_url":"https://api.github.com/repos/qualfacul/poseidon/forks","keys_url":"https://api.github.com/repos/qualfacul/poseidon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qualfacul/poseidon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qualfacul/poseidon/teams","hooks_url":"https://api.github.com/repos/qualfacul/poseidon/hooks","issue_events_url":"https://api.github.com/repos/qualfacul/poseidon/issues/events{/number}","events_url":"https://api.github.com/repos/qualfacul/poseidon/events","assignees_url":"https://api.github.com/repos/qualfacul/poseidon/assignees{/user}","branches_url":"https://api.github.com/repos/qualfacul/poseidon/branches{/branch}","tags_url":"https://api.github.com/repos/qualfacul/poseidon/tags","blobs_url":"https://api.github.com/repos/qualfacul/poseidon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qualfacul/poseidon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qualfacul/poseidon/git/refs{/sha}","trees_url":"https://api.github.com/repos/qualfacul/poseidon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qualfacul/poseidon/statuses/{sha}","languages_url":"https://api.github.com/repos/qualfacul/poseidon/languages","stargazers_url":"https://api.github.com/repos/qualfacul/poseidon/stargazers","contributors_url":"https://api.github.com/repos/qualfacul/poseidon/contributors","subscribers_url":"https://api.github.com/repos/qualfacul/poseidon/subscribers","subscription_url":"https://api.github.com/repos/qualfacul/poseidon/subscription","commits_url":"https://api.github.com/repos/qualfacul/poseidon/commits{/sha}","git_commits_url":"https://api.github.com/repos/qualfacul/poseidon/git/commits{/sha}","comments_url":"https://api.github.com/repos/qualfacul/poseidon/comments{/number}","issue_comment_url":"https://api.github.com/repos/qualfacul/poseidon/issues/comments{/number}","contents_url":"https://api.github.com/repos/qualfacul/poseidon/contents/{+path}","compare_url":"https://api.github.com/repos/qualfacul/poseidon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qualfacul/poseidon/merges","archive_url":"https://api.github.com/repos/qualfacul/poseidon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qualfacul/poseidon/downloads","issues_url":"https://api.github.com/repos/qualfacul/poseidon/issues{/number}","pulls_url":"https://api.github.com/repos/qualfacul/poseidon/pulls{/number}","milestones_url":"https://api.github.com/repos/qualfacul/poseidon/milestones{/number}","notifications_url":"https://api.github.com/repos/qualfacul/poseidon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qualfacul/poseidon/labels{/name}","releases_url":"https://api.github.com/repos/qualfacul/poseidon/releases{/id}","deployments_url":"https://api.github.com/repos/qualfacul/poseidon/deployments","created_at":"2016-05-06T22:15:51Z","updated_at":"2016-05-15T16:40:40Z","pushed_at":"2016-05-15T18:56:30Z","git_url":"git://github.com/qualfacul/poseidon.git","ssh_url":"git@github.com:qualfacul/poseidon.git","clone_url":"https://github.com/qualfacul/poseidon.git","svn_url":"https://github.com/qualfacul/poseidon","homepage":null,"size":168,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/1"},"html":{"href":"https://github.com/qualfacul/poseidon/pull/1"},"issue":{"href":"https://api.github.com/repos/qualfacul/poseidon/issues/1"},"comments":{"href":"https://api.github.com/repos/qualfacul/poseidon/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qualfacul/poseidon/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/qualfacul/poseidon/statuses/98cd2fe64db73bdae72905807c40a4bf952f4b4f"}}}}