diff options
Diffstat (limited to 'src/main/java/at/ac/tuwien')
| -rw-r--r-- | src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/RegistrationValidator.java | 25 | 
1 files changed, 0 insertions, 25 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/RegistrationValidator.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/RegistrationValidator.java index 805e306..3456534 100644 --- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/RegistrationValidator.java +++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/dto/RegistrationValidator.java @@ -8,13 +8,9 @@ import java.util.HashMap;  import java.util.LinkedList;  import java.util.List;  import java.util.Set; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory;  public class RegistrationValidator { -    private static final Logger LOG = LoggerFactory.getLogger(RegistrationValidator.class); -      private RegistrationValidator() {}      public static void validate(Vehicle vehicle, Set<Registration> registrations) @@ -47,9 +43,6 @@ public class RegistrationValidator {          for (Registration registration : registrations) {              total++;              if (found.put(registration.employee().id(), false) != null) { -                LOG.info( -                        "Invalid Registration: Employee with ID {} was added twice", -                        registration.employee().id());                  throw new InvalidRegistrationException(                          "Person mit der ID: "                                  + registration.employee().id() @@ -73,7 +66,6 @@ public class RegistrationValidator {              }          }          if (total <= 0) { -            LOG.info("Invalid Registration: No employees were added");              throw new InvalidRegistrationException("Kein Personal ausgewählt!");          }          if (vehicle.type() == VehicleType.NAH) { @@ -85,10 +77,8 @@ public class RegistrationValidator {              3-4 Personen               */              if (total < 3) { -                LOG.info("Invalid Registration: Too few employees for NAH");                  throw new InvalidRegistrationException("Zu wenig Personal für NAH!");              } else if (total > 4) { -                LOG.info("Invalid Registration: Too many employees for NAH");                  throw new InvalidRegistrationException("Zu viel Personal für NAH!");              }              for (long pilot_id : pilotIds) { @@ -98,14 +88,12 @@ public class RegistrationValidator {                      found.put(na_id, true);                      for (long nfs_id : nfsIds) {                          if (found.get(nfs_id)) continue; -                        LOG.info("Valid combination found for NAH");                          return;                      }                      found.put(na_id, false);                  }                  found.put(pilot_id, false);              } -            LOG.info("Invalid Registration: No valid combination of employees found for NAH");              throw new InvalidRegistrationException(                      "Keine gültige Kombination von Personen für NAH!");          } else if (vehicle.type() == VehicleType.NEF) { @@ -115,10 +103,8 @@ public class RegistrationValidator {              1 NA               */              if (total < 2) { -                LOG.info("Invalid Registration: Too few employees for NEF");                  throw new InvalidRegistrationException("Zu wenig Personal für NEF!");              } else if (total > 3) { -                LOG.info("Invalid Registration: Too many employees for NEF");                  throw new InvalidRegistrationException("Zu viel Personal für NEF!");              }              for (long driver_id : driverIds) { @@ -127,12 +113,10 @@ public class RegistrationValidator {                  found.put(driver_id, true);                  for (long na_id : naIds) {                      if (found.get(na_id)) continue; -                    LOG.info("Valid combinaion found for NEF");                      return;                  }                  found.put(driver_id, false);              } -            LOG.info("Invalid Registration: No valid combination of employees found for NEF");              throw new InvalidRegistrationException(                      "Keine gültige Kombination von Personen für NEF!");          } else if (vehicle.type() == VehicleType.BKTW) { @@ -141,14 +125,11 @@ public class RegistrationValidator {              1 Driver               */              if (total > 3) { -                LOG.info("Invalid Registration: Too many employees for BKTW");                  throw new InvalidRegistrationException("Zu viel Personal für BKTW!");              }              if (!driverIds.isEmpty()) { -                LOG.info("Valid combination found for BKTW");                  return;              } -            LOG.info("Invalid Registration: No driver was found for BKTW");              throw new InvalidRegistrationException("Kein Fahrer gefunden für BKTW!");          } else { // KTW or RTW, both have the same requirements              /* @@ -157,11 +138,9 @@ public class RegistrationValidator {              1 RS               */              if (total < 2) { -                LOG.info("Invalid Registration: Too few employees for {}", vehicle.type().name());                  throw new InvalidRegistrationException(                          "Zu wenig Personal für " + vehicle.type().name() + "!");              } else if (total > 4) { -                LOG.info("Invalid Registration: Too many employees for {}", vehicle.type().name());                  throw new InvalidRegistrationException(                          "Zu viel Persoanl für " + vehicle.type().name() + "!");              } @@ -169,13 +148,9 @@ public class RegistrationValidator {                  found.put(driver_id, true);                  for (long rs_id : rsIds) {                      if (found.get(rs_id)) continue; -                    LOG.info("Valid combination found for {}", vehicle.type().name());                      return;                  }              } -            LOG.info( -                    "Invalid Registration: No valid combination of employees found for {}", -                    vehicle.type().name());              throw new InvalidRegistrationException(                      "Keine gültige Kombination von Personen für " + vehicle.type().name() + "!");          }  | 
