{"action":"created","comment":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/comments/38225505","id":38225505,"diff_hunk":"@@ -0,0 +1,227 @@\n+/*\n+ * opencog/persist/zmq/atomspace/ZMQPersistSCM.cc\n+ *\n+ * Copyright (c) 2008-2015 by OpenCog Foundation\n+ * Written by Hendy Irawan <ceefour666@gmail.com>\n+ * All Rights Reserved\n+ *\n+ * This program is free software; you can redistribute it and/or modify\n+ * it under the terms of the GNU Affero General Public License v3 as\n+ * published by the Free Software Foundation and including the exceptions\n+ * at http://opencog.org/wiki/Licenses\n+ *\n+ * This program 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 General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Affero General Public License\n+ * along with this program; if not, write to:\n+ * Free Software Foundation, Inc.,\n+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+ */\n+\n+#include <opencog/atomspace/AtomSpace.h>\n+#include <opencog/atomspace/BackingStore.h>\n+#include <opencog/guile/SchemePrimitive.h>\n+#include <opencog/persist/zmq/atomspace/ZMQClient.h>\n+\n+#include \"ZMQPersistSCM.h\"\n+\n+using namespace opencog;\n+\n+namespace opencog\n+{\n+/** \\addtogroup grp_persist\n+ *  @{\n+ */\n+\n+class ZMQBackingStore : public BackingStore\n+{\n+\tprivate:\n+\t\tZMQClient *_store;\n+\tpublic:\n+\t\tZMQBackingStore();\n+\t\tvoid set_store(ZMQClient *);\n+\n+\t\tvirtual NodePtr getNode(Type, const char *) const;\n+\t\tvirtual LinkPtr getLink(Type, const HandleSeq&) const;\n+\t\tvirtual AtomPtr getAtom(Handle) const;\n+\t\tvirtual HandleSeq getIncomingSet(Handle) const;\n+\t\tvirtual void storeAtom(Handle);\n+\t\tvirtual void loadType(AtomTable&, Type);\n+\t\tvirtual void barrier();\n+};\n+\n+/** @}*/\n+}  // namespace\n+\n+ZMQBackingStore::ZMQBackingStore()\n+{\n+\t_store = NULL;\n+}\n+\n+void ZMQBackingStore::set_store(ZMQClient *as)\n+{\n+\t_store = as;\n+}\n+\n+NodePtr ZMQBackingStore::getNode(Type t, const char *name) const\n+{\n+\treturn _store->getNode(t, name);\n+}\n+\n+LinkPtr ZMQBackingStore::getLink(Type t, const std::vector<Handle>& oset) const\n+{\n+\treturn _store->getLink(t, oset);\n+}\n+\n+AtomPtr ZMQBackingStore::getAtom(Handle h) const\n+{\n+\treturn _store->getAtom(h);\n+}\n+\n+HandleSeq ZMQBackingStore::getIncomingSet(Handle h) const\n+{\n+\treturn _store->getIncomingSet(h);\n+}\n+\n+void ZMQBackingStore::storeAtom(Handle h)\n+{\n+\t_store->storeAtom(h);\n+}\n+\n+void ZMQBackingStore::loadType(AtomTable& at, Type t)\n+{\n+\t_store->loadType(at, t);\n+}\n+\n+void ZMQBackingStore::barrier()\n+{\n+\t_store->flushStoreQueue();\n+}\n+\n+// ==================================================================\n+\n+ZMQPersistSCM::ZMQPersistSCM(AtomSpace *as)\n+{\n+\t_as = as;\n+\t_store = NULL;\n+\t_backing = new ZMQBackingStore();\n+\n+#ifdef HAVE_GUILE\n+\tstatic bool is_init = false;\n+\tif (is_init) return;\n+\tis_init = true;\n+\tscm_with_guile(init_in_guile, this);\n+#endif\n+}\n+\n+void* ZMQPersistSCM::init_in_guile(void* self)\n+{\n+#ifdef HAVE_GUILE\n+\tscm_c_define_module(\"opencog persist-zmq\", init_in_module, self);\n+\tscm_c_use_module(\"opencog persist-zmq\");\n+#endif\n+\treturn NULL;\n+}\n+\n+void ZMQPersistSCM::init_in_module(void* data)\n+{\n+   ZMQPersistSCM* self = (ZMQPersistSCM*) data;\n+   self->init();\n+}\n+\n+void ZMQPersistSCM::init(void)\n+{\n+#ifdef HAVE_GUILE\n+\tdefine_scheme_primitive(\"zmq-open\", &ZMQPersistSCM::do_open, this, \"persist-zmq\");\n+\tdefine_scheme_primitive(\"zmq-close\", &ZMQPersistSCM::do_close, this, \"persist-zmq\");\n+\tdefine_scheme_primitive(\"zmq-load\", &ZMQPersistSCM::do_load, this, \"persist-zmq\");\n+\tdefine_scheme_primitive(\"zmq-store\", &ZMQPersistSCM::do_store, this, \"persist-zmq\");\n+#endif\n+}\n+\n+ZMQPersistSCM::~ZMQPersistSCM()\n+{\n+\tdelete _backing;\n+}\n+\n+void ZMQPersistSCM::do_open(const std::string& networkAddress)\n+{\n+\t_store = new ZMQClient(networkAddress);","path":"opencog/persist/zmq/atomspace/ZMQPersistSCM.cc","position":152,"original_position":152,"commit_id":"34205f4750dce83bf62e6905d78810cca9f4c5a5","original_commit_id":"34205f4750dce83bf62e6905d78810cca9f4c5a5","user":{"login":"AmeBel","id":2135577,"avatar_url":"https://avatars.githubusercontent.com/u/2135577?v=3","gravatar_id":"","url":"https://api.github.com/users/AmeBel","html_url":"https://github.com/AmeBel","followers_url":"https://api.github.com/users/AmeBel/followers","following_url":"https://api.github.com/users/AmeBel/following{/other_user}","gists_url":"https://api.github.com/users/AmeBel/gists{/gist_id}","starred_url":"https://api.github.com/users/AmeBel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmeBel/subscriptions","organizations_url":"https://api.github.com/users/AmeBel/orgs","repos_url":"https://api.github.com/users/AmeBel/repos","events_url":"https://api.github.com/users/AmeBel/events{/privacy}","received_events_url":"https://api.github.com/users/AmeBel/received_events","type":"User","site_admin":false},"body":"It only added aurhentication recently. There is an option to disable it .\n\nOn Sat, 29 Aug 2015 1:29 am Linas Vepštas <notifications@github.com> wrote:\n\n> In opencog/persist/zmq/atomspace/ZMQPersistSCM.cc\n> <https://github.com/opencog/atomspace/pull/238#discussion_r38223454>:\n>\n> > +#ifdef HAVE_GUILE\n> > +\tdefine_scheme_primitive(\"zmq-open\", &ZMQPersistSCM::do_open, this, \"persist-zmq\");\n> > +\tdefine_scheme_primitive(\"zmq-close\", &ZMQPersistSCM::do_close, this, \"persist-zmq\");\n> > +\tdefine_scheme_primitive(\"zmq-load\", &ZMQPersistSCM::do_load, this, \"persist-zmq\");\n> > +\tdefine_scheme_primitive(\"zmq-store\", &ZMQPersistSCM::do_store, this, \"persist-zmq\");\n> > +#endif\n> > +}\n> > +\n> > +ZMQPersistSCM::~ZMQPersistSCM()\n> > +{\n> > +\tdelete _backing;\n> > +}\n> > +\n> > +void ZMQPersistSCM::do_open(const std::string& networkAddress)\n> > +{\n> > +\t_store = new ZMQClient(networkAddress);\n>\n> So Neo4J has no concept of security or authentication? Any user who can\n> get to a given port number on a given machine has full read-write access to\n> all data? That can't be right...\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/opencog/atomspace/pull/238/files#r38223454>.\n>\n","created_at":"2015-08-28T17:49:27Z","updated_at":"2015-08-28T17:49:27Z","html_url":"https://github.com/opencog/atomspace/pull/238#discussion_r38225505","pull_request_url":"https://api.github.com/repos/opencog/atomspace/pulls/238","_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments/38225505"},"html":{"href":"https://github.com/opencog/atomspace/pull/238#discussion_r38225505"},"pull_request":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/238"}}},"pull_request":{"url":"https://api.github.com/repos/opencog/atomspace/pulls/238","id":43256493,"html_url":"https://github.com/opencog/atomspace/pull/238","diff_url":"https://github.com/opencog/atomspace/pull/238.diff","patch_url":"https://github.com/opencog/atomspace/pull/238.patch","issue_url":"https://api.github.com/repos/opencog/atomspace/issues/238","number":238,"state":"closed","locked":false,"title":"Prepare inclusion of persist/zmq/atomspace structure","user":{"login":"ceefour","id":24123,"avatar_url":"https://avatars.githubusercontent.com/u/24123?v=3","gravatar_id":"","url":"https://api.github.com/users/ceefour","html_url":"https://github.com/ceefour","followers_url":"https://api.github.com/users/ceefour/followers","following_url":"https://api.github.com/users/ceefour/following{/other_user}","gists_url":"https://api.github.com/users/ceefour/gists{/gist_id}","starred_url":"https://api.github.com/users/ceefour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceefour/subscriptions","organizations_url":"https://api.github.com/users/ceefour/orgs","repos_url":"https://api.github.com/users/ceefour/repos","events_url":"https://api.github.com/users/ceefour/events{/privacy}","received_events_url":"https://api.github.com/users/ceefour/received_events","type":"User","site_admin":false},"body":"Prepare inclusion of persist/zmq/atomspace structure. While still work in progress, atomspace can still build with it. Hendy @ceefour will maintain.","created_at":"2015-08-25T07:16:42Z","updated_at":"2015-08-28T17:49:27Z","closed_at":"2015-08-27T14:59:24Z","merged_at":"2015-08-27T14:59:24Z","merge_commit_sha":"838b52bc77359c2543aa940092a2e060e90c0ab6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opencog/atomspace/pulls/238/commits","review_comments_url":"https://api.github.com/repos/opencog/atomspace/pulls/238/comments","review_comment_url":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opencog/atomspace/issues/238/comments","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/34205f4750dce83bf62e6905d78810cca9f4c5a5","head":{"label":"ceefour:patch-1","ref":"patch-1","sha":"34205f4750dce83bf62e6905d78810cca9f4c5a5","user":{"login":"ceefour","id":24123,"avatar_url":"https://avatars.githubusercontent.com/u/24123?v=3","gravatar_id":"","url":"https://api.github.com/users/ceefour","html_url":"https://github.com/ceefour","followers_url":"https://api.github.com/users/ceefour/followers","following_url":"https://api.github.com/users/ceefour/following{/other_user}","gists_url":"https://api.github.com/users/ceefour/gists{/gist_id}","starred_url":"https://api.github.com/users/ceefour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceefour/subscriptions","organizations_url":"https://api.github.com/users/ceefour/orgs","repos_url":"https://api.github.com/users/ceefour/repos","events_url":"https://api.github.com/users/ceefour/events{/privacy}","received_events_url":"https://api.github.com/users/ceefour/received_events","type":"User","site_admin":false},"repo":{"id":40753518,"name":"atomspace","full_name":"ceefour/atomspace","owner":{"login":"ceefour","id":24123,"avatar_url":"https://avatars.githubusercontent.com/u/24123?v=3","gravatar_id":"","url":"https://api.github.com/users/ceefour","html_url":"https://github.com/ceefour","followers_url":"https://api.github.com/users/ceefour/followers","following_url":"https://api.github.com/users/ceefour/following{/other_user}","gists_url":"https://api.github.com/users/ceefour/gists{/gist_id}","starred_url":"https://api.github.com/users/ceefour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceefour/subscriptions","organizations_url":"https://api.github.com/users/ceefour/orgs","repos_url":"https://api.github.com/users/ceefour/repos","events_url":"https://api.github.com/users/ceefour/events{/privacy}","received_events_url":"https://api.github.com/users/ceefour/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ceefour/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":true,"url":"https://api.github.com/repos/ceefour/atomspace","forks_url":"https://api.github.com/repos/ceefour/atomspace/forks","keys_url":"https://api.github.com/repos/ceefour/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceefour/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceefour/atomspace/teams","hooks_url":"https://api.github.com/repos/ceefour/atomspace/hooks","issue_events_url":"https://api.github.com/repos/ceefour/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/ceefour/atomspace/events","assignees_url":"https://api.github.com/repos/ceefour/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/ceefour/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/ceefour/atomspace/tags","blobs_url":"https://api.github.com/repos/ceefour/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceefour/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceefour/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceefour/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceefour/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/ceefour/atomspace/languages","stargazers_url":"https://api.github.com/repos/ceefour/atomspace/stargazers","contributors_url":"https://api.github.com/repos/ceefour/atomspace/contributors","subscribers_url":"https://api.github.com/repos/ceefour/atomspace/subscribers","subscription_url":"https://api.github.com/repos/ceefour/atomspace/subscription","commits_url":"https://api.github.com/repos/ceefour/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceefour/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceefour/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceefour/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceefour/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/ceefour/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceefour/atomspace/merges","archive_url":"https://api.github.com/repos/ceefour/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceefour/atomspace/downloads","issues_url":"https://api.github.com/repos/ceefour/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/ceefour/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/ceefour/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/ceefour/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceefour/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/ceefour/atomspace/releases{/id}","created_at":"2015-08-15T09:31:18Z","updated_at":"2015-08-15T09:31:21Z","pushed_at":"2015-08-28T10:36:19Z","git_url":"git://github.com/ceefour/atomspace.git","ssh_url":"git@github.com:ceefour/atomspace.git","clone_url":"https://github.com/ceefour/atomspace.git","svn_url":"https://github.com/ceefour/atomspace","homepage":"","size":140207,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"opencog:master","ref":"master","sha":"18530ff9f709bd10727df9b8a9f3d04719b2ec7a","user":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"repo":{"id":34678084,"name":"atomspace","full_name":"opencog/atomspace","owner":{"login":"opencog","id":2109913,"avatar_url":"https://avatars.githubusercontent.com/u/2109913?v=3","gravatar_id":"","url":"https://api.github.com/users/opencog","html_url":"https://github.com/opencog","followers_url":"https://api.github.com/users/opencog/followers","following_url":"https://api.github.com/users/opencog/following{/other_user}","gists_url":"https://api.github.com/users/opencog/gists{/gist_id}","starred_url":"https://api.github.com/users/opencog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opencog/subscriptions","organizations_url":"https://api.github.com/users/opencog/orgs","repos_url":"https://api.github.com/users/opencog/repos","events_url":"https://api.github.com/users/opencog/events{/privacy}","received_events_url":"https://api.github.com/users/opencog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opencog/atomspace","description":"The OpenCog hypergraph database and logic (reasoning) engine","fork":false,"url":"https://api.github.com/repos/opencog/atomspace","forks_url":"https://api.github.com/repos/opencog/atomspace/forks","keys_url":"https://api.github.com/repos/opencog/atomspace/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opencog/atomspace/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opencog/atomspace/teams","hooks_url":"https://api.github.com/repos/opencog/atomspace/hooks","issue_events_url":"https://api.github.com/repos/opencog/atomspace/issues/events{/number}","events_url":"https://api.github.com/repos/opencog/atomspace/events","assignees_url":"https://api.github.com/repos/opencog/atomspace/assignees{/user}","branches_url":"https://api.github.com/repos/opencog/atomspace/branches{/branch}","tags_url":"https://api.github.com/repos/opencog/atomspace/tags","blobs_url":"https://api.github.com/repos/opencog/atomspace/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opencog/atomspace/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opencog/atomspace/git/refs{/sha}","trees_url":"https://api.github.com/repos/opencog/atomspace/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opencog/atomspace/statuses/{sha}","languages_url":"https://api.github.com/repos/opencog/atomspace/languages","stargazers_url":"https://api.github.com/repos/opencog/atomspace/stargazers","contributors_url":"https://api.github.com/repos/opencog/atomspace/contributors","subscribers_url":"https://api.github.com/repos/opencog/atomspace/subscribers","subscription_url":"https://api.github.com/repos/opencog/atomspace/subscription","commits_url":"https://api.github.com/repos/opencog/atomspace/commits{/sha}","git_commits_url":"https://api.github.com/repos/opencog/atomspace/git/commits{/sha}","comments_url":"https://api.github.com/repos/opencog/atomspace/comments{/number}","issue_comment_url":"https://api.github.com/repos/opencog/atomspace/issues/comments{/number}","contents_url":"https://api.github.com/repos/opencog/atomspace/contents/{+path}","compare_url":"https://api.github.com/repos/opencog/atomspace/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opencog/atomspace/merges","archive_url":"https://api.github.com/repos/opencog/atomspace/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opencog/atomspace/downloads","issues_url":"https://api.github.com/repos/opencog/atomspace/issues{/number}","pulls_url":"https://api.github.com/repos/opencog/atomspace/pulls{/number}","milestones_url":"https://api.github.com/repos/opencog/atomspace/milestones{/number}","notifications_url":"https://api.github.com/repos/opencog/atomspace/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opencog/atomspace/labels{/name}","releases_url":"https://api.github.com/repos/opencog/atomspace/releases{/id}","created_at":"2015-04-27T16:32:57Z","updated_at":"2015-08-14T16:09:04Z","pushed_at":"2015-08-28T10:16:28Z","git_url":"git://github.com/opencog/atomspace.git","ssh_url":"git@github.com:opencog/atomspace.git","clone_url":"https://github.com/opencog/atomspace.git","svn_url":"https://github.com/opencog/atomspace","homepage":"","size":150961,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":33,"forks":27,"open_issues":33,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/238"},"html":{"href":"https://github.com/opencog/atomspace/pull/238"},"issue":{"href":"https://api.github.com/repos/opencog/atomspace/issues/238"},"comments":{"href":"https://api.github.com/repos/opencog/atomspace/issues/238/comments"},"review_comments":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/238/comments"},"review_comment":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opencog/atomspace/pulls/238/commits"},"statuses":{"href":"https://api.github.com/repos/opencog/atomspace/statuses/34205f4750dce83bf62e6905d78810cca9f4c5a5"}}}}