{"action":"created","comment":{"url":"https://api.github.com/repos/OpenNMS/opennms/pulls/comments/42459594","id":42459594,"diff_hunk":"@@ -0,0 +1,114 @@\n+/*******************************************************************************\n+ * This file is part of OpenNMS(R).\n+ * <p>\n+ * Copyright (C) 2015 The OpenNMS Group, Inc.\n+ * OpenNMS(R) is Copyright (C) 1999-2015 The OpenNMS Group, Inc.\n+ * <p>\n+ * OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.\n+ * <p>\n+ * OpenNMS(R) is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License as published\n+ * by the Free Software Foundation, either version 3 of the License,\n+ * or (at your option) any later version.\n+ * <p>\n+ * OpenNMS(R) is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU Affero General Public License for more details.\n+ * <p>\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with OpenNMS(R).  If not, see:\n+ * http://www.gnu.org/licenses/\n+ * <p>\n+ * For more information contact:\n+ * OpenNMS(R) Licensing <license@opennms.org>\n+ * http://www.opennms.org/\n+ * http://www.opennms.com/\n+ *******************************************************************************/\n+\n+package org.opennms.netmgt.measurements.api;\n+\n+import java.util.Map;\n+\n+import com.google.common.base.Preconditions;\n+import com.google.common.collect.RowSortedTable;\n+\n+import org.opennms.netmgt.measurements.api.exceptions.FetchException;\n+import org.opennms.netmgt.measurements.api.exceptions.MeasurementException;\n+import org.opennms.netmgt.measurements.api.exceptions.ResourceNotFoundException;\n+import org.opennms.netmgt.measurements.api.exceptions.ValidationException;\n+import org.opennms.netmgt.measurements.model.QueryRequest;\n+import org.opennms.netmgt.measurements.model.QueryResponse;\n+import org.opennms.netmgt.measurements.model.Source;\n+import org.springframework.beans.factory.annotation.Autowired;\n+import org.springframework.stereotype.Component;\n+\n+@Component(\"measurementsService\")\n+public class MeasurementsService {\n+\n+    private final MeasurementFetchStrategy fetchStrategy;\n+    private final ExpressionEngine expressionEngine;\n+    private final FilterEngine filterEngine;\n+    private final QueryRequestValidator queryRequestValidator = new QueryRequestValidator();\n+\n+    @Autowired\n+    public MeasurementsService(MeasurementFetchStrategy fetchStrategy, ExpressionEngine expressionEngine, FilterEngine filterEngine) {\n+        Preconditions.checkNotNull(fetchStrategy);","path":"features/measurements/api/src/main/java/org/opennms/netmgt/measurements/api/MeasurementsService.java","position":56,"original_position":56,"commit_id":"de83b49be6d93e03259b14fe8ea63aa19ab3ddb9","original_commit_id":"de83b49be6d93e03259b14fe8ea63aa19ab3ddb9","user":{"login":"mvrueden","id":4202259,"avatar_url":"https://avatars.githubusercontent.com/u/4202259?v=3","gravatar_id":"","url":"https://api.github.com/users/mvrueden","html_url":"https://github.com/mvrueden","followers_url":"https://api.github.com/users/mvrueden/followers","following_url":"https://api.github.com/users/mvrueden/following{/other_user}","gists_url":"https://api.github.com/users/mvrueden/gists{/gist_id}","starred_url":"https://api.github.com/users/mvrueden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvrueden/subscriptions","organizations_url":"https://api.github.com/users/mvrueden/orgs","repos_url":"https://api.github.com/users/mvrueden/repos","events_url":"https://api.github.com/users/mvrueden/events{/privacy}","received_events_url":"https://api.github.com/users/mvrueden/received_events","type":"User","site_admin":false},"body":"Hey @j-white, good catch :)","created_at":"2015-10-20T06:21:27Z","updated_at":"2015-10-20T06:21:27Z","html_url":"https://github.com/OpenNMS/opennms/pull/402#discussion_r42459594","pull_request_url":"https://api.github.com/repos/OpenNMS/opennms/pulls/402","_links":{"self":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/comments/42459594"},"html":{"href":"https://github.com/OpenNMS/opennms/pull/402#discussion_r42459594"},"pull_request":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/402"}}},"pull_request":{"url":"https://api.github.com/repos/OpenNMS/opennms/pulls/402","id":48070482,"html_url":"https://github.com/OpenNMS/opennms/pull/402","diff_url":"https://github.com/OpenNMS/opennms/pull/402.diff","patch_url":"https://github.com/OpenNMS/opennms/pull/402.patch","issue_url":"https://api.github.com/repos/OpenNMS/opennms/issues/402","number":402,"state":"open","locked":false,"title":"HZN-453: Do not make REST Calls when running within OpenNMS","user":{"login":"mvrueden","id":4202259,"avatar_url":"https://avatars.githubusercontent.com/u/4202259?v=3","gravatar_id":"","url":"https://api.github.com/users/mvrueden","html_url":"https://github.com/mvrueden","followers_url":"https://api.github.com/users/mvrueden/followers","following_url":"https://api.github.com/users/mvrueden/following{/other_user}","gists_url":"https://api.github.com/users/mvrueden/gists{/gist_id}","starred_url":"https://api.github.com/users/mvrueden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvrueden/subscriptions","organizations_url":"https://api.github.com/users/mvrueden/orgs","repos_url":"https://api.github.com/users/mvrueden/repos","events_url":"https://api.github.com/users/mvrueden/events{/privacy}","received_events_url":"https://api.github.com/users/mvrueden/received_events","type":"User","site_admin":false},"body":"* Jira: http://issues.opennms.org/browse/HZN-453\r\n* Bamboo: http://bamboo.internal.opennms.com:8085/browse/OPENNMS-ONMS210","created_at":"2015-10-19T13:21:40Z","updated_at":"2015-10-20T06:21:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"70c285619fe302d5a852c0643b3efb7156206dc0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenNMS/opennms/pulls/402/commits","review_comments_url":"https://api.github.com/repos/OpenNMS/opennms/pulls/402/comments","review_comment_url":"https://api.github.com/repos/OpenNMS/opennms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenNMS/opennms/issues/402/comments","statuses_url":"https://api.github.com/repos/OpenNMS/opennms/statuses/de83b49be6d93e03259b14fe8ea63aa19ab3ddb9","head":{"label":"OpenNMS:jira/HZN-453","ref":"jira/HZN-453","sha":"de83b49be6d93e03259b14fe8ea63aa19ab3ddb9","user":{"login":"OpenNMS","id":2972482,"avatar_url":"https://avatars.githubusercontent.com/u/2972482?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"repo":{"id":9377198,"name":"opennms","full_name":"OpenNMS/opennms","owner":{"login":"OpenNMS","id":2972482,"avatar_url":"https://avatars.githubusercontent.com/u/2972482?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenNMS/opennms","description":"","fork":false,"url":"https://api.github.com/repos/OpenNMS/opennms","forks_url":"https://api.github.com/repos/OpenNMS/opennms/forks","keys_url":"https://api.github.com/repos/OpenNMS/opennms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenNMS/opennms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenNMS/opennms/teams","hooks_url":"https://api.github.com/repos/OpenNMS/opennms/hooks","issue_events_url":"https://api.github.com/repos/OpenNMS/opennms/issues/events{/number}","events_url":"https://api.github.com/repos/OpenNMS/opennms/events","assignees_url":"https://api.github.com/repos/OpenNMS/opennms/assignees{/user}","branches_url":"https://api.github.com/repos/OpenNMS/opennms/branches{/branch}","tags_url":"https://api.github.com/repos/OpenNMS/opennms/tags","blobs_url":"https://api.github.com/repos/OpenNMS/opennms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenNMS/opennms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenNMS/opennms/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenNMS/opennms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenNMS/opennms/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenNMS/opennms/languages","stargazers_url":"https://api.github.com/repos/OpenNMS/opennms/stargazers","contributors_url":"https://api.github.com/repos/OpenNMS/opennms/contributors","subscribers_url":"https://api.github.com/repos/OpenNMS/opennms/subscribers","subscription_url":"https://api.github.com/repos/OpenNMS/opennms/subscription","commits_url":"https://api.github.com/repos/OpenNMS/opennms/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenNMS/opennms/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenNMS/opennms/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenNMS/opennms/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenNMS/opennms/contents/{+path}","compare_url":"https://api.github.com/repos/OpenNMS/opennms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenNMS/opennms/merges","archive_url":"https://api.github.com/repos/OpenNMS/opennms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenNMS/opennms/downloads","issues_url":"https://api.github.com/repos/OpenNMS/opennms/issues{/number}","pulls_url":"https://api.github.com/repos/OpenNMS/opennms/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenNMS/opennms/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenNMS/opennms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenNMS/opennms/labels{/name}","releases_url":"https://api.github.com/repos/OpenNMS/opennms/releases{/id}","created_at":"2013-04-11T18:22:33Z","updated_at":"2015-10-17T20:11:40Z","pushed_at":"2015-10-20T02:14:31Z","git_url":"git://github.com/OpenNMS/opennms.git","ssh_url":"git@github.com:OpenNMS/opennms.git","clone_url":"https://github.com/OpenNMS/opennms.git","svn_url":"https://github.com/OpenNMS/opennms","homepage":"http://www.opennms.org/","size":1049229,"stargazers_count":101,"watchers_count":101,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":13,"forks":212,"open_issues":13,"watchers":101,"default_branch":"develop"}},"base":{"label":"OpenNMS:release-17.0.0","ref":"release-17.0.0","sha":"a93b344f5aa0b75bc4da249b886d1ff56edd0c1c","user":{"login":"OpenNMS","id":2972482,"avatar_url":"https://avatars.githubusercontent.com/u/2972482?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"repo":{"id":9377198,"name":"opennms","full_name":"OpenNMS/opennms","owner":{"login":"OpenNMS","id":2972482,"avatar_url":"https://avatars.githubusercontent.com/u/2972482?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenNMS","html_url":"https://github.com/OpenNMS","followers_url":"https://api.github.com/users/OpenNMS/followers","following_url":"https://api.github.com/users/OpenNMS/following{/other_user}","gists_url":"https://api.github.com/users/OpenNMS/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenNMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenNMS/subscriptions","organizations_url":"https://api.github.com/users/OpenNMS/orgs","repos_url":"https://api.github.com/users/OpenNMS/repos","events_url":"https://api.github.com/users/OpenNMS/events{/privacy}","received_events_url":"https://api.github.com/users/OpenNMS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenNMS/opennms","description":"","fork":false,"url":"https://api.github.com/repos/OpenNMS/opennms","forks_url":"https://api.github.com/repos/OpenNMS/opennms/forks","keys_url":"https://api.github.com/repos/OpenNMS/opennms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenNMS/opennms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenNMS/opennms/teams","hooks_url":"https://api.github.com/repos/OpenNMS/opennms/hooks","issue_events_url":"https://api.github.com/repos/OpenNMS/opennms/issues/events{/number}","events_url":"https://api.github.com/repos/OpenNMS/opennms/events","assignees_url":"https://api.github.com/repos/OpenNMS/opennms/assignees{/user}","branches_url":"https://api.github.com/repos/OpenNMS/opennms/branches{/branch}","tags_url":"https://api.github.com/repos/OpenNMS/opennms/tags","blobs_url":"https://api.github.com/repos/OpenNMS/opennms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenNMS/opennms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenNMS/opennms/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenNMS/opennms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenNMS/opennms/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenNMS/opennms/languages","stargazers_url":"https://api.github.com/repos/OpenNMS/opennms/stargazers","contributors_url":"https://api.github.com/repos/OpenNMS/opennms/contributors","subscribers_url":"https://api.github.com/repos/OpenNMS/opennms/subscribers","subscription_url":"https://api.github.com/repos/OpenNMS/opennms/subscription","commits_url":"https://api.github.com/repos/OpenNMS/opennms/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenNMS/opennms/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenNMS/opennms/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenNMS/opennms/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenNMS/opennms/contents/{+path}","compare_url":"https://api.github.com/repos/OpenNMS/opennms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenNMS/opennms/merges","archive_url":"https://api.github.com/repos/OpenNMS/opennms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenNMS/opennms/downloads","issues_url":"https://api.github.com/repos/OpenNMS/opennms/issues{/number}","pulls_url":"https://api.github.com/repos/OpenNMS/opennms/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenNMS/opennms/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenNMS/opennms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenNMS/opennms/labels{/name}","releases_url":"https://api.github.com/repos/OpenNMS/opennms/releases{/id}","created_at":"2013-04-11T18:22:33Z","updated_at":"2015-10-17T20:11:40Z","pushed_at":"2015-10-20T02:14:31Z","git_url":"git://github.com/OpenNMS/opennms.git","ssh_url":"git@github.com:OpenNMS/opennms.git","clone_url":"https://github.com/OpenNMS/opennms.git","svn_url":"https://github.com/OpenNMS/opennms","homepage":"http://www.opennms.org/","size":1049229,"stargazers_count":101,"watchers_count":101,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":212,"mirror_url":null,"open_issues_count":13,"forks":212,"open_issues":13,"watchers":101,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/402"},"html":{"href":"https://github.com/OpenNMS/opennms/pull/402"},"issue":{"href":"https://api.github.com/repos/OpenNMS/opennms/issues/402"},"comments":{"href":"https://api.github.com/repos/OpenNMS/opennms/issues/402/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/402/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenNMS/opennms/pulls/402/commits"},"statuses":{"href":"https://api.github.com/repos/OpenNMS/opennms/statuses/de83b49be6d93e03259b14fe8ea63aa19ab3ddb9"}}}}