aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java
index 929856e..0bf4aa6 100644
--- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/VehicleServiceImpl.java
@@ -11,16 +11,12 @@ import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@Service
public class VehicleServiceImpl implements VehicleService {
- private static final Logger LOG = LoggerFactory.getLogger(VehicleServiceImpl.class);
-
private VehicleDAO vehiclePersistence;
public VehicleServiceImpl(VehicleDAO vehiclePersistence) {
@@ -29,7 +25,6 @@ public class VehicleServiceImpl implements VehicleService {
public long add(Vehicle vehicle) throws InvalidVehicleException, ServiceException {
if (!CollectionUtils.isEmpty(vehicle.registrations())) {
- LOG.info("Invalid Vehicle: Vehicle cannot be created with registrations");
throw new InvalidVehicleException(
"Fahrzeug kann nicht mit Anmeldungen erstellt werden");
}
@@ -59,41 +54,32 @@ public class VehicleServiceImpl implements VehicleService {
switch (vehicle.type()) {
case RTW:
if (vehicle.constructionType() == ConstructionType.NORMAL) {
- LOG.info("Invalid Vehicle: RTW cannot have a normal roof");
throw new InvalidVehicleException("RTW darf kein Normales Dach haben");
} else if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) {
- LOG.info("Invalid Vehicle: RTW cannot have a medium roof");
throw new InvalidVehicleException("RTW darf kein Mittelhochdach haben");
}
break;
case KTW:
if (vehicle.constructionType() == ConstructionType.NORMAL) {
- LOG.info("Invalid Vehicle: KTW cannot have a normal roof");
throw new InvalidVehicleException("KTW darf kein Normales Dach haben");
}
break;
case KTW_B:
if (vehicle.constructionType() == ConstructionType.NORMAL) {
- LOG.info("Invalid Vehicle: KTW-B cannot have a normal roof");
throw new InvalidVehicleException("KTW-B darf kein Normales Dach haben");
}
break;
case NEF:
if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) {
- LOG.info("Invalid Vehicle: NEF cannot have a medium roof");
throw new InvalidVehicleException("NEF darf kein Mittelhochdach haben");
} else if (vehicle.constructionType() == ConstructionType.HOCHDACH) {
- LOG.info("Invalid Vehicle: NEF cannot have a high roof");
throw new InvalidVehicleException("NEF darf kein Hochdach haben");
}
break;
case NAH:
if (vehicle.constructionType() == ConstructionType.MITTELHOCHDACH) {
- // TODO: eventually change to LOG.debug (feedback)
- LOG.info("Invalid Vehicle: NAH cannot have a medium roof");
throw new InvalidVehicleException("NEF darf kein Mittelhochdach haben");
} else if (vehicle.constructionType() == ConstructionType.HOCHDACH) {
- LOG.info("Invalid Vehicle: NAH cannot have a high roof");
throw new InvalidVehicleException("NEF darf kein Hochdach haben");
}
break;
@@ -107,8 +93,7 @@ public class VehicleServiceImpl implements VehicleService {
@Override
public Set<Vehicle> list(EnumSet<Status> statuses) throws ServiceException {
if (statuses == null) {
- LOG.error("Statuses may not be null");
- throw new ServiceException("statuses may not be null");
+ throw new ServiceException("Statuses may not be null");
}
Set<Vehicle> vehicles;