{"action":"created","comment":{"url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/comments/34344750","id":34344750,"diff_hunk":"@@ -24,29 +25,27 @@ public PersistentBindingRepository(MongoDatabase database) {\n   }\n \n   @Override\n-  public List<Binding> findAllBySubnetID(String id) {\n-    Document query = new Document()\n-            .append(\"_id\", new ObjectId(id));\n-    FindIterable<Document> documents = nets().find(query);\n-    return getAllBindings(documents);\n+  public void register(NewSubnet subnet, String id) {\n+    bindings().insertMany(bindings(subnet, id));\n   }\n-\n-  private List<Binding> getAllBindings(FindIterable<Document> documents) {\n-    List<Binding> bindings = new ArrayList<>();\n-    List<Document> documentList = new ArrayList<>();\n-    for (Document doc : documents) {\n-      documentList = (List<Document>) doc.get(\"bindings\");\n+  /**\n+   * Make a List of Documents with ip and an empty description for all the available IPs.\n+   *\n+   * @return\n+   */\n+  private List<Document> bindings(NewSubnet newSubnet, String id) {\n+    List<Document> documents = new ArrayList<>();","path":"subnets/src/main/java/com/clouway/subnets/persistence/PersistentBindingRepository.java","position":51,"original_position":51,"commit_id":"85ac403f8b3eaba56faa011b27b4d9ce611ab511","original_commit_id":"85ac403f8b3eaba56faa011b27b4d9ce611ab511","user":{"login":"StanislavValov","id":5948480,"avatar_url":"https://avatars.githubusercontent.com/u/5948480?v=3","gravatar_id":"","url":"https://api.github.com/users/StanislavValov","html_url":"https://github.com/StanislavValov","followers_url":"https://api.github.com/users/StanislavValov/followers","following_url":"https://api.github.com/users/StanislavValov/following{/other_user}","gists_url":"https://api.github.com/users/StanislavValov/gists{/gist_id}","starred_url":"https://api.github.com/users/StanislavValov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StanislavValov/subscriptions","organizations_url":"https://api.github.com/users/StanislavValov/orgs","repos_url":"https://api.github.com/users/StanislavValov/repos","events_url":"https://api.github.com/users/StanislavValov/events{/privacy}","received_events_url":"https://api.github.com/users/StanislavValov/received_events","type":"User","site_admin":false},"body":"use static impot of com.google.common.collect.Lists","created_at":"2015-07-10T10:49:16Z","updated_at":"2015-07-10T10:49:16Z","html_url":"https://github.com/clouway-incubator/subnet-management-system/pull/26#discussion_r34344750","pull_request_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/comments/34344750"},"html":{"href":"https://github.com/clouway-incubator/subnet-management-system/pull/26#discussion_r34344750"},"pull_request":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26","id":39168775,"html_url":"https://github.com/clouway-incubator/subnet-management-system/pull/26","diff_url":"https://github.com/clouway-incubator/subnet-management-system/pull/26.diff","patch_url":"https://github.com/clouway-incubator/subnet-management-system/pull/26.patch","issue_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/26","number":26,"state":"open","locked":false,"title":"add new subnet","user":{"login":"freekman","id":8199446,"avatar_url":"https://avatars.githubusercontent.com/u/8199446?v=3","gravatar_id":"","url":"https://api.github.com/users/freekman","html_url":"https://github.com/freekman","followers_url":"https://api.github.com/users/freekman/followers","following_url":"https://api.github.com/users/freekman/following{/other_user}","gists_url":"https://api.github.com/users/freekman/gists{/gist_id}","starred_url":"https://api.github.com/users/freekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekman/subscriptions","organizations_url":"https://api.github.com/users/freekman/orgs","repos_url":"https://api.github.com/users/freekman/repos","events_url":"https://api.github.com/users/freekman/events{/privacy}","received_events_url":"https://api.github.com/users/freekman/received_events","type":"User","site_admin":false},"body":"#23\r\n![screenshot from 2015-07-03 14 41 30](https://cloud.githubusercontent.com/assets/8199446/8498638/cb2942e8-2191-11e5-9216-4808f662f252.png)\r\n![screenshot from 2015-07-03 14 42 18](https://cloud.githubusercontent.com/assets/8199446/8498642/d13c2fd8-2191-11e5-9297-2f4b7ddc6823.png)\r\n![screenshot from 2015-07-03 14 42 30](https://cloud.githubusercontent.com/assets/8199446/8498643/d39aae76-2191-11e5-8e82-14fde227d048.png)\r\n\r\nThis is the functionality for registering a new subnet by IP and slash.\r\n","created_at":"2015-07-03T11:45:12Z","updated_at":"2015-07-10T10:49:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e069265c0b589b9e22dddec8e6e41c476fc8c7f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26/commits","review_comments_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26/comments","review_comment_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/comments{/number}","comments_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/26/comments","statuses_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/statuses/85ac403f8b3eaba56faa011b27b4d9ce611ab511","head":{"label":"freekman:ivan_genchev_new","ref":"ivan_genchev_new","sha":"85ac403f8b3eaba56faa011b27b4d9ce611ab511","user":{"login":"freekman","id":8199446,"avatar_url":"https://avatars.githubusercontent.com/u/8199446?v=3","gravatar_id":"","url":"https://api.github.com/users/freekman","html_url":"https://github.com/freekman","followers_url":"https://api.github.com/users/freekman/followers","following_url":"https://api.github.com/users/freekman/following{/other_user}","gists_url":"https://api.github.com/users/freekman/gists{/gist_id}","starred_url":"https://api.github.com/users/freekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekman/subscriptions","organizations_url":"https://api.github.com/users/freekman/orgs","repos_url":"https://api.github.com/users/freekman/repos","events_url":"https://api.github.com/users/freekman/events{/privacy}","received_events_url":"https://api.github.com/users/freekman/received_events","type":"User","site_admin":false},"repo":{"id":37461025,"name":"subnet-management-system","full_name":"freekman/subnet-management-system","owner":{"login":"freekman","id":8199446,"avatar_url":"https://avatars.githubusercontent.com/u/8199446?v=3","gravatar_id":"","url":"https://api.github.com/users/freekman","html_url":"https://github.com/freekman","followers_url":"https://api.github.com/users/freekman/followers","following_url":"https://api.github.com/users/freekman/following{/other_user}","gists_url":"https://api.github.com/users/freekman/gists{/gist_id}","starred_url":"https://api.github.com/users/freekman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freekman/subscriptions","organizations_url":"https://api.github.com/users/freekman/orgs","repos_url":"https://api.github.com/users/freekman/repos","events_url":"https://api.github.com/users/freekman/events{/privacy}","received_events_url":"https://api.github.com/users/freekman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/freekman/subnet-management-system","description":"Manage subnets","fork":true,"url":"https://api.github.com/repos/freekman/subnet-management-system","forks_url":"https://api.github.com/repos/freekman/subnet-management-system/forks","keys_url":"https://api.github.com/repos/freekman/subnet-management-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/freekman/subnet-management-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/freekman/subnet-management-system/teams","hooks_url":"https://api.github.com/repos/freekman/subnet-management-system/hooks","issue_events_url":"https://api.github.com/repos/freekman/subnet-management-system/issues/events{/number}","events_url":"https://api.github.com/repos/freekman/subnet-management-system/events","assignees_url":"https://api.github.com/repos/freekman/subnet-management-system/assignees{/user}","branches_url":"https://api.github.com/repos/freekman/subnet-management-system/branches{/branch}","tags_url":"https://api.github.com/repos/freekman/subnet-management-system/tags","blobs_url":"https://api.github.com/repos/freekman/subnet-management-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/freekman/subnet-management-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/freekman/subnet-management-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/freekman/subnet-management-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/freekman/subnet-management-system/statuses/{sha}","languages_url":"https://api.github.com/repos/freekman/subnet-management-system/languages","stargazers_url":"https://api.github.com/repos/freekman/subnet-management-system/stargazers","contributors_url":"https://api.github.com/repos/freekman/subnet-management-system/contributors","subscribers_url":"https://api.github.com/repos/freekman/subnet-management-system/subscribers","subscription_url":"https://api.github.com/repos/freekman/subnet-management-system/subscription","commits_url":"https://api.github.com/repos/freekman/subnet-management-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/freekman/subnet-management-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/freekman/subnet-management-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/freekman/subnet-management-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/freekman/subnet-management-system/contents/{+path}","compare_url":"https://api.github.com/repos/freekman/subnet-management-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/freekman/subnet-management-system/merges","archive_url":"https://api.github.com/repos/freekman/subnet-management-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/freekman/subnet-management-system/downloads","issues_url":"https://api.github.com/repos/freekman/subnet-management-system/issues{/number}","pulls_url":"https://api.github.com/repos/freekman/subnet-management-system/pulls{/number}","milestones_url":"https://api.github.com/repos/freekman/subnet-management-system/milestones{/number}","notifications_url":"https://api.github.com/repos/freekman/subnet-management-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/freekman/subnet-management-system/labels{/name}","releases_url":"https://api.github.com/repos/freekman/subnet-management-system/releases{/id}","created_at":"2015-06-15T11:28:05Z","updated_at":"2015-06-15T11:28:05Z","pushed_at":"2015-07-10T07:01:11Z","git_url":"git://github.com/freekman/subnet-management-system.git","ssh_url":"git@github.com:freekman/subnet-management-system.git","clone_url":"https://github.com/freekman/subnet-management-system.git","svn_url":"https://github.com/freekman/subnet-management-system","homepage":null,"size":3878,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"clouway-incubator:master","ref":"master","sha":"1c9a4047cb91cbcee0e7d7b300f2c5ac6fa6ee1c","user":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":37449766,"name":"subnet-management-system","full_name":"clouway-incubator/subnet-management-system","owner":{"login":"clouway-incubator","id":10173098,"avatar_url":"https://avatars.githubusercontent.com/u/10173098?v=3","gravatar_id":"","url":"https://api.github.com/users/clouway-incubator","html_url":"https://github.com/clouway-incubator","followers_url":"https://api.github.com/users/clouway-incubator/followers","following_url":"https://api.github.com/users/clouway-incubator/following{/other_user}","gists_url":"https://api.github.com/users/clouway-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/clouway-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clouway-incubator/subscriptions","organizations_url":"https://api.github.com/users/clouway-incubator/orgs","repos_url":"https://api.github.com/users/clouway-incubator/repos","events_url":"https://api.github.com/users/clouway-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/clouway-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/clouway-incubator/subnet-management-system","description":"Manage subnets","fork":false,"url":"https://api.github.com/repos/clouway-incubator/subnet-management-system","forks_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/forks","keys_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/teams","hooks_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/hooks","issue_events_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/events{/number}","events_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/events","assignees_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/assignees{/user}","branches_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/branches{/branch}","tags_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/tags","blobs_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/git/refs{/sha}","trees_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/statuses/{sha}","languages_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/languages","stargazers_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/stargazers","contributors_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/contributors","subscribers_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/subscribers","subscription_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/subscription","commits_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/commits{/sha}","git_commits_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/git/commits{/sha}","comments_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/comments{/number}","issue_comment_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/comments{/number}","contents_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/contents/{+path}","compare_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/merges","archive_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/downloads","issues_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues{/number}","pulls_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls{/number}","milestones_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/milestones{/number}","notifications_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/labels{/name}","releases_url":"https://api.github.com/repos/clouway-incubator/subnet-management-system/releases{/id}","created_at":"2015-06-15T07:19:44Z","updated_at":"2015-06-15T10:25:17Z","pushed_at":"2015-07-10T10:13:42Z","git_url":"git://github.com/clouway-incubator/subnet-management-system.git","ssh_url":"git@github.com:clouway-incubator/subnet-management-system.git","clone_url":"https://github.com/clouway-incubator/subnet-management-system.git","svn_url":"https://github.com/clouway-incubator/subnet-management-system","homepage":null,"size":2619,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":8,"forks":2,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26"},"html":{"href":"https://github.com/clouway-incubator/subnet-management-system/pull/26"},"issue":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/26"},"comments":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/clouway-incubator/subnet-management-system/statuses/85ac403f8b3eaba56faa011b27b4d9ce611ab511"}}}}