{"action":"created","comment":{"url":"https://api.github.com/repos/dojot/flowbroker/pulls/comments/219178876","pull_request_review_id":157291271,"id":219178876,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxOTE3ODg3Ng==","diff_hunk":"@@ -0,0 +1,109 @@\n+/* jslint node: true */\n+\"use strict\";\n+var axios = require(\"axios\");\n+\n+var config = require('./config');\n+var auth = require('./auth');\n+\n+/**\n+ * Client for REDIS database\n+ */\n+class ClientWrapper {\n+\n+  constructor(client) {\n+    this.client = client;\n+  }\n+  /**\n+   * Returns template list of a device. Search for it on cache, if it's not, requests device manager\n+   * and then stores on cache.\n+   * @param {string} deviceid\n+   * @param {string} tenant \n+   * @param {string} redisState\n+   */\n+\n+  getTemplateList(deviceid, tenant, redisState) {","path":"orchestrator/redisClientWrapper.js","position":null,"original_position":24,"commit_id":"e78e29f47fdf3e096da64511bdca3da8b3c2553e","original_commit_id":"63e786646a3f69bd93b3338da40df735f6943ca2","user":{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false},"body":"I guess that too.","created_at":"2018-09-20T14:11:26Z","updated_at":"2018-09-20T14:11:26Z","html_url":"https://github.com/dojot/flowbroker/pull/65#discussion_r219178876","pull_request_url":"https://api.github.com/repos/dojot/flowbroker/pulls/65","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/comments/219178876"},"html":{"href":"https://github.com/dojot/flowbroker/pull/65#discussion_r219178876"},"pull_request":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/65"}},"in_reply_to_id":219142694},"pull_request":{"url":"https://api.github.com/repos/dojot/flowbroker/pulls/65","id":215325634,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MzI1NjM0","html_url":"https://github.com/dojot/flowbroker/pull/65","diff_url":"https://github.com/dojot/flowbroker/pull/65.diff","patch_url":"https://github.com/dojot/flowbroker/pull/65.patch","issue_url":"https://api.github.com/repos/dojot/flowbroker/issues/65","number":65,"state":"open","locked":false,"title":"Adds cache memory to store templatelist","user":{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false},"body":"* **Please check if the PR fulfills these requirements**\r\n- [ ] Tests for the changes have been added (for bug fixes / features)\r\n- [ ] Docs have been added / updated (for bug fixes / features)\r\n\r\n\r\n* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)\r\nFeature.\r\n\r\n\r\n* **What is the current behavior?** (You can also link to an open issue here)\r\nEvery time a device-data event is received, flowbroker makes a get request to device-manager to get the the template list of the device.\r\n\r\n\r\n* **What is the new behavior (if this is a feature change)?**\r\nWhen it's the first time of a device sending a message, it will request the template list to device-manager, but, for the next messages, it will retrieve the template list of the cache memory.\r\nThe template list is deleted of the cache memory if the device is updated or removed.\r\n\r\n\r\n* **Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?)\r\nNo.\r\n\r\n* **Is there any issue related to this PR in other repository?** (such as dojot/dojot)\r\nNo.\r\n\r\n* **Other information**:\r\nThis is connected to dojot/dojot#65","created_at":"2018-09-13T15:35:17Z","updated_at":"2018-09-20T14:11:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88c693ab2e852bd278d26e3d8ef5801b788344c2","assignee":{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false},"assignees":[{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":860438538,"node_id":"MDU6TGFiZWw4NjA0Mzg1Mzg=","url":"https://api.github.com/repos/dojot/flowbroker/labels/Needs:Review","name":"Needs:Review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/dojot/flowbroker/pulls/65/commits","review_comments_url":"https://api.github.com/repos/dojot/flowbroker/pulls/65/comments","review_comment_url":"https://api.github.com/repos/dojot/flowbroker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dojot/flowbroker/issues/65/comments","statuses_url":"https://api.github.com/repos/dojot/flowbroker/statuses/e78e29f47fdf3e096da64511bdca3da8b3c2553e","head":{"label":"matheuscampanhaf:adds-device-manager-request","ref":"adds-device-manager-request","sha":"e78e29f47fdf3e096da64511bdca3da8b3c2553e","user":{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false},"repo":{"id":145109341,"node_id":"MDEwOlJlcG9zaXRvcnkxNDUxMDkzNDE=","name":"flowbroker","full_name":"matheuscampanhaf/flowbroker","private":false,"owner":{"login":"matheuscampanhaf","id":19478545,"node_id":"MDQ6VXNlcjE5NDc4NTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19478545?v=4","gravatar_id":"","url":"https://api.github.com/users/matheuscampanhaf","html_url":"https://github.com/matheuscampanhaf","followers_url":"https://api.github.com/users/matheuscampanhaf/followers","following_url":"https://api.github.com/users/matheuscampanhaf/following{/other_user}","gists_url":"https://api.github.com/users/matheuscampanhaf/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscampanhaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscampanhaf/subscriptions","organizations_url":"https://api.github.com/users/matheuscampanhaf/orgs","repos_url":"https://api.github.com/users/matheuscampanhaf/repos","events_url":"https://api.github.com/users/matheuscampanhaf/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscampanhaf/received_events","type":"User","site_admin":false},"html_url":"https://github.com/matheuscampanhaf/flowbroker","description":"Flow processing implementation, with hot deployment capabilities","fork":true,"url":"https://api.github.com/repos/matheuscampanhaf/flowbroker","forks_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/forks","keys_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/teams","hooks_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/hooks","issue_events_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/issues/events{/number}","events_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/events","assignees_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/assignees{/user}","branches_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/branches{/branch}","tags_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/tags","blobs_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/git/refs{/sha}","trees_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/statuses/{sha}","languages_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/languages","stargazers_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/stargazers","contributors_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/contributors","subscribers_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/subscribers","subscription_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/subscription","commits_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/commits{/sha}","git_commits_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/git/commits{/sha}","comments_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/comments{/number}","issue_comment_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/issues/comments{/number}","contents_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/contents/{+path}","compare_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/merges","archive_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/downloads","issues_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/issues{/number}","pulls_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/pulls{/number}","milestones_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/milestones{/number}","notifications_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/labels{/name}","releases_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/releases{/id}","deployments_url":"https://api.github.com/repos/matheuscampanhaf/flowbroker/deployments","created_at":"2018-08-17T10:52:41Z","updated_at":"2018-08-17T10:52:43Z","pushed_at":"2018-09-20T14:09:46Z","git_url":"git://github.com/matheuscampanhaf/flowbroker.git","ssh_url":"git@github.com:matheuscampanhaf/flowbroker.git","clone_url":"https://github.com/matheuscampanhaf/flowbroker.git","svn_url":"https://github.com/matheuscampanhaf/flowbroker","homepage":null,"size":2222,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dojot:master","ref":"master","sha":"08afd3e5d39ca0eac6a4fbaea62b066fca778f9d","user":{"login":"dojot","id":31219238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjE5MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/31219238?v=4","gravatar_id":"","url":"https://api.github.com/users/dojot","html_url":"https://github.com/dojot","followers_url":"https://api.github.com/users/dojot/followers","following_url":"https://api.github.com/users/dojot/following{/other_user}","gists_url":"https://api.github.com/users/dojot/gists{/gist_id}","starred_url":"https://api.github.com/users/dojot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dojot/subscriptions","organizations_url":"https://api.github.com/users/dojot/orgs","repos_url":"https://api.github.com/users/dojot/repos","events_url":"https://api.github.com/users/dojot/events{/privacy}","received_events_url":"https://api.github.com/users/dojot/received_events","type":"Organization","site_admin":false},"repo":{"id":124060742,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQwNjA3NDI=","name":"flowbroker","full_name":"dojot/flowbroker","private":false,"owner":{"login":"dojot","id":31219238,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxMjE5MjM4","avatar_url":"https://avatars3.githubusercontent.com/u/31219238?v=4","gravatar_id":"","url":"https://api.github.com/users/dojot","html_url":"https://github.com/dojot","followers_url":"https://api.github.com/users/dojot/followers","following_url":"https://api.github.com/users/dojot/following{/other_user}","gists_url":"https://api.github.com/users/dojot/gists{/gist_id}","starred_url":"https://api.github.com/users/dojot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dojot/subscriptions","organizations_url":"https://api.github.com/users/dojot/orgs","repos_url":"https://api.github.com/users/dojot/repos","events_url":"https://api.github.com/users/dojot/events{/privacy}","received_events_url":"https://api.github.com/users/dojot/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dojot/flowbroker","description":"Flow processing implementation, with hot deployment capabilities","fork":false,"url":"https://api.github.com/repos/dojot/flowbroker","forks_url":"https://api.github.com/repos/dojot/flowbroker/forks","keys_url":"https://api.github.com/repos/dojot/flowbroker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dojot/flowbroker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dojot/flowbroker/teams","hooks_url":"https://api.github.com/repos/dojot/flowbroker/hooks","issue_events_url":"https://api.github.com/repos/dojot/flowbroker/issues/events{/number}","events_url":"https://api.github.com/repos/dojot/flowbroker/events","assignees_url":"https://api.github.com/repos/dojot/flowbroker/assignees{/user}","branches_url":"https://api.github.com/repos/dojot/flowbroker/branches{/branch}","tags_url":"https://api.github.com/repos/dojot/flowbroker/tags","blobs_url":"https://api.github.com/repos/dojot/flowbroker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dojot/flowbroker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dojot/flowbroker/git/refs{/sha}","trees_url":"https://api.github.com/repos/dojot/flowbroker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dojot/flowbroker/statuses/{sha}","languages_url":"https://api.github.com/repos/dojot/flowbroker/languages","stargazers_url":"https://api.github.com/repos/dojot/flowbroker/stargazers","contributors_url":"https://api.github.com/repos/dojot/flowbroker/contributors","subscribers_url":"https://api.github.com/repos/dojot/flowbroker/subscribers","subscription_url":"https://api.github.com/repos/dojot/flowbroker/subscription","commits_url":"https://api.github.com/repos/dojot/flowbroker/commits{/sha}","git_commits_url":"https://api.github.com/repos/dojot/flowbroker/git/commits{/sha}","comments_url":"https://api.github.com/repos/dojot/flowbroker/comments{/number}","issue_comment_url":"https://api.github.com/repos/dojot/flowbroker/issues/comments{/number}","contents_url":"https://api.github.com/repos/dojot/flowbroker/contents/{+path}","compare_url":"https://api.github.com/repos/dojot/flowbroker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dojot/flowbroker/merges","archive_url":"https://api.github.com/repos/dojot/flowbroker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dojot/flowbroker/downloads","issues_url":"https://api.github.com/repos/dojot/flowbroker/issues{/number}","pulls_url":"https://api.github.com/repos/dojot/flowbroker/pulls{/number}","milestones_url":"https://api.github.com/repos/dojot/flowbroker/milestones{/number}","notifications_url":"https://api.github.com/repos/dojot/flowbroker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dojot/flowbroker/labels{/name}","releases_url":"https://api.github.com/repos/dojot/flowbroker/releases{/id}","deployments_url":"https://api.github.com/repos/dojot/flowbroker/deployments","created_at":"2018-03-06T10:20:19Z","updated_at":"2018-09-20T11:22:24Z","pushed_at":"2018-09-20T14:09:48Z","git_url":"git://github.com/dojot/flowbroker.git","ssh_url":"git@github.com:dojot/flowbroker.git","clone_url":"https://github.com/dojot/flowbroker.git","svn_url":"https://github.com/dojot/flowbroker","homepage":null,"size":2211,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"archived":false,"open_issues_count":6,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":14,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/65"},"html":{"href":"https://github.com/dojot/flowbroker/pull/65"},"issue":{"href":"https://api.github.com/repos/dojot/flowbroker/issues/65"},"comments":{"href":"https://api.github.com/repos/dojot/flowbroker/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dojot/flowbroker/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/dojot/flowbroker/statuses/e78e29f47fdf3e096da64511bdca3da8b3c2553e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"matheuscampanhaf"}}