{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/comments/54818732","id":54818732,"diff_hunk":"@@ -0,0 +1,130 @@\n+// Copyright(c) Microsoft.All rights reserved. \n+// Licensed under the MIT license.See LICENSE file in the project root for full license information. \n+\n+package javaWrapper;\n+\n+import com.sun.jna.Pointer;\n+\n+import javaWrapper.Iothub_client_wrapperLibrary.AMQP_Protocol;\n+import javaWrapper.Iothub_client_wrapperLibrary.HTTP_Protocol;\n+import javaWrapper.Iothub_client_wrapperLibrary.IOTHUB_CLIENT_HANDLE;\n+import javaWrapper.Iothub_client_wrapperLibrary.IOTHUB_CLIENT_RESULT;\n+import javaWrapper.Iothub_client_wrapperLibrary.IOTHUB_CLIENT_TRANSPORT_PROVIDER;\n+import javaWrapper.Iothub_client_wrapperLibrary.IotHubEventCallback;\n+import javaWrapper.Iothub_client_wrapperLibrary.IotHubMessageCallback;\n+import javaWrapper.Iothub_client_wrapperLibrary.MQTT_Protocol;\n+\n+\n+public final class DeviceClient \n+{\n+\tprivate static IOTHUB_CLIENT_HANDLE handle = new IOTHUB_CLIENT_HANDLE(null);\n+\tprivate IOTHUB_CLIENT_TRANSPORT_PROVIDER transport;\n+\t\n+\tprotected DeviceClient()\n+\t{\n+\t\n+\t}\n+\t\n+\tpublic enum IotHubClientProtocol \n+\t{ \n+\t\tHTTPS, AMQPS, MQTT \n+\t} \n+\n+\tpublic DeviceClient(String connString, IotHubClientProtocol protocol)\n+\t{\n+\t\tswitch (protocol) \n+\t\t{ \n+\t\t\tcase HTTPS: \n+\t\t\t\tthis.transport = new HTTP_Protocol(); \n+\t\t        break; \n+\t        case AMQPS: \n+\t        \tthis.transport = new AMQP_Protocol();  \n+\t\t        break; \n+\t\t    case MQTT: \n+\t\t    \tthis.transport = new MQTT_Protocol();\n+\t\t        break; \n+\t\t    default: \n+\t\t    // should never happen. \n+\t\t        throw new IllegalStateException( \n+\t\t       \t\t\"Invalid client protocol specified.\"); \n+\t\t} \n+\n+\t\thandle = Iothub_client_wrapperLibrary.INSTANCE.IoTHubClient_CreateFromConnectionString(connString, transport);\n+\t}\n+\t\n+\tpublic void open()","path":"javawrapper/device/iothub-client-javawrapper/DeviceClient.java","position":55,"original_position":55,"commit_id":"b13c8a58cd78f434b84a8df05c297f79b7ae762a","original_commit_id":"b13c8a58cd78f434b84a8df05c297f79b7ae762a","user":{"login":"tameraw","id":9868777,"avatar_url":"https://avatars.githubusercontent.com/u/9868777?v=3","gravatar_id":"","url":"https://api.github.com/users/tameraw","html_url":"https://github.com/tameraw","followers_url":"https://api.github.com/users/tameraw/followers","following_url":"https://api.github.com/users/tameraw/following{/other_user}","gists_url":"https://api.github.com/users/tameraw/gists{/gist_id}","starred_url":"https://api.github.com/users/tameraw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tameraw/subscriptions","organizations_url":"https://api.github.com/users/tameraw/orgs","repos_url":"https://api.github.com/users/tameraw/repos","events_url":"https://api.github.com/users/tameraw/events{/privacy}","received_events_url":"https://api.github.com/users/tameraw/received_events","type":"User","site_admin":false},"body":"Let's please mimic the \"c-api\". So in that case, we can drop the Open & Close.","created_at":"2016-03-03T00:36:46Z","updated_at":"2016-03-03T00:36:46Z","html_url":"https://github.com/Azure/azure-iot-sdks/pull/366#discussion_r54818732","pull_request_url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/comments/54818732"},"html":{"href":"https://github.com/Azure/azure-iot-sdks/pull/366#discussion_r54818732"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366","id":61373995,"html_url":"https://github.com/Azure/azure-iot-sdks/pull/366","diff_url":"https://github.com/Azure/azure-iot-sdks/pull/366.diff","patch_url":"https://github.com/Azure/azure-iot-sdks/pull/366.patch","issue_url":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/366","number":366,"state":"open","locked":false,"title":"spike java wrapper using JNA","user":{"login":"dacolgit","id":7942439,"avatar_url":"https://avatars.githubusercontent.com/u/7942439?v=3","gravatar_id":"","url":"https://api.github.com/users/dacolgit","html_url":"https://github.com/dacolgit","followers_url":"https://api.github.com/users/dacolgit/followers","following_url":"https://api.github.com/users/dacolgit/following{/other_user}","gists_url":"https://api.github.com/users/dacolgit/gists{/gist_id}","starred_url":"https://api.github.com/users/dacolgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacolgit/subscriptions","organizations_url":"https://api.github.com/users/dacolgit/orgs","repos_url":"https://api.github.com/users/dacolgit/repos","events_url":"https://api.github.com/users/dacolgit/events{/privacy}","received_events_url":"https://api.github.com/users/dacolgit/received_events","type":"User","site_admin":false},"body":"java C wrapper for windows  based on JNA library\r\nThe native code is using iothub nuget packages compiled into a native C dll which exposes the interfaces for the java import lib ","created_at":"2016-03-02T09:42:54Z","updated_at":"2016-03-03T00:36:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dde418d4b61914b2259e06905080e467744efd6a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/366/comments","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdks/statuses/b13c8a58cd78f434b84a8df05c297f79b7ae762a","head":{"label":"dacolgit:javaWrapper","ref":"javaWrapper","sha":"b13c8a58cd78f434b84a8df05c297f79b7ae762a","user":{"login":"dacolgit","id":7942439,"avatar_url":"https://avatars.githubusercontent.com/u/7942439?v=3","gravatar_id":"","url":"https://api.github.com/users/dacolgit","html_url":"https://github.com/dacolgit","followers_url":"https://api.github.com/users/dacolgit/followers","following_url":"https://api.github.com/users/dacolgit/following{/other_user}","gists_url":"https://api.github.com/users/dacolgit/gists{/gist_id}","starred_url":"https://api.github.com/users/dacolgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacolgit/subscriptions","organizations_url":"https://api.github.com/users/dacolgit/orgs","repos_url":"https://api.github.com/users/dacolgit/repos","events_url":"https://api.github.com/users/dacolgit/events{/privacy}","received_events_url":"https://api.github.com/users/dacolgit/received_events","type":"User","site_admin":false},"repo":{"id":52950783,"name":"azure-iot-sdks","full_name":"dacolgit/azure-iot-sdks","owner":{"login":"dacolgit","id":7942439,"avatar_url":"https://avatars.githubusercontent.com/u/7942439?v=3","gravatar_id":"","url":"https://api.github.com/users/dacolgit","html_url":"https://github.com/dacolgit","followers_url":"https://api.github.com/users/dacolgit/followers","following_url":"https://api.github.com/users/dacolgit/following{/other_user}","gists_url":"https://api.github.com/users/dacolgit/gists{/gist_id}","starred_url":"https://api.github.com/users/dacolgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dacolgit/subscriptions","organizations_url":"https://api.github.com/users/dacolgit/orgs","repos_url":"https://api.github.com/users/dacolgit/repos","events_url":"https://api.github.com/users/dacolgit/events{/privacy}","received_events_url":"https://api.github.com/users/dacolgit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dacolgit/azure-iot-sdks","description":"SDKs for a variety of languages and platforms that help connect devices to Microsoft Azure IoT services","fork":true,"url":"https://api.github.com/repos/dacolgit/azure-iot-sdks","forks_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/forks","keys_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/teams","hooks_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/hooks","issue_events_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/issues/events{/number}","events_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/events","assignees_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/assignees{/user}","branches_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/branches{/branch}","tags_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/tags","blobs_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/git/refs{/sha}","trees_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/statuses/{sha}","languages_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/languages","stargazers_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/stargazers","contributors_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/contributors","subscribers_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/subscribers","subscription_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/subscription","commits_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/commits{/sha}","git_commits_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/git/commits{/sha}","comments_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/comments{/number}","issue_comment_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/issues/comments{/number}","contents_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/contents/{+path}","compare_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/merges","archive_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/downloads","issues_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/issues{/number}","pulls_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/pulls{/number}","milestones_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/milestones{/number}","notifications_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/labels{/name}","releases_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/releases{/id}","deployments_url":"https://api.github.com/repos/dacolgit/azure-iot-sdks/deployments","created_at":"2016-03-02T09:31:08Z","updated_at":"2016-03-02T09:31:12Z","pushed_at":"2016-03-02T15:46:18Z","git_url":"git://github.com/dacolgit/azure-iot-sdks.git","ssh_url":"git@github.com:dacolgit/azure-iot-sdks.git","clone_url":"https://github.com/dacolgit/azure-iot-sdks.git","svn_url":"https://github.com/dacolgit/azure-iot-sdks","homepage":"http://azure.github.io/azure-iot-sdks/","size":30039,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Azure:develop","ref":"develop","sha":"e761add0244c6ef335d1f63734515864be29df3e","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":41836441,"name":"azure-iot-sdks","full_name":"Azure/azure-iot-sdks","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/azure-iot-sdks","description":"SDKs for a variety of languages and platforms that help connect devices to Microsoft Azure IoT services","fork":false,"url":"https://api.github.com/repos/Azure/azure-iot-sdks","forks_url":"https://api.github.com/repos/Azure/azure-iot-sdks/forks","keys_url":"https://api.github.com/repos/Azure/azure-iot-sdks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-iot-sdks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-iot-sdks/teams","hooks_url":"https://api.github.com/repos/Azure/azure-iot-sdks/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-iot-sdks/events","assignees_url":"https://api.github.com/repos/Azure/azure-iot-sdks/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-iot-sdks/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-iot-sdks/tags","blobs_url":"https://api.github.com/repos/Azure/azure-iot-sdks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-iot-sdks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-iot-sdks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-iot-sdks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-iot-sdks/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-iot-sdks/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-iot-sdks/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-iot-sdks/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-iot-sdks/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-iot-sdks/subscription","commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-iot-sdks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-iot-sdks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-iot-sdks/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-iot-sdks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-iot-sdks/merges","archive_url":"https://api.github.com/repos/Azure/azure-iot-sdks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-iot-sdks/downloads","issues_url":"https://api.github.com/repos/Azure/azure-iot-sdks/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-iot-sdks/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-iot-sdks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-iot-sdks/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-iot-sdks/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-iot-sdks/deployments","created_at":"2015-09-03T01:30:08Z","updated_at":"2016-03-02T23:05:38Z","pushed_at":"2016-03-02T23:15:19Z","git_url":"git://github.com/Azure/azure-iot-sdks.git","ssh_url":"git@github.com:Azure/azure-iot-sdks.git","clone_url":"https://github.com/Azure/azure-iot-sdks.git","svn_url":"https://github.com/Azure/azure-iot-sdks","homepage":"http://azure.github.io/azure-iot-sdks/","size":32894,"stargazers_count":147,"watchers_count":147,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":183,"mirror_url":null,"open_issues_count":34,"forks":183,"open_issues":34,"watchers":147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366"},"html":{"href":"https://github.com/Azure/azure-iot-sdks/pull/366"},"issue":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/366"},"comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/issues/366/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/pulls/366/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-iot-sdks/statuses/b13c8a58cd78f434b84a8df05c297f79b7ae762a"}}}}