]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-10052 Improve documentation of quality profile DTOs
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Sun, 14 Jan 2018 19:36:39 +0000 (20:36 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 29 Jan 2018 20:11:00 +0000 (21:11 +0100)
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgQProfileDto.java
server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java

index e9e7e4a5e10b025ace97898f1a1e41b1e4c3cfca..bbe42576dffa191d75f62e97d32fd35beb850556 100644 (file)
@@ -23,13 +23,32 @@ import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 
 /**
- * Represents the table "org_qprofiles"
+ * Maps the table "org_qprofiles", which represents the profiles
+ * available in an organization.
+ *
+ * Extracting organizations from table "rules_profiles"
+ * allows to optimize storage and synchronization of built-in
+ * profiles by implementing an alias mechanism. A built-in profile
+ * is stored once in table "rules_profiles" and is referenced
+ * multiple times in table "org_qprofiles".
+ * User profiles are not shared across organizations, then one row
+ * in "rules_profiles" is referenced by a single row in
+ * "org_qprofiles".
  */
 public class OrgQProfileDto {
 
   private String uuid;
+
+  /**
+   * UUID of organization. Not null.
+   */
   private String organizationUuid;
+
+  /**
+   * UUID of referenced row in table "rules_profiles". Not null.
+   */
   private String rulesProfileUuid;
+
   private String parentUuid;
   private Long lastUsed;
   private Long userUpdatedAt;
index 59ded3e57ec7a86246beeb5a7d81c8144164ca90..d7532445833dd54972c931371bac6992bce91ef2 100644 (file)
@@ -23,15 +23,48 @@ import java.util.Date;
 import org.sonar.core.util.UtcDateUtils;
 
 /**
- * Represents the table "rules_profiles"
+ * Maps the table "rules_profiles", which represents
+ * a group of active rules.
+ *
+ * Can be:
+ * - a built-in profile, referenced by multiple organizations
+ *   through table "org_qprofiles".
+ * - a profile created by user and referenced by one, and only one,
+ *   organization in the table "org_qprofiles"
  */
 public class RulesProfileDto {
 
+  /**
+   * Legacy db-generated ID. Usages should be replaced by {@link #kee}.
+   */
   private Integer id;
+
+  /**
+   * UUID. Can be a unique slug on legacy rows, for example "abap-sonar-way-38370".
+   */
   private String kee;
+
+  /**
+   * Name displayed to users, for example "Sonar way". Not null.
+   */
   private String name;
+
+  /**
+   * Language key, for example "java". Not null.
+   */
   private String language;
+
+  /**
+   * Date of last update of rule configuration (activation/deactivation/change of parameter).
+   * It does not include profile renaming.
+   * Not null.
+   */
   private String rulesUpdatedAt;
+
+  /**
+   * Whether profile is built-in or created by a user.
+   * A built-in profile is read-only. Its definition is provided by a language plugin.
+   */
   private boolean isBuiltIn;
 
   public String getKee() {