{"action":"created","comment":{"url":"https://api.github.com/repos/influunt/influunt/pulls/comments/90239769","pull_request_review_id":10761070,"id":90239769,"diff_hunk":"@@ -31,45 +42,77 @@\n \n     private final String privateKey;\n \n-    private Configuration mqttSettings;\n-\n     private ActorRef servidor;\n \n-    private Configuration configuration = Play.current().injector().instanceOf(Configuration.class);\n-\n-    private DeviceConfig deviceConfig = Play.current().injector().instanceOf(DeviceConfig.class);\n-\n     private Storage storage = Play.current().injector().instanceOf(Storage.class);\n \n-    private DeviceBridge device = Play.current().injector().instanceOf(DeviceBridge.class);\n+    private DeviceBridge device;\n+\n \n+    public Client(DeviceConfig deviceConfig) {\n+        Logger.info(\"Iniciando O 72C\");\n+        Config configuration = ConfigFactory.load();\n+        config72c = configuration.getConfig(\"72c\");\n+        this.system = ActorSystem.create(\"InfluuntSystem\", configuration);\n \n-    public Client() {\n-        this.system = ActorSystem.create(\"InfluuntSystem\", ConfigFactory.load());\n+        Logger.info(String.format(\"Subsistema Akka:%s\", this.system.name()));\n \n-        if (deviceConfig instanceof TestDeviceConfig || deviceConfig instanceof LocalDeviceConfig) {\n+        if (deviceConfig != null) {\n+            Logger.info(String.format(\"Configuração Baseada em Classe:%s\", deviceConfig.getClass().getName()));\n             host = deviceConfig.getHost();\n             port = deviceConfig.getPort();\n             id = deviceConfig.getDeviceId();\n             centralPublicKey = deviceConfig.getCentralPublicKey();\n             privateKey = deviceConfig.getPrivateKey();\n-\n+            device = deviceConfig.getDeviceBridge();\n         } else {\n-            mqttSettings = configuration.getConfig(\"device\");\n-            host = mqttSettings.getConfig(\"mqtt\").getString(\"host\");\n-            port = mqttSettings.getConfig(\"mqtt\").getString(\"port\");\n-            id = mqttSettings.getString(\"id\");\n-            centralPublicKey = mqttSettings.getString(\"centralPublicKey\");\n-            privateKey = mqttSettings.getString(\"privateKey\");\n+            host = config72c.getConfig(\"mqtt\").getString(\"host\");\n+            port = config72c.getConfig(\"mqtt\").getString(\"port\");\n+            id = config72c.getString(\"id\");\n+            centralPublicKey = config72c.getConfig(\"seguranca\").getString(\"chavePublica\");\n+            privateKey = config72c.getConfig(\"seguranca\").getString(\"chavePrivada\");\n+\n+            try {\n+                Class<DeviceBridge> deviceClass = (Class<DeviceBridge>) Class.forName(config72c.getConfig(\"bridge\").getString(\"type\"));\n+                this.device = deviceClass.newInstance();\n+            } catch (ClassNotFoundException e) {\n+                e.printStackTrace();\n+            } catch (InstantiationException e) {\n+                e.printStackTrace();\n+            } catch (IllegalAccessException e) {\n+                e.printStackTrace();\n+            }\n+\n         }\n \n+        Logger.info(String.format(\"ID CONTROLADOR  :%s\", id));\n+        Logger.info(String.format(\"MQTT HOST       :%s\", host));\n+        Logger.info(String.format(\"MQTT PORT       :%s\", port));\n+        Logger.info(String.format(\"CHAVE PUBLICA   :%s...%s\", centralPublicKey.substring(0, 5), centralPublicKey.substring(centralPublicKey.length() - 5, centralPublicKey.length())));\n+        Logger.info(String.format(\"CHAVE PRIVADA   :%s...%s\", privateKey.substring(0, 5), privateKey.substring(centralPublicKey.length() - 5, centralPublicKey.length())));\n+        Logger.info(String.format(\"DEVICE BRIDGE   :%s\", device.getClass().getName()));\n+\n         servidor = system.actorOf(Props.create(ClientActor.class, id, host, port, centralPublicKey, privateKey, storage, device), id);\n \n     }\n \n \n-    public Configuration getMqttSettings() {\n-        return mqttSettings;\n+    public static Config getConfig() {\n+        return config72c;\n+    }\n+\n+    public static void main(String args[]) {","path":"influunt-api/modules/influunt-device/app/os72c/client/Client.java","position":120,"original_position":120,"commit_id":"53be45723a209b1af3d162208b87315fbd9795ee","original_commit_id":"548ae26f2fe63c1d2a3d5382c57c770ee7d62f06","user":{"login":"ppires","id":194442,"avatar_url":"https://avatars.githubusercontent.com/u/194442?v=3","gravatar_id":"","url":"https://api.github.com/users/ppires","html_url":"https://github.com/ppires","followers_url":"https://api.github.com/users/ppires/followers","following_url":"https://api.github.com/users/ppires/following{/other_user}","gists_url":"https://api.github.com/users/ppires/gists{/gist_id}","starred_url":"https://api.github.com/users/ppires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppires/subscriptions","organizations_url":"https://api.github.com/users/ppires/orgs","repos_url":"https://api.github.com/users/ppires/repos","events_url":"https://api.github.com/users/ppires/events{/privacy}","received_events_url":"https://api.github.com/users/ppires/received_events","type":"User","site_admin":false},"body":"Essas funções para teste vão ser utilizadas ainda? Se não, podem ser removidas.","created_at":"2016-11-30T14:18:03Z","updated_at":"2016-11-30T14:36:39Z","html_url":"https://github.com/influunt/influunt/pull/1490#discussion_r90239769","pull_request_url":"https://api.github.com/repos/influunt/influunt/pulls/1490","_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments/90239769"},"html":{"href":"https://github.com/influunt/influunt/pull/1490#discussion_r90239769"},"pull_request":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1490"}}},"pull_request":{"url":"https://api.github.com/repos/influunt/influunt/pulls/1490","id":95898139,"html_url":"https://github.com/influunt/influunt/pull/1490","diff_url":"https://github.com/influunt/influunt/pull/1490.diff","patch_url":"https://github.com/influunt/influunt/pull/1490.patch","issue_url":"https://api.github.com/repos/influunt/influunt/issues/1490","number":1490,"state":"open","locked":false,"title":"Execucao embarcado","user":{"login":"rodrigosol","id":99245,"avatar_url":"https://avatars.githubusercontent.com/u/99245?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigosol","html_url":"https://github.com/rodrigosol","followers_url":"https://api.github.com/users/rodrigosol/followers","following_url":"https://api.github.com/users/rodrigosol/following{/other_user}","gists_url":"https://api.github.com/users/rodrigosol/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigosol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigosol/subscriptions","organizations_url":"https://api.github.com/users/rodrigosol/orgs","repos_url":"https://api.github.com/users/rodrigosol/repos","events_url":"https://api.github.com/users/rodrigosol/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigosol/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-30T14:11:20Z","updated_at":"2016-11-30T14:36:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22fcc39a3a182d2369ca2d3028d0f0649665b44c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/influunt/influunt/pulls/1490/commits","review_comments_url":"https://api.github.com/repos/influunt/influunt/pulls/1490/comments","review_comment_url":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/influunt/influunt/issues/1490/comments","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/53be45723a209b1af3d162208b87315fbd9795ee","head":{"label":"influunt:execucao_embarcado","ref":"execucao_embarcado","sha":"53be45723a209b1af3d162208b87315fbd9795ee","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":null,"fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-10-24T11:58:12Z","pushed_at":"2016-11-30T14:31:35Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":147328,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":50,"forks":0,"open_issues":50,"watchers":0,"default_branch":"staging"}},"base":{"label":"influunt:staging","ref":"staging","sha":"00759a82f85a7001cc7590ec50e8ca07b139256d","user":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"repo":{"id":60134030,"name":"influunt","full_name":"influunt/influunt","owner":{"login":"influunt","id":19677350,"avatar_url":"https://avatars.githubusercontent.com/u/19677350?v=3","gravatar_id":"","url":"https://api.github.com/users/influunt","html_url":"https://github.com/influunt","followers_url":"https://api.github.com/users/influunt/followers","following_url":"https://api.github.com/users/influunt/following{/other_user}","gists_url":"https://api.github.com/users/influunt/gists{/gist_id}","starred_url":"https://api.github.com/users/influunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/influunt/subscriptions","organizations_url":"https://api.github.com/users/influunt/orgs","repos_url":"https://api.github.com/users/influunt/repos","events_url":"https://api.github.com/users/influunt/events{/privacy}","received_events_url":"https://api.github.com/users/influunt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/influunt/influunt","description":null,"fork":false,"url":"https://api.github.com/repos/influunt/influunt","forks_url":"https://api.github.com/repos/influunt/influunt/forks","keys_url":"https://api.github.com/repos/influunt/influunt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/influunt/influunt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/influunt/influunt/teams","hooks_url":"https://api.github.com/repos/influunt/influunt/hooks","issue_events_url":"https://api.github.com/repos/influunt/influunt/issues/events{/number}","events_url":"https://api.github.com/repos/influunt/influunt/events","assignees_url":"https://api.github.com/repos/influunt/influunt/assignees{/user}","branches_url":"https://api.github.com/repos/influunt/influunt/branches{/branch}","tags_url":"https://api.github.com/repos/influunt/influunt/tags","blobs_url":"https://api.github.com/repos/influunt/influunt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/influunt/influunt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/influunt/influunt/git/refs{/sha}","trees_url":"https://api.github.com/repos/influunt/influunt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/influunt/influunt/statuses/{sha}","languages_url":"https://api.github.com/repos/influunt/influunt/languages","stargazers_url":"https://api.github.com/repos/influunt/influunt/stargazers","contributors_url":"https://api.github.com/repos/influunt/influunt/contributors","subscribers_url":"https://api.github.com/repos/influunt/influunt/subscribers","subscription_url":"https://api.github.com/repos/influunt/influunt/subscription","commits_url":"https://api.github.com/repos/influunt/influunt/commits{/sha}","git_commits_url":"https://api.github.com/repos/influunt/influunt/git/commits{/sha}","comments_url":"https://api.github.com/repos/influunt/influunt/comments{/number}","issue_comment_url":"https://api.github.com/repos/influunt/influunt/issues/comments{/number}","contents_url":"https://api.github.com/repos/influunt/influunt/contents/{+path}","compare_url":"https://api.github.com/repos/influunt/influunt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/influunt/influunt/merges","archive_url":"https://api.github.com/repos/influunt/influunt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/influunt/influunt/downloads","issues_url":"https://api.github.com/repos/influunt/influunt/issues{/number}","pulls_url":"https://api.github.com/repos/influunt/influunt/pulls{/number}","milestones_url":"https://api.github.com/repos/influunt/influunt/milestones{/number}","notifications_url":"https://api.github.com/repos/influunt/influunt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/influunt/influunt/labels{/name}","releases_url":"https://api.github.com/repos/influunt/influunt/releases{/id}","deployments_url":"https://api.github.com/repos/influunt/influunt/deployments","created_at":"2016-06-01T00:55:14Z","updated_at":"2016-10-24T11:58:12Z","pushed_at":"2016-11-30T14:31:35Z","git_url":"git://github.com/influunt/influunt.git","ssh_url":"git@github.com:influunt/influunt.git","clone_url":"https://github.com/influunt/influunt.git","svn_url":"https://github.com/influunt/influunt","homepage":null,"size":147328,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":50,"forks":0,"open_issues":50,"watchers":0,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1490"},"html":{"href":"https://github.com/influunt/influunt/pull/1490"},"issue":{"href":"https://api.github.com/repos/influunt/influunt/issues/1490"},"comments":{"href":"https://api.github.com/repos/influunt/influunt/issues/1490/comments"},"review_comments":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1490/comments"},"review_comment":{"href":"https://api.github.com/repos/influunt/influunt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/influunt/influunt/pulls/1490/commits"},"statuses":{"href":"https://api.github.com/repos/influunt/influunt/statuses/53be45723a209b1af3d162208b87315fbd9795ee"}}}}
{"actor":{"display_login":"ppires"}}