{"action":"created","comment":{"url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/comments/186355563","pull_request_review_id":117915504,"id":186355563,"diff_hunk":"@@ -227,13 +215,43 @@ public HttpServiceModule getHttpLayer() {\n     }\n \n     /**\n-     * Returns the configuration for this singleThreadService from the JSON config file\n+     * Returns the configurations for this service type from the JSON config file.\n+     *\n+     * @param type Service type\n+     * @return the configurations for this service type from the JSON config file\n+     */\n+    public List<ServiceConfiguration> getServiceConfigurationsByType(final String type) {\n+        return serviceConfigsByType.get(type);\n+    }\n+\n+    /**\n+     * Returns the configuration for this service type from the JSON config file.\n+     *\n+     * If there are multiple configs for the type, the first one will be returned.\n+     *\n+     * @param type Service type\n+     * @return the first configuration for this service type from the JSON config file\n+     */\n+    public ServiceConfiguration getServiceConfigurationByType(final String type) {","path":"core/src/main/java/org/aerogear/mobile/core/MobileCore.java","position":116,"original_position":116,"commit_id":"c088cac834ba064b9d9be2a929168300aa24c2cf","original_commit_id":"c088cac834ba064b9d9be2a929168300aa24c2cf","user":{"login":"aliok","id":376732,"avatar_url":"https://avatars2.githubusercontent.com/u/376732?v=4","gravatar_id":"","url":"https://api.github.com/users/aliok","html_url":"https://github.com/aliok","followers_url":"https://api.github.com/users/aliok/followers","following_url":"https://api.github.com/users/aliok/following{/other_user}","gists_url":"https://api.github.com/users/aliok/gists{/gist_id}","starred_url":"https://api.github.com/users/aliok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliok/subscriptions","organizations_url":"https://api.github.com/users/aliok/orgs","repos_url":"https://api.github.com/users/aliok/repos","events_url":"https://api.github.com/users/aliok/events{/privacy}","received_events_url":"https://api.github.com/users/aliok/received_events","type":"User","site_admin":false},"body":"@danielpassos Also, John recommends having a single configs for services: \r\nSo, I would like to keep that method.","created_at":"2018-05-07T08:13:00Z","updated_at":"2018-05-07T08:13:01Z","html_url":"https://github.com/aerogear/aerogear-android-sdk/pull/218#discussion_r186355563","pull_request_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/comments/186355563"},"html":{"href":"https://github.com/aerogear/aerogear-android-sdk/pull/218#discussion_r186355563"},"pull_request":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218"}},"in_reply_to_id":186081225},"pull_request":{"url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218","id":185968370,"html_url":"https://github.com/aerogear/aerogear-android-sdk/pull/218","diff_url":"https://github.com/aerogear/aerogear-android-sdk/pull/218.diff","patch_url":"https://github.com/aerogear/aerogear-android-sdk/pull/218.patch","issue_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/218","number":218,"state":"open","locked":false,"title":"[WIP] AEROGEAR-2669 - Android SDK should query for configuration type and id","user":{"login":"aliok","id":376732,"avatar_url":"https://avatars2.githubusercontent.com/u/376732?v=4","gravatar_id":"","url":"https://api.github.com/users/aliok","html_url":"https://github.com/aliok","followers_url":"https://api.github.com/users/aliok/followers","following_url":"https://api.github.com/users/aliok/following{/other_user}","gists_url":"https://api.github.com/users/aliok/gists{/gist_id}","starred_url":"https://api.github.com/users/aliok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliok/subscriptions","organizations_url":"https://api.github.com/users/aliok/orgs","repos_url":"https://api.github.com/users/aliok/repos","events_url":"https://api.github.com/users/aliok/events{/privacy}","received_events_url":"https://api.github.com/users/aliok/received_events","type":"User","site_admin":false},"body":"## Motivation\r\n\r\nJIRA: https://issues.jboss.org/browse/AEROGEAR-2669\r\n\r\n## Description\r\n\r\n* After discussion on the mailing list [1] [2], we needed to adapt the SDK in terms of how to get the configs for the services.\r\n* Before, we were using \"name\" properties for getting the service config. Now we need to use \"id\" and/or \"type\" properties.\r\n\r\nWhat's done:\r\n* Introduced methods on MobileCore to\r\n  * get config by id --> needed for custom runtime connectors\r\n  * get configs by type --> needed when there are multiple configs for a service type\r\n  * get config by type --> similar to above, but gets the first one found. this is the one used by mobile core by default for services created automatically (Metrics, Keycloak etc). This is basically the old \"getServiceConfiguration\" method modified.\r\n* Got rid of the service cache in MobileCore because of the idea that we can have multiple instances of a service for different configs\r\n* Got rid of `destroy` methods in `ServiceModule` impls, because we don't store the initialized services in the cache anymore. Also, all of the `destroy` method impls were empty\r\n\r\n\r\n[1]: https://groups.google.com/forum/#!topic/aerogear/1hxhEPBASVY\r\n[2]: https://groups.google.com/forum/#!topic/aerogear/tXsNboCR-8A\r\n\r\n## Additional Notes\r\n\r\nWIP PR!\r\nI will do the changes in the example app after we agree on the SDK changes.\r\n","created_at":"2018-05-04T12:22:59Z","updated_at":"2018-05-07T08:13:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e5fffd3dd83e3f0fe3f3ef32995bac0fa4519c28","assignee":null,"assignees":[],"requested_reviewers":[{"login":"wtrocki","id":981838,"avatar_url":"https://avatars3.githubusercontent.com/u/981838?v=4","gravatar_id":"","url":"https://api.github.com/users/wtrocki","html_url":"https://github.com/wtrocki","followers_url":"https://api.github.com/users/wtrocki/followers","following_url":"https://api.github.com/users/wtrocki/following{/other_user}","gists_url":"https://api.github.com/users/wtrocki/gists{/gist_id}","starred_url":"https://api.github.com/users/wtrocki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wtrocki/subscriptions","organizations_url":"https://api.github.com/users/wtrocki/orgs","repos_url":"https://api.github.com/users/wtrocki/repos","events_url":"https://api.github.com/users/wtrocki/events{/privacy}","received_events_url":"https://api.github.com/users/wtrocki/received_events","type":"User","site_admin":false},{"login":"secondsun","id":2413816,"avatar_url":"https://avatars2.githubusercontent.com/u/2413816?v=4","gravatar_id":"","url":"https://api.github.com/users/secondsun","html_url":"https://github.com/secondsun","followers_url":"https://api.github.com/users/secondsun/followers","following_url":"https://api.github.com/users/secondsun/following{/other_user}","gists_url":"https://api.github.com/users/secondsun/gists{/gist_id}","starred_url":"https://api.github.com/users/secondsun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/secondsun/subscriptions","organizations_url":"https://api.github.com/users/secondsun/orgs","repos_url":"https://api.github.com/users/secondsun/repos","events_url":"https://api.github.com/users/secondsun/events{/privacy}","received_events_url":"https://api.github.com/users/secondsun/received_events","type":"User","site_admin":false},{"login":"josemigallas","id":11672286,"avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":879713304,"url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/labels/test/integration","name":"test/integration","color":"5319e7","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218/commits","review_comments_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218/comments","review_comment_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/218/comments","statuses_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/statuses/c088cac834ba064b9d9be2a929168300aa24c2cf","head":{"label":"aliok:AEROGEAR-2669-service-config-query-improved","ref":"AEROGEAR-2669-service-config-query-improved","sha":"c088cac834ba064b9d9be2a929168300aa24c2cf","user":{"login":"aliok","id":376732,"avatar_url":"https://avatars2.githubusercontent.com/u/376732?v=4","gravatar_id":"","url":"https://api.github.com/users/aliok","html_url":"https://github.com/aliok","followers_url":"https://api.github.com/users/aliok/followers","following_url":"https://api.github.com/users/aliok/following{/other_user}","gists_url":"https://api.github.com/users/aliok/gists{/gist_id}","starred_url":"https://api.github.com/users/aliok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliok/subscriptions","organizations_url":"https://api.github.com/users/aliok/orgs","repos_url":"https://api.github.com/users/aliok/repos","events_url":"https://api.github.com/users/aliok/events{/privacy}","received_events_url":"https://api.github.com/users/aliok/received_events","type":"User","site_admin":false},"repo":{"id":128167351,"name":"aerogear-android-sdk","full_name":"aliok/aerogear-android-sdk","owner":{"login":"aliok","id":376732,"avatar_url":"https://avatars2.githubusercontent.com/u/376732?v=4","gravatar_id":"","url":"https://api.github.com/users/aliok","html_url":"https://github.com/aliok","followers_url":"https://api.github.com/users/aliok/followers","following_url":"https://api.github.com/users/aliok/following{/other_user}","gists_url":"https://api.github.com/users/aliok/gists{/gist_id}","starred_url":"https://api.github.com/users/aliok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliok/subscriptions","organizations_url":"https://api.github.com/users/aliok/orgs","repos_url":"https://api.github.com/users/aliok/repos","events_url":"https://api.github.com/users/aliok/events{/privacy}","received_events_url":"https://api.github.com/users/aliok/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aliok/aerogear-android-sdk","description":"AeroGear Services Android SDK","fork":true,"url":"https://api.github.com/repos/aliok/aerogear-android-sdk","forks_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/forks","keys_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/teams","hooks_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/events","assignees_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/tags","blobs_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/languages","stargazers_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/subscription","commits_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/merges","archive_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/downloads","issues_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/aliok/aerogear-android-sdk/deployments","created_at":"2018-04-05T06:26:19Z","updated_at":"2018-04-05T06:26:21Z","pushed_at":"2018-05-04T12:26:18Z","git_url":"git://github.com/aliok/aerogear-android-sdk.git","ssh_url":"git@github.com:aliok/aerogear-android-sdk.git","clone_url":"https://github.com/aliok/aerogear-android-sdk.git","svn_url":"https://github.com/aliok/aerogear-android-sdk","homepage":"","size":1671,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aerogear:master","ref":"master","sha":"8e99bad457dc129f2232390af9279b91b4181ddd","user":{"login":"aerogear","id":954205,"avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"repo":{"id":116160086,"name":"aerogear-android-sdk","full_name":"aerogear/aerogear-android-sdk","owner":{"login":"aerogear","id":954205,"avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aerogear/aerogear-android-sdk","description":"AeroGear Services Android SDK","fork":false,"url":"https://api.github.com/repos/aerogear/aerogear-android-sdk","forks_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/forks","keys_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/teams","hooks_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/hooks","issue_events_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/events","assignees_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/tags","blobs_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/languages","stargazers_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/stargazers","contributors_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/contributors","subscribers_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/subscribers","subscription_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/subscription","commits_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/merges","archive_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/downloads","issues_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/labels{/name}","releases_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/releases{/id}","deployments_url":"https://api.github.com/repos/aerogear/aerogear-android-sdk/deployments","created_at":"2018-01-03T16:45:59Z","updated_at":"2018-05-03T12:17:33Z","pushed_at":"2018-05-04T14:54:29Z","git_url":"git://github.com/aerogear/aerogear-android-sdk.git","ssh_url":"git@github.com:aerogear/aerogear-android-sdk.git","clone_url":"https://github.com/aerogear/aerogear-android-sdk.git","svn_url":"https://github.com/aerogear/aerogear-android-sdk","homepage":"","size":1680,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":20,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":26,"open_issues":20,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218"},"html":{"href":"https://github.com/aerogear/aerogear-android-sdk/pull/218"},"issue":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/218"},"comments":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/issues/218/comments"},"review_comments":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218/comments"},"review_comment":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/pulls/218/commits"},"statuses":{"href":"https://api.github.com/repos/aerogear/aerogear-android-sdk/statuses/c088cac834ba064b9d9be2a929168300aa24c2cf"}},"author_association":"OWNER"}}
{"actor":{"display_login":"aliok"}}