aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java')
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java
new file mode 100644
index 0000000..91577dc
--- /dev/null
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/RegistrationService.java
@@ -0,0 +1,32 @@
+package at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.service;
+
+import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidRegistrationException;
+import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidVehicleException;
+import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
+import at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.dto.Registration;
+import java.util.Set;
+
+public interface RegistrationService {
+
+ /**
+ * Register employee to a vehicle.
+ *
+ * @param vehicleId the id of the target vehicle
+ * @param registrations that should be added to the vehicle
+ * @return the list of ids that were assigned
+ * @throws InvalidVehicleException if the vehicleId is invalid or does not exist
+ * @throws InvalidRegistrationException if the registration is invalid
+ * @throws ServiceException if the registration could not be persisted
+ */
+ Set<Long> add(long vehicleId, Set<Registration> registrations)
+ throws InvalidVehicleException, InvalidRegistrationException, ServiceException;
+
+ /**
+ * Remove given registration from the store.
+ *
+ * @param registrationId the id of the registration that should be removed
+ * @throws InvalidRegistrationException if the registration is invalid or does not exist
+ * @throws ServiceException if the registration could not be removed from the store
+ */
+ void remove(long registrationId) throws InvalidRegistrationException, ServiceException;
+}