{"action":"created","comment":{"url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/comments/87339123","pull_request_review_id":7954955,"id":87339123,"diff_hunk":"@@ -0,0 +1,167 @@\n+package com.rbmhtechnology.eventuate.sandbox\n+\n+import java.util.concurrent.atomic.AtomicReference\n+import java.util.function.UnaryOperator\n+\n+import akka.actor._\n+import akka.pattern.{ask, pipe}\n+\n+import com.rbmhtechnology.eventuate.sandbox.ReplicationFilter.NoFilter\n+import com.rbmhtechnology.eventuate.sandbox.ReplicationProtocol._\n+import com.typesafe.config._\n+\n+import scala.collection.immutable.Seq\n+import scala.concurrent.Future\n+\n+object ReplicationEndpoint {\n+  def logId(endpointId: String, logName: String): String =\n+    s\"${endpointId}_$logName\"\n+}\n+\n+class ReplicationEndpoint(\n+  val id: String,\n+  logNames: Set[String],\n+  targetFilters: Map[String, ReplicationFilter],\n+  sourceFilters: Map[String, ReplicationFilter],\n+  config: Config = ConfigFactory.empty()) {\n+\n+  import ReplicationEndpoint._\n+\n+  private val _connections: AtomicReference[Map[String, Set[ActorRef]]] =\n+    new AtomicReference(Map.empty)\n+\n+  val system: ActorSystem =\n+    ActorSystem(s\"$id-system\", config)\n+\n+  val settings: ReplicationSettings =\n+    new ReplicationSettings(system.settings.config)\n+\n+  val eventLogs: Map[String, ActorRef] =\n+    logNames.foldLeft(Map.empty[String, ActorRef]) {\n+      case (logs, logName) => logs + (logName -> createEventLog(logName))\n+    }\n+\n+  val connectionAcceptor: ActorRef =\n+    createConnectionAcceptor()\n+\n+  import system.dispatcher\n+\n+  def connections: Set[String] =\n+    _connections.get.keySet\n+\n+  def connect(remoteEndpoint: ReplicationEndpoint): Future[String] =\n+    connect(remoteEndpoint.connectionAcceptor)\n+\n+  def connect(remoteAcceptor: ActorRef): Future[String] =","path":"src/main/scala/com/rbmhtechnology/eventuate/sandbox/ReplicationEndpoint.scala","position":55,"original_position":55,"commit_id":"09efac7f209571252c6f6e58ff41ac1108af66a0","original_commit_id":"09efac7f209571252c6f6e58ff41ac1108af66a0","user":{"login":"krasserm","id":202907,"avatar_url":"https://avatars.githubusercontent.com/u/202907?v=3","gravatar_id":"","url":"https://api.github.com/users/krasserm","html_url":"https://github.com/krasserm","followers_url":"https://api.github.com/users/krasserm/followers","following_url":"https://api.github.com/users/krasserm/following{/other_user}","gists_url":"https://api.github.com/users/krasserm/gists{/gist_id}","starred_url":"https://api.github.com/users/krasserm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasserm/subscriptions","organizations_url":"https://api.github.com/users/krasserm/orgs","repos_url":"https://api.github.com/users/krasserm/repos","events_url":"https://api.github.com/users/krasserm/events{/privacy}","received_events_url":"https://api.github.com/users/krasserm/received_events","type":"User","site_admin":false},"body":"Yes","created_at":"2016-11-10T07:14:58Z","updated_at":"2016-11-10T07:14:58Z","html_url":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1#discussion_r87339123","pull_request_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/comments/87339123"},"html":{"href":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1#discussion_r87339123"},"pull_request":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1","id":92952898,"html_url":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1","diff_url":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1.diff","patch_url":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1.patch","issue_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/1","number":1,"state":"open","locked":false,"title":"Basic features","user":{"login":"krasserm","id":202907,"avatar_url":"https://avatars.githubusercontent.com/u/202907?v=3","gravatar_id":"","url":"https://api.github.com/users/krasserm","html_url":"https://github.com/krasserm","followers_url":"https://api.github.com/users/krasserm/followers","following_url":"https://api.github.com/users/krasserm/following{/other_user}","gists_url":"https://api.github.com/users/krasserm/gists{/gist_id}","starred_url":"https://api.github.com/users/krasserm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasserm/subscriptions","organizations_url":"https://api.github.com/users/krasserm/orgs","repos_url":"https://api.github.com/users/krasserm/repos","events_url":"https://api.github.com/users/krasserm/events{/privacy}","received_events_url":"https://api.github.com/users/krasserm/received_events","type":"User","site_admin":false},"body":"- encoded events\r\n- decoded events\r\n- event metadata\r\n- event replication\r\n- event log","created_at":"2016-11-09T12:13:42Z","updated_at":"2016-11-10T07:14:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"00e8d1169d2a8e16607e19538cb25546bbfa7b0b","assignee":{"login":"krasserm","id":202907,"avatar_url":"https://avatars.githubusercontent.com/u/202907?v=3","gravatar_id":"","url":"https://api.github.com/users/krasserm","html_url":"https://github.com/krasserm","followers_url":"https://api.github.com/users/krasserm/followers","following_url":"https://api.github.com/users/krasserm/following{/other_user}","gists_url":"https://api.github.com/users/krasserm/gists{/gist_id}","starred_url":"https://api.github.com/users/krasserm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasserm/subscriptions","organizations_url":"https://api.github.com/users/krasserm/orgs","repos_url":"https://api.github.com/users/krasserm/repos","events_url":"https://api.github.com/users/krasserm/events{/privacy}","received_events_url":"https://api.github.com/users/krasserm/received_events","type":"User","site_admin":false},"assignees":[{"login":"krasserm","id":202907,"avatar_url":"https://avatars.githubusercontent.com/u/202907?v=3","gravatar_id":"","url":"https://api.github.com/users/krasserm","html_url":"https://github.com/krasserm","followers_url":"https://api.github.com/users/krasserm/followers","following_url":"https://api.github.com/users/krasserm/following{/other_user}","gists_url":"https://api.github.com/users/krasserm/gists{/gist_id}","starred_url":"https://api.github.com/users/krasserm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krasserm/subscriptions","organizations_url":"https://api.github.com/users/krasserm/orgs","repos_url":"https://api.github.com/users/krasserm/repos","events_url":"https://api.github.com/users/krasserm/events{/privacy}","received_events_url":"https://api.github.com/users/krasserm/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1/commits","review_comments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1/comments","review_comment_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/1/comments","statuses_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/statuses/09efac7f209571252c6f6e58ff41ac1108af66a0","head":{"label":"RBMHTechnology:wip-basic-features","ref":"wip-basic-features","sha":"09efac7f209571252c6f6e58ff41ac1108af66a0","user":{"login":"RBMHTechnology","id":10194147,"avatar_url":"https://avatars.githubusercontent.com/u/10194147?v=3","gravatar_id":"","url":"https://api.github.com/users/RBMHTechnology","html_url":"https://github.com/RBMHTechnology","followers_url":"https://api.github.com/users/RBMHTechnology/followers","following_url":"https://api.github.com/users/RBMHTechnology/following{/other_user}","gists_url":"https://api.github.com/users/RBMHTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/RBMHTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RBMHTechnology/subscriptions","organizations_url":"https://api.github.com/users/RBMHTechnology/orgs","repos_url":"https://api.github.com/users/RBMHTechnology/repos","events_url":"https://api.github.com/users/RBMHTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/RBMHTechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":73076823,"name":"eventuate-sandbox","full_name":"RBMHTechnology/eventuate-sandbox","owner":{"login":"RBMHTechnology","id":10194147,"avatar_url":"https://avatars.githubusercontent.com/u/10194147?v=3","gravatar_id":"","url":"https://api.github.com/users/RBMHTechnology","html_url":"https://github.com/RBMHTechnology","followers_url":"https://api.github.com/users/RBMHTechnology/followers","following_url":"https://api.github.com/users/RBMHTechnology/following{/other_user}","gists_url":"https://api.github.com/users/RBMHTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/RBMHTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RBMHTechnology/subscriptions","organizations_url":"https://api.github.com/users/RBMHTechnology/orgs","repos_url":"https://api.github.com/users/RBMHTechnology/repos","events_url":"https://api.github.com/users/RBMHTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/RBMHTechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RBMHTechnology/eventuate-sandbox","description":"Prototyping of new ideas and concepts for Eventuate","fork":false,"url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox","forks_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/forks","keys_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/teams","hooks_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/hooks","issue_events_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/events{/number}","events_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/events","assignees_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/assignees{/user}","branches_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/branches{/branch}","tags_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/tags","blobs_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/statuses/{sha}","languages_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/languages","stargazers_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/stargazers","contributors_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/contributors","subscribers_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/subscribers","subscription_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/subscription","commits_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/contents/{+path}","compare_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/merges","archive_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/downloads","issues_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues{/number}","pulls_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls{/number}","milestones_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/milestones{/number}","notifications_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/labels{/name}","releases_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/releases{/id}","deployments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/deployments","created_at":"2016-11-07T12:36:22Z","updated_at":"2016-11-08T10:47:35Z","pushed_at":"2016-11-09T12:13:42Z","git_url":"git://github.com/RBMHTechnology/eventuate-sandbox.git","ssh_url":"git@github.com:RBMHTechnology/eventuate-sandbox.git","clone_url":"https://github.com/RBMHTechnology/eventuate-sandbox.git","svn_url":"https://github.com/RBMHTechnology/eventuate-sandbox","homepage":"","size":13,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"RBMHTechnology:master","ref":"master","sha":"f4322a667480763e1968a25824c6f5d1d85c9667","user":{"login":"RBMHTechnology","id":10194147,"avatar_url":"https://avatars.githubusercontent.com/u/10194147?v=3","gravatar_id":"","url":"https://api.github.com/users/RBMHTechnology","html_url":"https://github.com/RBMHTechnology","followers_url":"https://api.github.com/users/RBMHTechnology/followers","following_url":"https://api.github.com/users/RBMHTechnology/following{/other_user}","gists_url":"https://api.github.com/users/RBMHTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/RBMHTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RBMHTechnology/subscriptions","organizations_url":"https://api.github.com/users/RBMHTechnology/orgs","repos_url":"https://api.github.com/users/RBMHTechnology/repos","events_url":"https://api.github.com/users/RBMHTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/RBMHTechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":73076823,"name":"eventuate-sandbox","full_name":"RBMHTechnology/eventuate-sandbox","owner":{"login":"RBMHTechnology","id":10194147,"avatar_url":"https://avatars.githubusercontent.com/u/10194147?v=3","gravatar_id":"","url":"https://api.github.com/users/RBMHTechnology","html_url":"https://github.com/RBMHTechnology","followers_url":"https://api.github.com/users/RBMHTechnology/followers","following_url":"https://api.github.com/users/RBMHTechnology/following{/other_user}","gists_url":"https://api.github.com/users/RBMHTechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/RBMHTechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RBMHTechnology/subscriptions","organizations_url":"https://api.github.com/users/RBMHTechnology/orgs","repos_url":"https://api.github.com/users/RBMHTechnology/repos","events_url":"https://api.github.com/users/RBMHTechnology/events{/privacy}","received_events_url":"https://api.github.com/users/RBMHTechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RBMHTechnology/eventuate-sandbox","description":"Prototyping of new ideas and concepts for Eventuate","fork":false,"url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox","forks_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/forks","keys_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/teams","hooks_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/hooks","issue_events_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/events{/number}","events_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/events","assignees_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/assignees{/user}","branches_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/branches{/branch}","tags_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/tags","blobs_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/refs{/sha}","trees_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/statuses/{sha}","languages_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/languages","stargazers_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/stargazers","contributors_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/contributors","subscribers_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/subscribers","subscription_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/subscription","commits_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/commits{/sha}","git_commits_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/git/commits{/sha}","comments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/comments{/number}","issue_comment_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/comments{/number}","contents_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/contents/{+path}","compare_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/merges","archive_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/downloads","issues_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues{/number}","pulls_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls{/number}","milestones_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/milestones{/number}","notifications_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/labels{/name}","releases_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/releases{/id}","deployments_url":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/deployments","created_at":"2016-11-07T12:36:22Z","updated_at":"2016-11-08T10:47:35Z","pushed_at":"2016-11-09T12:13:42Z","git_url":"git://github.com/RBMHTechnology/eventuate-sandbox.git","ssh_url":"git@github.com:RBMHTechnology/eventuate-sandbox.git","clone_url":"https://github.com/RBMHTechnology/eventuate-sandbox.git","svn_url":"https://github.com/RBMHTechnology/eventuate-sandbox","homepage":"","size":13,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1"},"html":{"href":"https://github.com/RBMHTechnology/eventuate-sandbox/pull/1"},"issue":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/1"},"comments":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/RBMHTechnology/eventuate-sandbox/statuses/09efac7f209571252c6f6e58ff41ac1108af66a0"}}}}
{"actor":{"display_login":"krasserm"}}