{"action":"created","comment":{"url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/comments/77932247","id":77932247,"diff_hunk":"@@ -0,0 +1,101 @@\n+/**\n+ * Copyright 2016 Boundless http://boundlessgeo.com\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License\n+ */\n+\n+package com.boundlessgeo.spatialconnect.stores;\n+\n+import android.content.Context;\n+\n+import com.boundlessgeo.spatialconnect.SpatialConnect;\n+import com.boundlessgeo.spatialconnect.config.SCStoreConfig;\n+import com.boundlessgeo.spatialconnect.geometries.SCPoint;\n+import com.boundlessgeo.spatialconnect.geometries.SCSpatialFeature;\n+import com.boundlessgeo.spatialconnect.mqtt.QoS;\n+import com.boundlessgeo.spatialconnect.query.SCQueryFilter;\n+import com.boundlessgeo.spatialconnect.schema.SCMessageOuterClass;\n+\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import rx.Observable;\n+import rx.functions.Action0;\n+\n+public class LocationStore extends GeoPackageStore {\n+\n+    public static final String NAME = \"LOCATION_STORE\";\n+\n+    public LocationStore(Context context, SCStoreConfig scStoreConfig) {\n+        super(context, scStoreConfig);\n+    }\n+\n+    public Observable<SCStoreStatusEvent> start() {\n+        Observable<SCStoreStatusEvent> storeStatusEvent;\n+        storeStatusEvent = super.start();\n+\n+        return storeStatusEvent.doOnCompleted(new Action0() {\n+            @Override\n+            public void call() {\n+                //when store started add default config\n+                Map<String, String> typeDefs = new HashMap<>();\n+                typeDefs.put(\"accuracy\",\"TEXT\");\n+                typeDefs.put(\"timestamp\",\"INTEGER\");\n+\n+                addLayer(\"last_known_location\", typeDefs);\n+            }\n+        });\n+    }\n+\n+    @Override\n+    public Observable<SCSpatialFeature> query(final SCQueryFilter scFilter) {\n+        return Observable.empty();\n+    }\n+\n+    @Override\n+    public Observable<SCSpatialFeature> queryById(final SCKeyTuple keyTuple) {\n+        return Observable.empty();\n+    }\n+\n+    public Observable<SCSpatialFeature> create(final SCPoint point) {\n+        point.setLayerId(\"last_known_location\");\n+\n+        Observable<SCSpatialFeature> spatialFeature = super.create(point);\n+\n+        return spatialFeature.doOnCompleted(new Action0() {\n+            @Override\n+            public void call() {\n+                SCMessageOuterClass.SCMessage.Builder builder =\n+                        SCMessageOuterClass.SCMessage.newBuilder();\n+                builder.setAction(100)\n+                        .setPayload(point.toJson())\n+                        .build();\n+                SCMessageOuterClass.SCMessage message = builder.build();\n+\n+                SpatialConnect.getInstance()\n+                        .getBackendService().publish(\"/store/tracking\",message, QoS.AT_MOST_ONCE);\n+            }","path":"spatialconnect/src/main/java/com/boundlessgeo/spatialconnect/stores/LocationStore.java","position":87,"original_position":87,"commit_id":"44ae3a56fcae60b5b25b8ae34fc959574948d39a","original_commit_id":"44ae3a56fcae60b5b25b8ae34fc959574948d39a","user":{"login":"tetriscode","id":242747,"avatar_url":"https://avatars.githubusercontent.com/u/242747?v=3","gravatar_id":"","url":"https://api.github.com/users/tetriscode","html_url":"https://github.com/tetriscode","followers_url":"https://api.github.com/users/tetriscode/followers","following_url":"https://api.github.com/users/tetriscode/following{/other_user}","gists_url":"https://api.github.com/users/tetriscode/gists{/gist_id}","starred_url":"https://api.github.com/users/tetriscode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tetriscode/subscriptions","organizations_url":"https://api.github.com/users/tetriscode/orgs","repos_url":"https://api.github.com/users/tetriscode/repos","events_url":"https://api.github.com/users/tetriscode/events{/privacy}","received_events_url":"https://api.github.com/users/tetriscode/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2016-09-08T01:09:26Z","updated_at":"2016-09-08T01:09:26Z","html_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101#discussion_r77932247","pull_request_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101","_links":{"self":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/comments/77932247"},"html":{"href":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101#discussion_r77932247"},"pull_request":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101"}}},"pull_request":{"url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101","id":84398681,"html_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101","diff_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101.diff","patch_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101.patch","issue_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/101","number":101,"state":"open","locked":false,"title":"Feature/location store","user":{"login":"georific","id":21197715,"avatar_url":"https://avatars.githubusercontent.com/u/21197715?v=3","gravatar_id":"","url":"https://api.github.com/users/georific","html_url":"https://github.com/georific","followers_url":"https://api.github.com/users/georific/followers","following_url":"https://api.github.com/users/georific/following{/other_user}","gists_url":"https://api.github.com/users/georific/gists{/gist_id}","starred_url":"https://api.github.com/users/georific/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georific/subscriptions","organizations_url":"https://api.github.com/users/georific/orgs","repos_url":"https://api.github.com/users/georific/repos","events_url":"https://api.github.com/users/georific/events{/privacy}","received_events_url":"https://api.github.com/users/georific/received_events","type":"User","site_admin":false},"body":"## Status\r\nReady\r\n\r\n## JIRA Ticket\r\nSPACON-212\r\n## Description\r\nAdding Location store\r\n\r\n## Todos\r\n- [ ] Tests\r\n- [ ] Documentation\r\n- [ ] License\r\n\r\n```sh\r\ngit fetch --all\r\ngit checkout <feature_branch> \r\n./gradlew connectedCheck\r\n```\r\n\r\n@boundlessgeo/spatial-connect\r\n","created_at":"2016-09-08T00:58:46Z","updated_at":"2016-09-08T01:09:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93cf53e59e8b221aae21c734f0ca5a50253b0de4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101/commits","review_comments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101/comments","review_comment_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/101/comments","statuses_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/statuses/44ae3a56fcae60b5b25b8ae34fc959574948d39a","head":{"label":"boundlessgeo:feature/location_store","ref":"feature/location_store","sha":"44ae3a56fcae60b5b25b8ae34fc959574948d39a","user":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars.githubusercontent.com/u/306022?v=3","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"repo":{"id":46134810,"name":"spatialconnect-android-sdk","full_name":"boundlessgeo/spatialconnect-android-sdk","owner":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars.githubusercontent.com/u/306022?v=3","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk","description":"","fork":false,"url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk","forks_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/forks","keys_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/teams","hooks_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/events","assignees_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/tags","blobs_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/languages","stargazers_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/subscription","commits_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/merges","archive_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/downloads","issues_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/deployments","created_at":"2015-11-13T16:52:06Z","updated_at":"2016-09-02T01:01:20Z","pushed_at":"2016-09-08T00:58:46Z","git_url":"git://github.com/boundlessgeo/spatialconnect-android-sdk.git","ssh_url":"git@github.com:boundlessgeo/spatialconnect-android-sdk.git","clone_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk.git","svn_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk","homepage":null,"size":11474,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"boundlessgeo:develop","ref":"develop","sha":"47122b206b6caa7040fd51ad670f6c0a8e598bbf","user":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars.githubusercontent.com/u/306022?v=3","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"repo":{"id":46134810,"name":"spatialconnect-android-sdk","full_name":"boundlessgeo/spatialconnect-android-sdk","owner":{"login":"boundlessgeo","id":306022,"avatar_url":"https://avatars.githubusercontent.com/u/306022?v=3","gravatar_id":"","url":"https://api.github.com/users/boundlessgeo","html_url":"https://github.com/boundlessgeo","followers_url":"https://api.github.com/users/boundlessgeo/followers","following_url":"https://api.github.com/users/boundlessgeo/following{/other_user}","gists_url":"https://api.github.com/users/boundlessgeo/gists{/gist_id}","starred_url":"https://api.github.com/users/boundlessgeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boundlessgeo/subscriptions","organizations_url":"https://api.github.com/users/boundlessgeo/orgs","repos_url":"https://api.github.com/users/boundlessgeo/repos","events_url":"https://api.github.com/users/boundlessgeo/events{/privacy}","received_events_url":"https://api.github.com/users/boundlessgeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk","description":"","fork":false,"url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk","forks_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/forks","keys_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/teams","hooks_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/events","assignees_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/tags","blobs_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/languages","stargazers_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/subscription","commits_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/merges","archive_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/downloads","issues_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/deployments","created_at":"2015-11-13T16:52:06Z","updated_at":"2016-09-02T01:01:20Z","pushed_at":"2016-09-08T00:58:46Z","git_url":"git://github.com/boundlessgeo/spatialconnect-android-sdk.git","ssh_url":"git@github.com:boundlessgeo/spatialconnect-android-sdk.git","clone_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk.git","svn_url":"https://github.com/boundlessgeo/spatialconnect-android-sdk","homepage":null,"size":11474,"stargazers_count":2,"watchers_count":2,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":3,"forks":3,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101"},"html":{"href":"https://github.com/boundlessgeo/spatialconnect-android-sdk/pull/101"},"issue":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/101"},"comments":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/issues/101/comments"},"review_comments":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101/comments"},"review_comment":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/pulls/101/commits"},"statuses":{"href":"https://api.github.com/repos/boundlessgeo/spatialconnect-android-sdk/statuses/44ae3a56fcae60b5b25b8ae34fc959574948d39a"}}}}
{"actor":{"display_login":"tetriscode"}}