{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments/56749419","id":56749419,"diff_hunk":"@@ -0,0 +1,66 @@\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\");\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+package org.wso2.carbon.connector;\n+\n+import org.apache.abdera.factory.Factory;\n+import org.apache.abdera.model.Entry;\n+import org.apache.abdera.protocol.client.AbderaClient;\n+import org.apache.abdera.protocol.client.ClientResponse;\n+import org.apache.abdera.protocol.client.RequestOptions;\n+import org.apache.commons.lang.StringUtils;\n+import org.apache.synapse.MessageContext;\n+import org.wso2.carbon.connector.core.AbstractConnector;\n+import org.wso2.carbon.connector.core.ConnectException;\n+\n+import java.util.Date;\n+\n+/**\n+ * Create the Feeds\n+ */\n+public class FeedCreation extends AbstractConnector {\n+\n+    public void connect(MessageContext messageContext) throws ConnectException {\n+        String hostAddress = (String) getParameter(messageContext, FeedConstant.HOST_ADDRESS);\n+        String title = (String) getParameter(messageContext, FeedConstant.TITLE);\n+        String content = (String) getParameter(messageContext, FeedConstant.CONTENT);\n+        String author = (String) getParameter(messageContext, FeedConstant.AUTHOR);\n+        String feedID = (String) getParameter(messageContext, FeedConstant.FEED_ID);\n+\n+        if (StringUtils.isEmpty(hostAddress)) {\n+            handleException(\"host address can not be null or empty\", messageContext);\n+        }\n+\n+        AbderaClient abderaClient = FeedUtil.getAbderaClient();\n+        Factory factory = FeedUtil.getFactory();\n+        Entry entry = factory.newEntry();\n+        entry.setId(feedID);\n+        entry.setTitle(title);\n+        entry.setUpdated(new Date());\n+        entry.addAuthor(author);\n+        entry.setContent(content);\n+\n+        RequestOptions opts = new RequestOptions();\n+        opts.setContentType(FeedConstant.CONTENT_TYPE);\n+        FeedUtil response = new FeedUtil();\n+        ClientResponse resp;\n+        try {\n+            resp = abderaClient.post(hostAddress, entry, opts);\n+            response.InjectMessage(messageContext, resp.getStatusText());\n+        } catch (Exception ex) {\n+            handleException(\"error while connect \", ex, messageContext);","path":"feed/feed-connector/feed-connector-1.0.0/org.wso2.carbon.connector/src/main/java/org/wso2/carbon/connector/FeedCreation.java","position":63,"original_position":63,"commit_id":"9d18b5e6a1313c09e0b331b7004d476023868128","original_commit_id":"9d18b5e6a1313c09e0b331b7004d476023868128","user":{"login":"hmrajas","id":1703634,"avatar_url":"https://avatars.githubusercontent.com/u/1703634?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrajas","html_url":"https://github.com/hmrajas","followers_url":"https://api.github.com/users/hmrajas/followers","following_url":"https://api.github.com/users/hmrajas/following{/other_user}","gists_url":"https://api.github.com/users/hmrajas/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrajas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrajas/subscriptions","organizations_url":"https://api.github.com/users/hmrajas/orgs","repos_url":"https://api.github.com/users/hmrajas/repos","events_url":"https://api.github.com/users/hmrajas/events{/privacy}","received_events_url":"https://api.github.com/users/hmrajas/received_events","type":"User","site_admin":false},"body":"Fixed in https://github.com/wso2/esb-connectors/pull/551","created_at":"2016-03-19T13:55:35Z","updated_at":"2016-03-19T13:55:35Z","html_url":"https://github.com/wso2/esb-connectors/pull/433#discussion_r56749419","pull_request_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/433","_links":{"self":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments/56749419"},"html":{"href":"https://github.com/wso2/esb-connectors/pull/433#discussion_r56749419"},"pull_request":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/433"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/esb-connectors/pulls/433","id":52374928,"html_url":"https://github.com/wso2/esb-connectors/pull/433","diff_url":"https://github.com/wso2/esb-connectors/pull/433.diff","patch_url":"https://github.com/wso2/esb-connectors/pull/433.patch","issue_url":"https://api.github.com/repos/wso2/esb-connectors/issues/433","number":433,"state":"closed","locked":false,"title":"Feed connector","user":{"login":"hmrajas","id":1703634,"avatar_url":"https://avatars.githubusercontent.com/u/1703634?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrajas","html_url":"https://github.com/hmrajas","followers_url":"https://api.github.com/users/hmrajas/followers","following_url":"https://api.github.com/users/hmrajas/following{/other_user}","gists_url":"https://api.github.com/users/hmrajas/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrajas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrajas/subscriptions","organizations_url":"https://api.github.com/users/hmrajas/orgs","repos_url":"https://api.github.com/users/hmrajas/repos","events_url":"https://api.github.com/users/hmrajas/events{/privacy}","received_events_url":"https://api.github.com/users/hmrajas/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-02T10:03:55Z","updated_at":"2016-03-19T13:55:35Z","closed_at":"2015-12-03T11:43:56Z","merged_at":"2015-12-03T11:43:56Z","merge_commit_sha":"02b2cc4e4b542cb6aa06b3fdaf31b52b6ab627dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/433/commits","review_comments_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/433/comments","review_comment_url":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/esb-connectors/issues/433/comments","statuses_url":"https://api.github.com/repos/wso2/esb-connectors/statuses/9d18b5e6a1313c09e0b331b7004d476023868128","head":{"label":"hmrajas:FeedConnector","ref":"FeedConnector","sha":"9d18b5e6a1313c09e0b331b7004d476023868128","user":{"login":"hmrajas","id":1703634,"avatar_url":"https://avatars.githubusercontent.com/u/1703634?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrajas","html_url":"https://github.com/hmrajas","followers_url":"https://api.github.com/users/hmrajas/followers","following_url":"https://api.github.com/users/hmrajas/following{/other_user}","gists_url":"https://api.github.com/users/hmrajas/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrajas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrajas/subscriptions","organizations_url":"https://api.github.com/users/hmrajas/orgs","repos_url":"https://api.github.com/users/hmrajas/repos","events_url":"https://api.github.com/users/hmrajas/events{/privacy}","received_events_url":"https://api.github.com/users/hmrajas/received_events","type":"User","site_admin":false},"repo":{"id":47239016,"name":"esb-connectors","full_name":"hmrajas/esb-connectors","owner":{"login":"hmrajas","id":1703634,"avatar_url":"https://avatars.githubusercontent.com/u/1703634?v=3","gravatar_id":"","url":"https://api.github.com/users/hmrajas","html_url":"https://github.com/hmrajas","followers_url":"https://api.github.com/users/hmrajas/followers","following_url":"https://api.github.com/users/hmrajas/following{/other_user}","gists_url":"https://api.github.com/users/hmrajas/gists{/gist_id}","starred_url":"https://api.github.com/users/hmrajas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmrajas/subscriptions","organizations_url":"https://api.github.com/users/hmrajas/orgs","repos_url":"https://api.github.com/users/hmrajas/repos","events_url":"https://api.github.com/users/hmrajas/events{/privacy}","received_events_url":"https://api.github.com/users/hmrajas/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hmrajas/esb-connectors","description":"","fork":true,"url":"https://api.github.com/repos/hmrajas/esb-connectors","forks_url":"https://api.github.com/repos/hmrajas/esb-connectors/forks","keys_url":"https://api.github.com/repos/hmrajas/esb-connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hmrajas/esb-connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hmrajas/esb-connectors/teams","hooks_url":"https://api.github.com/repos/hmrajas/esb-connectors/hooks","issue_events_url":"https://api.github.com/repos/hmrajas/esb-connectors/issues/events{/number}","events_url":"https://api.github.com/repos/hmrajas/esb-connectors/events","assignees_url":"https://api.github.com/repos/hmrajas/esb-connectors/assignees{/user}","branches_url":"https://api.github.com/repos/hmrajas/esb-connectors/branches{/branch}","tags_url":"https://api.github.com/repos/hmrajas/esb-connectors/tags","blobs_url":"https://api.github.com/repos/hmrajas/esb-connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hmrajas/esb-connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hmrajas/esb-connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/hmrajas/esb-connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hmrajas/esb-connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/hmrajas/esb-connectors/languages","stargazers_url":"https://api.github.com/repos/hmrajas/esb-connectors/stargazers","contributors_url":"https://api.github.com/repos/hmrajas/esb-connectors/contributors","subscribers_url":"https://api.github.com/repos/hmrajas/esb-connectors/subscribers","subscription_url":"https://api.github.com/repos/hmrajas/esb-connectors/subscription","commits_url":"https://api.github.com/repos/hmrajas/esb-connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/hmrajas/esb-connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/hmrajas/esb-connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/hmrajas/esb-connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/hmrajas/esb-connectors/contents/{+path}","compare_url":"https://api.github.com/repos/hmrajas/esb-connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hmrajas/esb-connectors/merges","archive_url":"https://api.github.com/repos/hmrajas/esb-connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hmrajas/esb-connectors/downloads","issues_url":"https://api.github.com/repos/hmrajas/esb-connectors/issues{/number}","pulls_url":"https://api.github.com/repos/hmrajas/esb-connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/hmrajas/esb-connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/hmrajas/esb-connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hmrajas/esb-connectors/labels{/name}","releases_url":"https://api.github.com/repos/hmrajas/esb-connectors/releases{/id}","deployments_url":"https://api.github.com/repos/hmrajas/esb-connectors/deployments","created_at":"2015-12-02T05:24:25Z","updated_at":"2016-03-17T12:07:51Z","pushed_at":"2016-03-19T13:54:38Z","git_url":"git://github.com/hmrajas/esb-connectors.git","ssh_url":"git@github.com:hmrajas/esb-connectors.git","clone_url":"https://github.com/hmrajas/esb-connectors.git","svn_url":"https://github.com/hmrajas/esb-connectors","homepage":null,"size":181773,"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":"5ae0de4f547c4bede5ac65edc19a64db7d56d3e6","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":14882706,"name":"esb-connectors","full_name":"wso2/esb-connectors","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/esb-connectors","description":"WSO2 Enterprise Service Bus Connectors","fork":false,"url":"https://api.github.com/repos/wso2/esb-connectors","forks_url":"https://api.github.com/repos/wso2/esb-connectors/forks","keys_url":"https://api.github.com/repos/wso2/esb-connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/esb-connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/esb-connectors/teams","hooks_url":"https://api.github.com/repos/wso2/esb-connectors/hooks","issue_events_url":"https://api.github.com/repos/wso2/esb-connectors/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/esb-connectors/events","assignees_url":"https://api.github.com/repos/wso2/esb-connectors/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/esb-connectors/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/esb-connectors/tags","blobs_url":"https://api.github.com/repos/wso2/esb-connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/esb-connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/esb-connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/esb-connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/esb-connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/esb-connectors/languages","stargazers_url":"https://api.github.com/repos/wso2/esb-connectors/stargazers","contributors_url":"https://api.github.com/repos/wso2/esb-connectors/contributors","subscribers_url":"https://api.github.com/repos/wso2/esb-connectors/subscribers","subscription_url":"https://api.github.com/repos/wso2/esb-connectors/subscription","commits_url":"https://api.github.com/repos/wso2/esb-connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/esb-connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/esb-connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/esb-connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/esb-connectors/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/esb-connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/esb-connectors/merges","archive_url":"https://api.github.com/repos/wso2/esb-connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/esb-connectors/downloads","issues_url":"https://api.github.com/repos/wso2/esb-connectors/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/esb-connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/esb-connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/esb-connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/esb-connectors/labels{/name}","releases_url":"https://api.github.com/repos/wso2/esb-connectors/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/esb-connectors/deployments","created_at":"2013-12-03T03:43:53Z","updated_at":"2016-03-18T03:21:42Z","pushed_at":"2016-03-19T13:55:06Z","git_url":"git://github.com/wso2/esb-connectors.git","ssh_url":"git@github.com:wso2/esb-connectors.git","clone_url":"https://github.com/wso2/esb-connectors.git","svn_url":"https://github.com/wso2/esb-connectors","homepage":"https://github.com/wso2/esb-connectors","size":302633,"stargazers_count":25,"watchers_count":25,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":195,"mirror_url":null,"open_issues_count":36,"forks":195,"open_issues":36,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/433"},"html":{"href":"https://github.com/wso2/esb-connectors/pull/433"},"issue":{"href":"https://api.github.com/repos/wso2/esb-connectors/issues/433"},"comments":{"href":"https://api.github.com/repos/wso2/esb-connectors/issues/433/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/433/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/esb-connectors/pulls/433/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/esb-connectors/statuses/9d18b5e6a1313c09e0b331b7004d476023868128"}}}}