{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/comments/30302292","id":30302292,"diff_hunk":"@@ -0,0 +1,206 @@\n+/*\n+ * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+ * use this file except in compliance with the License. You may obtain a copy\n+ * 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 distributed\n+ * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n+ * CONDITIONS OF ANY KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations under the License.\n+ */\n+\n+package org.wso2.carbon.siddhi.tryit.ui;\n+\n+import com.google.gson.Gson;\n+import com.google.gson.GsonBuilder;\n+\n+import org.apache.commons.logging.Log;\n+import org.apache.commons.logging.LogFactory;\n+import org.wso2.siddhi.core.ExecutionPlanRuntime;\n+import org.wso2.siddhi.core.SiddhiManager;\n+import org.wso2.siddhi.core.event.Event;\n+import org.wso2.siddhi.core.query.output.callback.QueryCallback;\n+import org.wso2.siddhi.core.stream.input.InputHandler;\n+import org.wso2.siddhi.core.stream.output.StreamCallback;\n+\n+import org.wso2.siddhi.query.api.ExecutionPlan;\n+import org.wso2.siddhi.query.api.definition.Attribute;\n+import org.wso2.siddhi.query.api.execution.query.Query;\n+import org.wso2.siddhi.query.compiler.SiddhiCompiler;\n+\n+import java.text.SimpleDateFormat;\n+import java.util.*;\n+import java.util.regex.Matcher;\n+import java.util.regex.Pattern;\n+\n+public class SiddhiTryItClient {\n+\n+\tprivate static Log log = LogFactory.getLog(SiddhiTryItClient.class);\n+\tprivate static Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();\n+\tprivate String errMsg = \"\";\n+\n+\t/**\n+\t * Event stream will be processed according to the specified execution plan\n+\t *\n+\t * @param executionPlan execution plan for siddhi query processing\n+\t * @param eventStream   event stream\n+\t * @param dateTime      date and time to begin the process\n+\t */\n+\tpublic Map<String, StringBuilder> processData(String executionPlan, String eventStream,\n+\t                                              String dateTime) throws Exception {\n+\n+\t\tMap<String, StringBuilder> map = new LinkedHashMap<String, StringBuilder>();\n+\t\tlong beginSetTime = createTimeStamp(dateTime);\n+\t\tlong beginSystemTime = System.currentTimeMillis();\n+\t\tString queryName;","path":"components/siddhi-tryit/org.wso2.carbon.siddhi.tryit.ui/src/main/java/org/wso2/carbon/siddhi/tryit/ui/SiddhiTryItClient.java","position":59,"original_position":59,"commit_id":"d6db90d02c27d33508c383581ff0b24715fa0e5c","original_commit_id":"d6db90d02c27d33508c383581ff0b24715fa0e5c","user":{"login":"suhothayan","id":3785208,"avatar_url":"https://avatars.githubusercontent.com/u/3785208?v=3","gravatar_id":"","url":"https://api.github.com/users/suhothayan","html_url":"https://github.com/suhothayan","followers_url":"https://api.github.com/users/suhothayan/followers","following_url":"https://api.github.com/users/suhothayan/following{/other_user}","gists_url":"https://api.github.com/users/suhothayan/gists{/gist_id}","starred_url":"https://api.github.com/users/suhothayan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suhothayan/subscriptions","organizations_url":"https://api.github.com/users/suhothayan/orgs","repos_url":"https://api.github.com/users/suhothayan/repos","events_url":"https://api.github.com/users/suhothayan/events{/privacy}","received_events_url":"https://api.github.com/users/suhothayan/received_events","type":"User","site_admin":false},"body":" queryName should be defined inside the for loop","created_at":"2015-05-14T07:19:50Z","updated_at":"2015-05-14T07:19:50Z","html_url":"https://github.com/wso2/carbon-event-processing/pull/116#discussion_r30302292","pull_request_url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/comments/30302292"},"html":{"href":"https://github.com/wso2/carbon-event-processing/pull/116#discussion_r30302292"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116","id":35324531,"html_url":"https://github.com/wso2/carbon-event-processing/pull/116","diff_url":"https://github.com/wso2/carbon-event-processing/pull/116.diff","patch_url":"https://github.com/wso2/carbon-event-processing/pull/116.patch","issue_url":"https://api.github.com/repos/wso2/carbon-event-processing/issues/116","number":116,"state":"open","locked":false,"title":"Adding Siddhi Try It ui component","user":{"login":"thiliA","id":9333714,"avatar_url":"https://avatars.githubusercontent.com/u/9333714?v=3","gravatar_id":"","url":"https://api.github.com/users/thiliA","html_url":"https://github.com/thiliA","followers_url":"https://api.github.com/users/thiliA/followers","following_url":"https://api.github.com/users/thiliA/following{/other_user}","gists_url":"https://api.github.com/users/thiliA/gists{/gist_id}","starred_url":"https://api.github.com/users/thiliA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiliA/subscriptions","organizations_url":"https://api.github.com/users/thiliA/orgs","repos_url":"https://api.github.com/users/thiliA/repos","events_url":"https://api.github.com/users/thiliA/events{/privacy}","received_events_url":"https://api.github.com/users/thiliA/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-13T13:09:47Z","updated_at":"2015-05-14T07:19:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7098795804ec897116944f557574e6906099efa2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-event-processing/issues/116/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-event-processing/statuses/d6db90d02c27d33508c383581ff0b24715fa0e5c","head":{"label":"thiliA:master","ref":"master","sha":"d6db90d02c27d33508c383581ff0b24715fa0e5c","user":{"login":"thiliA","id":9333714,"avatar_url":"https://avatars.githubusercontent.com/u/9333714?v=3","gravatar_id":"","url":"https://api.github.com/users/thiliA","html_url":"https://github.com/thiliA","followers_url":"https://api.github.com/users/thiliA/followers","following_url":"https://api.github.com/users/thiliA/following{/other_user}","gists_url":"https://api.github.com/users/thiliA/gists{/gist_id}","starred_url":"https://api.github.com/users/thiliA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiliA/subscriptions","organizations_url":"https://api.github.com/users/thiliA/orgs","repos_url":"https://api.github.com/users/thiliA/repos","events_url":"https://api.github.com/users/thiliA/events{/privacy}","received_events_url":"https://api.github.com/users/thiliA/received_events","type":"User","site_admin":false},"repo":{"id":34050958,"name":"carbon-event-processing","full_name":"thiliA/carbon-event-processing","owner":{"login":"thiliA","id":9333714,"avatar_url":"https://avatars.githubusercontent.com/u/9333714?v=3","gravatar_id":"","url":"https://api.github.com/users/thiliA","html_url":"https://github.com/thiliA","followers_url":"https://api.github.com/users/thiliA/followers","following_url":"https://api.github.com/users/thiliA/following{/other_user}","gists_url":"https://api.github.com/users/thiliA/gists{/gist_id}","starred_url":"https://api.github.com/users/thiliA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiliA/subscriptions","organizations_url":"https://api.github.com/users/thiliA/orgs","repos_url":"https://api.github.com/users/thiliA/repos","events_url":"https://api.github.com/users/thiliA/events{/privacy}","received_events_url":"https://api.github.com/users/thiliA/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/thiliA/carbon-event-processing","description":"","fork":true,"url":"https://api.github.com/repos/thiliA/carbon-event-processing","forks_url":"https://api.github.com/repos/thiliA/carbon-event-processing/forks","keys_url":"https://api.github.com/repos/thiliA/carbon-event-processing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/thiliA/carbon-event-processing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/thiliA/carbon-event-processing/teams","hooks_url":"https://api.github.com/repos/thiliA/carbon-event-processing/hooks","issue_events_url":"https://api.github.com/repos/thiliA/carbon-event-processing/issues/events{/number}","events_url":"https://api.github.com/repos/thiliA/carbon-event-processing/events","assignees_url":"https://api.github.com/repos/thiliA/carbon-event-processing/assignees{/user}","branches_url":"https://api.github.com/repos/thiliA/carbon-event-processing/branches{/branch}","tags_url":"https://api.github.com/repos/thiliA/carbon-event-processing/tags","blobs_url":"https://api.github.com/repos/thiliA/carbon-event-processing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/thiliA/carbon-event-processing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/thiliA/carbon-event-processing/git/refs{/sha}","trees_url":"https://api.github.com/repos/thiliA/carbon-event-processing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/thiliA/carbon-event-processing/statuses/{sha}","languages_url":"https://api.github.com/repos/thiliA/carbon-event-processing/languages","stargazers_url":"https://api.github.com/repos/thiliA/carbon-event-processing/stargazers","contributors_url":"https://api.github.com/repos/thiliA/carbon-event-processing/contributors","subscribers_url":"https://api.github.com/repos/thiliA/carbon-event-processing/subscribers","subscription_url":"https://api.github.com/repos/thiliA/carbon-event-processing/subscription","commits_url":"https://api.github.com/repos/thiliA/carbon-event-processing/commits{/sha}","git_commits_url":"https://api.github.com/repos/thiliA/carbon-event-processing/git/commits{/sha}","comments_url":"https://api.github.com/repos/thiliA/carbon-event-processing/comments{/number}","issue_comment_url":"https://api.github.com/repos/thiliA/carbon-event-processing/issues/comments{/number}","contents_url":"https://api.github.com/repos/thiliA/carbon-event-processing/contents/{+path}","compare_url":"https://api.github.com/repos/thiliA/carbon-event-processing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/thiliA/carbon-event-processing/merges","archive_url":"https://api.github.com/repos/thiliA/carbon-event-processing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/thiliA/carbon-event-processing/downloads","issues_url":"https://api.github.com/repos/thiliA/carbon-event-processing/issues{/number}","pulls_url":"https://api.github.com/repos/thiliA/carbon-event-processing/pulls{/number}","milestones_url":"https://api.github.com/repos/thiliA/carbon-event-processing/milestones{/number}","notifications_url":"https://api.github.com/repos/thiliA/carbon-event-processing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/thiliA/carbon-event-processing/labels{/name}","releases_url":"https://api.github.com/repos/thiliA/carbon-event-processing/releases{/id}","created_at":"2015-04-16T11:05:36Z","updated_at":"2015-05-05T06:01:01Z","pushed_at":"2015-05-13T12:49:41Z","git_url":"git://github.com/thiliA/carbon-event-processing.git","ssh_url":"git@github.com:thiliA/carbon-event-processing.git","clone_url":"https://github.com/thiliA/carbon-event-processing.git","svn_url":"https://github.com/thiliA/carbon-event-processing","homepage":null,"size":7225,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"wso2:master","ref":"master","sha":"613adb9ade2c3cbf5a7d76a2f9c906e35ace901e","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":18992158,"name":"carbon-event-processing","full_name":"wso2/carbon-event-processing","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-event-processing","description":"","fork":false,"url":"https://api.github.com/repos/wso2/carbon-event-processing","forks_url":"https://api.github.com/repos/wso2/carbon-event-processing/forks","keys_url":"https://api.github.com/repos/wso2/carbon-event-processing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-event-processing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-event-processing/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-event-processing/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-event-processing/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-event-processing/events","assignees_url":"https://api.github.com/repos/wso2/carbon-event-processing/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-event-processing/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-event-processing/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-event-processing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-event-processing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-event-processing/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-event-processing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-event-processing/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-event-processing/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-event-processing/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-event-processing/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-event-processing/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-event-processing/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-event-processing/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-event-processing/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-event-processing/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-event-processing/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-event-processing/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-event-processing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-event-processing/merges","archive_url":"https://api.github.com/repos/wso2/carbon-event-processing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-event-processing/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-event-processing/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-event-processing/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-event-processing/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-event-processing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-event-processing/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-event-processing/releases{/id}","created_at":"2014-04-21T12:45:29Z","updated_at":"2015-05-07T13:31:44Z","pushed_at":"2015-05-14T07:14:37Z","git_url":"git://github.com/wso2/carbon-event-processing.git","ssh_url":"git@github.com:wso2/carbon-event-processing.git","clone_url":"https://github.com/wso2/carbon-event-processing.git","svn_url":"https://github.com/wso2/carbon-event-processing","homepage":null,"size":16314,"stargazers_count":2,"watchers_count":2,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":2,"forks":36,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116"},"html":{"href":"https://github.com/wso2/carbon-event-processing/pull/116"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/issues/116"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/issues/116/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/pulls/116/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-event-processing/statuses/d6db90d02c27d33508c383581ff0b24715fa0e5c"}}}}