{"action":"created","comment":{"url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/comments/114609724","pull_request_review_id":36091072,"id":114609724,"diff_hunk":"@@ -29,50 +42,91 @@\n      * @throws IOException\n      */\n     private StreamingAnalyticsConnection(String userName, String authToken, String url) {\n-      super( userName, authToken, url );\n+        super(userName, authToken, url);\n     }\n \n-    public static StreamingAnalyticsConnection createInstance( String credentialsFile, String serviceName )\n+    public static StreamingAnalyticsConnection createInstance(String credentialsFile, String serviceName)\n             throws IOException {\n \n-        JsonObject SAcredentials = new JsonObject();\n+        JsonObject streamingAnalyticsCredentials = new JsonObject();\n \n-        SAcredentials.addProperty(SERVICE_NAME, serviceName);\n-        SAcredentials.addProperty(VCAP_SERVICES, credentialsFile);\n+        streamingAnalyticsCredentials.addProperty(SERVICE_NAME, serviceName);\n+        streamingAnalyticsCredentials.addProperty(VCAP_SERVICES, credentialsFile);\n \n-        JsonObject service = VcapServices.getVCAPService(SAcredentials);\n+        JsonObject service = VcapServices.getVCAPService(streamingAnalyticsCredentials);\n \n         JsonObject credential = new JsonObject();\n         credential = service.get(\"credentials\").getAsJsonObject();\n \n         String userId = credential.get(\"userid\").getAsString();\n         String authToken = credential.get(\"password\").getAsString();\n+\n         String resourcesPath = credential.get(\"resources_path\").getAsString();\n         String sURL = credential.get(\"rest_url\").getAsString() + resourcesPath;\n \n-        String restURL = \"\" ;\n-        StreamingAnalyticsConnection SAConn = new StreamingAnalyticsConnection( userId, authToken, restURL ) ;\n+        String jobPath = credential.get(\"jobs_path\").getAsString();\n+        String jobString = credential.get(\"rest_url\").getAsString() + jobPath;\n+\n+        String restURL = \"\";\n+        StreamingAnalyticsConnection streamingConnection = new StreamingAnalyticsConnection(userId, authToken, restURL);\n+        streamingConnection.setJobsPath(jobString);\n \n-        String sResources = SAConn.getResponseString(sURL);\n+        String sResources = streamingConnection.getResponseString(sURL);\n         if (!sResources.equals(\"\")) {\n             JsonParser jParse = new JsonParser();\n             JsonObject resources = jParse.parse(sResources).getAsJsonObject();\n \n             restURL = resources.get(\"streams_rest_url\").getAsString();\n         }\n \n-        if ( restURL.equals(\"\") ) {\n+        if (restURL.equals(\"\")) {\n             throw new IllegalStateException(\"Missing restURL for service\");\n         }\n \n-        SAConn.setURL( restURL ) ;\n+        streamingConnection.setURL(restURL);\n         String[] rTokens = resourcesPath.split(\"/\");\n         if (rTokens[3].equals(\"service_instances\")) {\n-            SAConn.setInstanceId(rTokens[4]) ;\n+            streamingConnection.setInstanceId(rTokens[4]);\n         } else {\n             throw new IllegalStateException(\"Resource Path decoding error.\");\n         }\n-        return SAConn ;\n+        return streamingConnection;\n+    }\n+\n+    private void setJobsPath(String sJobs) {\n+        jobsPath = sJobs;\n+    }\n+\n+    /**\n+     * @param jobId\n+     *            string indicating the job id to be cancelled\n+     * @return true if job is cancelled, false otherwise\n+     */\n+    @Override\n+    public boolean cancel_job(String jobId) {","path":"java/src/com/ibm/streamsx/rest/StreamingAnalyticsConnection.java","position":109,"original_position":109,"commit_id":"d631dde072c9297b7f860b20b1d6d5dd78b1ff93","original_commit_id":"d631dde072c9297b7f860b20b1d6d5dd78b1ff93","user":{"login":"yvchan","id":27433322,"avatar_url":"https://avatars1.githubusercontent.com/u/27433322?v=3","gravatar_id":"","url":"https://api.github.com/users/yvchan","html_url":"https://github.com/yvchan","followers_url":"https://api.github.com/users/yvchan/followers","following_url":"https://api.github.com/users/yvchan/following{/other_user}","gists_url":"https://api.github.com/users/yvchan/gists{/gist_id}","starred_url":"https://api.github.com/users/yvchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yvchan/subscriptions","organizations_url":"https://api.github.com/users/yvchan/orgs","repos_url":"https://api.github.com/users/yvchan/repos","events_url":"https://api.github.com/users/yvchan/events{/privacy}","received_events_url":"https://api.github.com/users/yvchan/received_events","type":"User","site_admin":false},"body":"will change this.  ","created_at":"2017-05-03T17:50:40Z","updated_at":"2017-05-03T17:50:40Z","html_url":"https://github.com/IBMStreams/streamsx.topology/pull/1004#discussion_r114609724","pull_request_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004","_links":{"self":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/comments/114609724"},"html":{"href":"https://github.com/IBMStreams/streamsx.topology/pull/1004#discussion_r114609724"},"pull_request":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004"}}},"pull_request":{"url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004","id":118657397,"html_url":"https://github.com/IBMStreams/streamsx.topology/pull/1004","diff_url":"https://github.com/IBMStreams/streamsx.topology/pull/1004.diff","patch_url":"https://github.com/IBMStreams/streamsx.topology/pull/1004.patch","issue_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/1004","number":1004,"state":"open","locked":false,"title":"allow a job to be canceled from the Job object in the rest api.","user":{"login":"yvchan","id":27433322,"avatar_url":"https://avatars1.githubusercontent.com/u/27433322?v=3","gravatar_id":"","url":"https://api.github.com/users/yvchan","html_url":"https://github.com/yvchan","followers_url":"https://api.github.com/users/yvchan/followers","following_url":"https://api.github.com/users/yvchan/following{/other_user}","gists_url":"https://api.github.com/users/yvchan/gists{/gist_id}","starred_url":"https://api.github.com/users/yvchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yvchan/subscriptions","organizations_url":"https://api.github.com/users/yvchan/orgs","repos_url":"https://api.github.com/users/yvchan/repos","events_url":"https://api.github.com/users/yvchan/events{/privacy}","received_events_url":"https://api.github.com/users/yvchan/received_events","type":"User","site_admin":false},"body":"*Array* classes have been cleaned up to remove an unused StreamsConnection object, and most have been made package level classes.  The InstanceArray is needed by the higher level package, so it's been left public.\r\n\r\nThe Job.cancel() functionality has been added to the api, and can cancel either a StreamingAnalyticsConnection job (via the REST api), or a StreamsConnection job (via the InvokeCancel api)","created_at":"2017-05-02T22:07:37Z","updated_at":"2017-05-03T17:50:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96c3ee813b0f543e3b03e3b5bb5cd434926bd838","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004/commits","review_comments_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004/comments","review_comment_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/comments{/number}","comments_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/1004/comments","statuses_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/statuses/d631dde072c9297b7f860b20b1d6d5dd78b1ff93","head":{"label":"yvchan:java_rest_api","ref":"java_rest_api","sha":"d631dde072c9297b7f860b20b1d6d5dd78b1ff93","user":{"login":"yvchan","id":27433322,"avatar_url":"https://avatars1.githubusercontent.com/u/27433322?v=3","gravatar_id":"","url":"https://api.github.com/users/yvchan","html_url":"https://github.com/yvchan","followers_url":"https://api.github.com/users/yvchan/followers","following_url":"https://api.github.com/users/yvchan/following{/other_user}","gists_url":"https://api.github.com/users/yvchan/gists{/gist_id}","starred_url":"https://api.github.com/users/yvchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yvchan/subscriptions","organizations_url":"https://api.github.com/users/yvchan/orgs","repos_url":"https://api.github.com/users/yvchan/repos","events_url":"https://api.github.com/users/yvchan/events{/privacy}","received_events_url":"https://api.github.com/users/yvchan/received_events","type":"User","site_admin":false},"repo":{"id":88183881,"name":"streamsx.topology","full_name":"yvchan/streamsx.topology","owner":{"login":"yvchan","id":27433322,"avatar_url":"https://avatars1.githubusercontent.com/u/27433322?v=3","gravatar_id":"","url":"https://api.github.com/users/yvchan","html_url":"https://github.com/yvchan","followers_url":"https://api.github.com/users/yvchan/followers","following_url":"https://api.github.com/users/yvchan/following{/other_user}","gists_url":"https://api.github.com/users/yvchan/gists{/gist_id}","starred_url":"https://api.github.com/users/yvchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yvchan/subscriptions","organizations_url":"https://api.github.com/users/yvchan/orgs","repos_url":"https://api.github.com/users/yvchan/repos","events_url":"https://api.github.com/users/yvchan/events{/privacy}","received_events_url":"https://api.github.com/users/yvchan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yvchan/streamsx.topology","description":"(Incubation) Develop streaming applications for IBM Streams in Python, Java & Scala.","fork":true,"url":"https://api.github.com/repos/yvchan/streamsx.topology","forks_url":"https://api.github.com/repos/yvchan/streamsx.topology/forks","keys_url":"https://api.github.com/repos/yvchan/streamsx.topology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yvchan/streamsx.topology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yvchan/streamsx.topology/teams","hooks_url":"https://api.github.com/repos/yvchan/streamsx.topology/hooks","issue_events_url":"https://api.github.com/repos/yvchan/streamsx.topology/issues/events{/number}","events_url":"https://api.github.com/repos/yvchan/streamsx.topology/events","assignees_url":"https://api.github.com/repos/yvchan/streamsx.topology/assignees{/user}","branches_url":"https://api.github.com/repos/yvchan/streamsx.topology/branches{/branch}","tags_url":"https://api.github.com/repos/yvchan/streamsx.topology/tags","blobs_url":"https://api.github.com/repos/yvchan/streamsx.topology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yvchan/streamsx.topology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yvchan/streamsx.topology/git/refs{/sha}","trees_url":"https://api.github.com/repos/yvchan/streamsx.topology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yvchan/streamsx.topology/statuses/{sha}","languages_url":"https://api.github.com/repos/yvchan/streamsx.topology/languages","stargazers_url":"https://api.github.com/repos/yvchan/streamsx.topology/stargazers","contributors_url":"https://api.github.com/repos/yvchan/streamsx.topology/contributors","subscribers_url":"https://api.github.com/repos/yvchan/streamsx.topology/subscribers","subscription_url":"https://api.github.com/repos/yvchan/streamsx.topology/subscription","commits_url":"https://api.github.com/repos/yvchan/streamsx.topology/commits{/sha}","git_commits_url":"https://api.github.com/repos/yvchan/streamsx.topology/git/commits{/sha}","comments_url":"https://api.github.com/repos/yvchan/streamsx.topology/comments{/number}","issue_comment_url":"https://api.github.com/repos/yvchan/streamsx.topology/issues/comments{/number}","contents_url":"https://api.github.com/repos/yvchan/streamsx.topology/contents/{+path}","compare_url":"https://api.github.com/repos/yvchan/streamsx.topology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yvchan/streamsx.topology/merges","archive_url":"https://api.github.com/repos/yvchan/streamsx.topology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yvchan/streamsx.topology/downloads","issues_url":"https://api.github.com/repos/yvchan/streamsx.topology/issues{/number}","pulls_url":"https://api.github.com/repos/yvchan/streamsx.topology/pulls{/number}","milestones_url":"https://api.github.com/repos/yvchan/streamsx.topology/milestones{/number}","notifications_url":"https://api.github.com/repos/yvchan/streamsx.topology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yvchan/streamsx.topology/labels{/name}","releases_url":"https://api.github.com/repos/yvchan/streamsx.topology/releases{/id}","deployments_url":"https://api.github.com/repos/yvchan/streamsx.topology/deployments","created_at":"2017-04-13T16:15:38Z","updated_at":"2017-04-13T16:15:40Z","pushed_at":"2017-05-02T22:02:33Z","git_url":"git://github.com/yvchan/streamsx.topology.git","ssh_url":"git@github.com:yvchan/streamsx.topology.git","clone_url":"https://github.com/yvchan/streamsx.topology.git","svn_url":"https://github.com/yvchan/streamsx.topology","homepage":"http://ibmstreams.github.io/streamsx.topology","size":10974,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"IBMStreams:java_rest_api","ref":"java_rest_api","sha":"ad161c0bf4d57ff4840dfc1183c70919eb584884","user":{"login":"IBMStreams","id":5439177,"avatar_url":"https://avatars2.githubusercontent.com/u/5439177?v=3","gravatar_id":"","url":"https://api.github.com/users/IBMStreams","html_url":"https://github.com/IBMStreams","followers_url":"https://api.github.com/users/IBMStreams/followers","following_url":"https://api.github.com/users/IBMStreams/following{/other_user}","gists_url":"https://api.github.com/users/IBMStreams/gists{/gist_id}","starred_url":"https://api.github.com/users/IBMStreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IBMStreams/subscriptions","organizations_url":"https://api.github.com/users/IBMStreams/orgs","repos_url":"https://api.github.com/users/IBMStreams/repos","events_url":"https://api.github.com/users/IBMStreams/events{/privacy}","received_events_url":"https://api.github.com/users/IBMStreams/received_events","type":"Organization","site_admin":false},"repo":{"id":36458001,"name":"streamsx.topology","full_name":"IBMStreams/streamsx.topology","owner":{"login":"IBMStreams","id":5439177,"avatar_url":"https://avatars2.githubusercontent.com/u/5439177?v=3","gravatar_id":"","url":"https://api.github.com/users/IBMStreams","html_url":"https://github.com/IBMStreams","followers_url":"https://api.github.com/users/IBMStreams/followers","following_url":"https://api.github.com/users/IBMStreams/following{/other_user}","gists_url":"https://api.github.com/users/IBMStreams/gists{/gist_id}","starred_url":"https://api.github.com/users/IBMStreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IBMStreams/subscriptions","organizations_url":"https://api.github.com/users/IBMStreams/orgs","repos_url":"https://api.github.com/users/IBMStreams/repos","events_url":"https://api.github.com/users/IBMStreams/events{/privacy}","received_events_url":"https://api.github.com/users/IBMStreams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/IBMStreams/streamsx.topology","description":"(Incubation) Develop streaming applications for IBM Streams in Python, Java & Scala.","fork":false,"url":"https://api.github.com/repos/IBMStreams/streamsx.topology","forks_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/forks","keys_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/teams","hooks_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/hooks","issue_events_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/events{/number}","events_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/events","assignees_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/assignees{/user}","branches_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/branches{/branch}","tags_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/tags","blobs_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/git/refs{/sha}","trees_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/statuses/{sha}","languages_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/languages","stargazers_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/stargazers","contributors_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/contributors","subscribers_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/subscribers","subscription_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/subscription","commits_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/commits{/sha}","git_commits_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/git/commits{/sha}","comments_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/comments{/number}","issue_comment_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/comments{/number}","contents_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/contents/{+path}","compare_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/merges","archive_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/downloads","issues_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues{/number}","pulls_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls{/number}","milestones_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/milestones{/number}","notifications_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/labels{/name}","releases_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/releases{/id}","deployments_url":"https://api.github.com/repos/IBMStreams/streamsx.topology/deployments","created_at":"2015-05-28T18:30:13Z","updated_at":"2017-04-07T18:01:55Z","pushed_at":"2017-05-03T16:08:29Z","git_url":"git://github.com/IBMStreams/streamsx.topology.git","ssh_url":"git@github.com:IBMStreams/streamsx.topology.git","clone_url":"https://github.com/IBMStreams/streamsx.topology.git","svn_url":"https://github.com/IBMStreams/streamsx.topology","homepage":"http://ibmstreams.github.io/streamsx.topology","size":11214,"stargazers_count":14,"watchers_count":14,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":31,"mirror_url":null,"open_issues_count":131,"forks":31,"open_issues":131,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004"},"html":{"href":"https://github.com/IBMStreams/streamsx.topology/pull/1004"},"issue":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/1004"},"comments":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/issues/1004/comments"},"review_comments":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004/comments"},"review_comment":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/pulls/1004/commits"},"statuses":{"href":"https://api.github.com/repos/IBMStreams/streamsx.topology/statuses/d631dde072c9297b7f860b20b1d6d5dd78b1ff93"}}}}
{"actor":{"display_login":"yvchan"}}