Commit.java

  1. package com.capitalone.dashboard.model;

  2. import org.bson.types.ObjectId;
  3. import org.springframework.data.annotation.Id;
  4. import org.springframework.data.mongodb.core.index.CompoundIndex;
  5. import org.springframework.data.mongodb.core.index.CompoundIndexes;
  6. import org.springframework.data.mongodb.core.index.Indexed;
  7. import org.springframework.data.mongodb.core.mapping.Document;

  8. /**
  9.  * A specific commit in a version control repository.
  10.  *
  11.  * Possible collectors:
  12.  *  Subversion (in scope)
  13.  *  Git (in scope)
  14.  *  GitHub
  15.  *  TFS
  16.  *  BitBucket
  17.  *  Unfuddle
  18.  *
  19.  */
  20. @Document(collection="commits")
  21. @CompoundIndexes({
  22.         @CompoundIndex(name = "unique_scm_key", def = "{'collectorItemId' : 1, 'scmRevisionNumber': 1}")
  23. })
  24. public class Commit extends SCM {
  25.     @Id
  26.     private ObjectId id;
  27.     @Indexed
  28.     private ObjectId collectorItemId;
  29.     private long timestamp;

  30.     private boolean firstEverCommit;

  31.     public ObjectId getId() {
  32.         return id;
  33.     }

  34.     public void setId(ObjectId id) {
  35.         this.id = id;
  36.     }

  37.     public ObjectId getCollectorItemId() {
  38.         return collectorItemId;
  39.     }

  40.     public void setCollectorItemId(ObjectId collectorItemId) {
  41.         this.collectorItemId = collectorItemId;
  42.     }

  43.     public long getTimestamp() {
  44.         return timestamp;
  45.     }

  46.     public void setTimestamp(long timestamp) {
  47.         this.timestamp = timestamp;
  48.     }

  49.     public boolean isFirstEverCommit() {
  50.         return firstEverCommit;
  51.     }

  52.     public void setFirstEverCommit(boolean firstEverCommit) {
  53.         this.firstEverCommit = firstEverCommit;
  54.     }
  55. }