aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/missioncontrol/service/EmployeeService.java
blob: 5beabaacfb59cc590b85877a6d9775e535acb4b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.service;

import at.ac.tuwien.sepm.assignment.groupphase.exception.InvalidEmployeeException;
import at.ac.tuwien.sepm.assignment.groupphase.exception.ServiceException;
import at.ac.tuwien.sepm.assignment.groupphase.missioncontrol.dto.Employee;
import java.util.Set;

public interface EmployeeService {

    /**
     * Add given employee to the store.
     *
     * @param employee that should be added to the store
     * @return the id that was assigned
     * @throws InvalidEmployeeException if the employee is invalid
     * @throws ServiceException if the employee could not be persisted
     */
    long add(Employee employee) throws InvalidEmployeeException, ServiceException;

    /**
     * Update the given employee.
     *
     * @param employee that should be updated
     * @return the updated employee
     * @throws InvalidEmployeeException if the employee is invalid
     * @throws ServiceException if the updated employee could not be persisted
     */
    Employee update(Employee employee) throws InvalidEmployeeException, ServiceException;

    /**
     * Get all stored employees.
     *
     * @return list containing all stored employees
     * @throws ServiceException if loading the stored employees failed
     */
    Set<Employee> list() throws ServiceException;

    /**
     * Remove employee with the given id from the store.
     *
     * @param id of the employee that should be removed
     * @throws InvalidEmployeeException if given employee id is invalid or does not exist
     * @throws ServiceException if the employee could not be removed from the store
     */
    void remove(long id) throws InvalidEmployeeException, ServiceException;
}