{"action":"created","comment":{"url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/28158180","id":28158180,"diff_hunk":"@@ -15,40 +15,149 @@\n import javax.annotation.Nullable;\n \n import org.sonatype.nexus.common.collect.NestedAttributesMap;\n+import org.sonatype.nexus.common.entity.Entity;\n+import org.sonatype.nexus.common.entity.EntityId;\n \n import org.joda.time.DateTime;\n \n+import static com.google.common.base.Preconditions.checkState;\n+import static org.sonatype.nexus.repository.storage.StorageFacet.P_ATTRIBUTES;\n+import static org.sonatype.nexus.repository.storage.StorageFacet.P_BUCKET;\n+import static org.sonatype.nexus.repository.storage.StorageFacet.P_FORMAT;\n+import static org.sonatype.nexus.repository.storage.StorageFacet.P_LAST_UPDATED;\n+import static org.sonatype.nexus.repository.storage.StorageFacet.P_NAME;\n+\n /**\n- * Wraps an {@code OrientVertex} to provide a simpler API for working with stored component and asset metadata.\n+ * Wraps an {@code ODocument} to provide a simpler API for working with stored component and asset metadata.\n  *\n  * @since 3.0\n  */\n-public interface MetadataNode\n-    extends VertexWrapper\n+public abstract class MetadataNode<T>\n+    extends Entity\n {\n+  private boolean newEntity = true;\n+\n+  private EntityId bucketId;\n+\n+  private String name;\n+\n+  private DateTime lastUpdated;\n+\n+  private String format;\n+\n+  private NestedAttributesMap attributes;\n+\n+  public boolean isNew() {\n+    return newEntity;\n+  }\n+\n+  T newEntity(final boolean newEntity) {\n+    this.newEntity = newEntity;\n+    return self();\n+  }\n+\n+  /**\n+   * Gets the bucket this is part of.\n+   */\n+  @Nullable\n+  public EntityId bucketId() {\n+    return require(bucketId, P_BUCKET);\n+  }\n+\n+  T bucketId(final EntityId bucketId) {\n+    this.bucketId = bucketId;\n+    return self();\n+  }\n+\n+  /**\n+   * Gets the name.\n+   */\n+  public String name() {\n+    return name;\n+  }\n+\n+  /**\n+   * Gets the name or throws a runtime exception if undefined.\n+   */\n+  public String requireName() {\n+    return require(name, P_NAME);\n+  }\n+\n+  /**\n+   * Sets the name.\n+   */\n+  public T name(final String name) {\n+    this.name = name;\n+    return self();\n+  }\n+\n   /**\n    * Gets the last updated date or {@code null} if undefined (the node has never been saved).","path":"components/nexus-repository/src/main/java/org/sonatype/nexus/repository/storage/MetadataNode.java","position":84,"original_position":84,"commit_id":"96e9f562360f55f91da8d7569fe181c4fe2f79ed","original_commit_id":"96e9f562360f55f91da8d7569fe181c4fe2f79ed","user":{"login":"mrprescott","id":2325642,"avatar_url":"https://avatars.githubusercontent.com/u/2325642?v=3","gravatar_id":"","url":"https://api.github.com/users/mrprescott","html_url":"https://github.com/mrprescott","followers_url":"https://api.github.com/users/mrprescott/followers","following_url":"https://api.github.com/users/mrprescott/following{/other_user}","gists_url":"https://api.github.com/users/mrprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/mrprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrprescott/subscriptions","organizations_url":"https://api.github.com/users/mrprescott/orgs","repos_url":"https://api.github.com/users/mrprescott/repos","events_url":"https://api.github.com/users/mrprescott/events{/privacy}","received_events_url":"https://api.github.com/users/mrprescott/received_events","type":"User","site_admin":false},"body":"Somewhere in here I think it's worth being explicit that this 'lastUpdatedDate' refers to the properties of the metadata node, rather than any of the other meanings (e.g. it's not the date the package was last revised in a nuget repo, for instance). (I know that's not in the scope of the changes you were making).","created_at":"2015-04-10T16:15:16Z","updated_at":"2015-04-10T16:15:16Z","html_url":"https://github.com/sonatype/nexus-oss/pull/1168#discussion_r28158180","pull_request_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168","_links":{"self":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments/28158180"},"html":{"href":"https://github.com/sonatype/nexus-oss/pull/1168#discussion_r28158180"},"pull_request":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168"}}},"pull_request":{"url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168","id":32790262,"html_url":"https://github.com/sonatype/nexus-oss/pull/1168","diff_url":"https://github.com/sonatype/nexus-oss/pull/1168.diff","patch_url":"https://github.com/sonatype/nexus-oss/pull/1168.patch","issue_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/1168","number":1168,"state":"open","locked":false,"title":"[NEXUS-8345] Fix storage facet contention","user":{"login":"adreghiciu","id":67204,"avatar_url":"https://avatars.githubusercontent.com/u/67204?v=3","gravatar_id":"","url":"https://api.github.com/users/adreghiciu","html_url":"https://github.com/adreghiciu","followers_url":"https://api.github.com/users/adreghiciu/followers","following_url":"https://api.github.com/users/adreghiciu/following{/other_user}","gists_url":"https://api.github.com/users/adreghiciu/gists{/gist_id}","starred_url":"https://api.github.com/users/adreghiciu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adreghiciu/subscriptions","organizations_url":"https://api.github.com/users/adreghiciu/orgs","repos_url":"https://api.github.com/users/adreghiciu/repos","events_url":"https://api.github.com/users/adreghiciu/events{/privacy}","received_events_url":"https://api.github.com/users/adreghiciu/received_events","type":"User","site_admin":false},"body":"https://issues.sonatype.org/browse/NEXUS-8345\r\nhttp://bamboo.s/browse/NX3-OSSF154","created_at":"2015-04-07T18:14:06Z","updated_at":"2015-04-10T16:15:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"644d10d0cc68f2d70adcc7a2f4789b8a1d0f7f40","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168/commits","review_comments_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168/comments","review_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/1168/comments","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/96e9f562360f55f91da8d7569fe181c4fe2f79ed","head":{"label":"sonatype:NEXUS-8345-fix-storage-facet-contention","ref":"NEXUS-8345-fix-storage-facet-contention","sha":"96e9f562360f55f91da8d7569fe181c4fe2f79ed","user":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"repo":{"id":10146961,"name":"nexus-oss","full_name":"sonatype/nexus-oss","owner":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonatype/nexus-oss","description":"Sonatype Nexus OSS","fork":false,"url":"https://api.github.com/repos/sonatype/nexus-oss","forks_url":"https://api.github.com/repos/sonatype/nexus-oss/forks","keys_url":"https://api.github.com/repos/sonatype/nexus-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonatype/nexus-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonatype/nexus-oss/teams","hooks_url":"https://api.github.com/repos/sonatype/nexus-oss/hooks","issue_events_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/events{/number}","events_url":"https://api.github.com/repos/sonatype/nexus-oss/events","assignees_url":"https://api.github.com/repos/sonatype/nexus-oss/assignees{/user}","branches_url":"https://api.github.com/repos/sonatype/nexus-oss/branches{/branch}","tags_url":"https://api.github.com/repos/sonatype/nexus-oss/tags","blobs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonatype/nexus-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonatype/nexus-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/sonatype/nexus-oss/languages","stargazers_url":"https://api.github.com/repos/sonatype/nexus-oss/stargazers","contributors_url":"https://api.github.com/repos/sonatype/nexus-oss/contributors","subscribers_url":"https://api.github.com/repos/sonatype/nexus-oss/subscribers","subscription_url":"https://api.github.com/repos/sonatype/nexus-oss/subscription","commits_url":"https://api.github.com/repos/sonatype/nexus-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonatype/nexus-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonatype/nexus-oss/contents/{+path}","compare_url":"https://api.github.com/repos/sonatype/nexus-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonatype/nexus-oss/merges","archive_url":"https://api.github.com/repos/sonatype/nexus-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonatype/nexus-oss/downloads","issues_url":"https://api.github.com/repos/sonatype/nexus-oss/issues{/number}","pulls_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/sonatype/nexus-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/sonatype/nexus-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonatype/nexus-oss/labels{/name}","releases_url":"https://api.github.com/repos/sonatype/nexus-oss/releases{/id}","created_at":"2013-05-18T20:48:57Z","updated_at":"2015-04-10T14:06:51Z","pushed_at":"2015-04-10T14:03:52Z","git_url":"git://github.com/sonatype/nexus-oss.git","ssh_url":"git@github.com:sonatype/nexus-oss.git","clone_url":"https://github.com/sonatype/nexus-oss.git","svn_url":"https://github.com/sonatype/nexus-oss","homepage":"http://links.sonatype.com/products/nexus/oss/home","size":883964,"stargazers_count":143,"watchers_count":143,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":16,"forks":90,"open_issues":16,"watchers":143,"default_branch":"master"}},"base":{"label":"sonatype:master","ref":"master","sha":"5459f5ca26858e264844a0b7da10584eeae93196","user":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"repo":{"id":10146961,"name":"nexus-oss","full_name":"sonatype/nexus-oss","owner":{"login":"sonatype","id":44938,"avatar_url":"https://avatars.githubusercontent.com/u/44938?v=3","gravatar_id":"","url":"https://api.github.com/users/sonatype","html_url":"https://github.com/sonatype","followers_url":"https://api.github.com/users/sonatype/followers","following_url":"https://api.github.com/users/sonatype/following{/other_user}","gists_url":"https://api.github.com/users/sonatype/gists{/gist_id}","starred_url":"https://api.github.com/users/sonatype/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonatype/subscriptions","organizations_url":"https://api.github.com/users/sonatype/orgs","repos_url":"https://api.github.com/users/sonatype/repos","events_url":"https://api.github.com/users/sonatype/events{/privacy}","received_events_url":"https://api.github.com/users/sonatype/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sonatype/nexus-oss","description":"Sonatype Nexus OSS","fork":false,"url":"https://api.github.com/repos/sonatype/nexus-oss","forks_url":"https://api.github.com/repos/sonatype/nexus-oss/forks","keys_url":"https://api.github.com/repos/sonatype/nexus-oss/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonatype/nexus-oss/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonatype/nexus-oss/teams","hooks_url":"https://api.github.com/repos/sonatype/nexus-oss/hooks","issue_events_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/events{/number}","events_url":"https://api.github.com/repos/sonatype/nexus-oss/events","assignees_url":"https://api.github.com/repos/sonatype/nexus-oss/assignees{/user}","branches_url":"https://api.github.com/repos/sonatype/nexus-oss/branches{/branch}","tags_url":"https://api.github.com/repos/sonatype/nexus-oss/tags","blobs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonatype/nexus-oss/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonatype/nexus-oss/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonatype/nexus-oss/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonatype/nexus-oss/statuses/{sha}","languages_url":"https://api.github.com/repos/sonatype/nexus-oss/languages","stargazers_url":"https://api.github.com/repos/sonatype/nexus-oss/stargazers","contributors_url":"https://api.github.com/repos/sonatype/nexus-oss/contributors","subscribers_url":"https://api.github.com/repos/sonatype/nexus-oss/subscribers","subscription_url":"https://api.github.com/repos/sonatype/nexus-oss/subscription","commits_url":"https://api.github.com/repos/sonatype/nexus-oss/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonatype/nexus-oss/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonatype/nexus-oss/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonatype/nexus-oss/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonatype/nexus-oss/contents/{+path}","compare_url":"https://api.github.com/repos/sonatype/nexus-oss/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonatype/nexus-oss/merges","archive_url":"https://api.github.com/repos/sonatype/nexus-oss/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonatype/nexus-oss/downloads","issues_url":"https://api.github.com/repos/sonatype/nexus-oss/issues{/number}","pulls_url":"https://api.github.com/repos/sonatype/nexus-oss/pulls{/number}","milestones_url":"https://api.github.com/repos/sonatype/nexus-oss/milestones{/number}","notifications_url":"https://api.github.com/repos/sonatype/nexus-oss/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonatype/nexus-oss/labels{/name}","releases_url":"https://api.github.com/repos/sonatype/nexus-oss/releases{/id}","created_at":"2013-05-18T20:48:57Z","updated_at":"2015-04-10T14:06:51Z","pushed_at":"2015-04-10T14:03:52Z","git_url":"git://github.com/sonatype/nexus-oss.git","ssh_url":"git@github.com:sonatype/nexus-oss.git","clone_url":"https://github.com/sonatype/nexus-oss.git","svn_url":"https://github.com/sonatype/nexus-oss","homepage":"http://links.sonatype.com/products/nexus/oss/home","size":883964,"stargazers_count":143,"watchers_count":143,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":16,"forks":90,"open_issues":16,"watchers":143,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168"},"html":{"href":"https://github.com/sonatype/nexus-oss/pull/1168"},"issue":{"href":"https://api.github.com/repos/sonatype/nexus-oss/issues/1168"},"comments":{"href":"https://api.github.com/repos/sonatype/nexus-oss/issues/1168/comments"},"review_comments":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168/comments"},"review_comment":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sonatype/nexus-oss/pulls/1168/commits"},"statuses":{"href":"https://api.github.com/repos/sonatype/nexus-oss/statuses/96e9f562360f55f91da8d7569fe181c4fe2f79ed"}}}}