]> WPIA git - gigi.git/commitdiff
UPD: assurance type goes Enum, (+clean)
authorFelix Dörre <felix@dogcraft.de>
Sun, 21 Sep 2014 13:11:22 +0000 (15:11 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sun, 21 Sep 2014 13:11:22 +0000 (15:11 +0200)
src/org/cacert/gigi/dbObjects/Assurance.java
src/org/cacert/gigi/dbObjects/User.java

index d4ebe333089cbcdc2ca86774b75bd20802535574..2d7c593489519aa8c88d92f4c4d5ec504384f034 100644 (file)
@@ -4,6 +4,20 @@ import org.cacert.gigi.database.GigiResultSet;
 
 public class Assurance {
 
+    public enum AssuranceType {
+        FACE_TO_FACE("Face to Face Meeting"), TOPUP("TOPUP"), TTP_ASSISTED("TTP-Assisted");
+
+        private final String description;
+
+        private AssuranceType(String description) {
+            this.description = description;
+        }
+
+        public String getDescription() {
+            return description;
+        }
+    }
+
     private int id;
 
     private User from;
index 8abe5bad35aa0d858d0722c201fb33069da256a9..b67da929b79ced837ada340b3fa1275f595c964c 100644 (file)
@@ -486,7 +486,7 @@ public class User implements IdCachable {
         return Collections.unmodifiableSet(groups);
     }
 
-    public void grantGroup(User granter, Group toGrant) throws GigiApiException {
+    public void grantGroup(User granter, Group toGrant) {
         groups.add(toGrant);
         GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("INSERT INTO user_groups SET user=?, permission=?, grantedby=?");
         ps.setInt(1, getId());
@@ -495,7 +495,7 @@ public class User implements IdCachable {
         ps.execute();
     }
 
-    public void revokeGroup(User revoker, Group toRevoke) throws GigiApiException {
+    public void revokeGroup(User revoker, Group toRevoke) {
         groups.remove(toRevoke);
         GigiPreparedStatement ps = DatabaseConnection.getInstance().prepare("UPDATE user_groups SET deleted=CURRENT_TIMESTAMP, revokedby=? WHERE deleted is NULL AND permission=? AND user=?");
         ps.setInt(1, revoker.getId());