OwnerService.java 1.75 KB
Newer Older
1 2 3 4
package at.ac.tuwien.sepm.assignment.individual.service;

import at.ac.tuwien.sepm.assignment.individual.entity.Owner;
import at.ac.tuwien.sepm.assignment.individual.exception.NotFoundException;
5 6
import at.ac.tuwien.sepm.assignment.individual.util.ValidationException;
import org.springframework.dao.DataAccessException;
7 8 9 10 11 12 13 14 15 16 17 18

public interface OwnerService {


    /**
     * @param id of the owner to find.
     * @return the owner with the specified id.
     * @throws RuntimeException  will be thrown if something goes wrong during data processing.
     * @throws NotFoundException will be thrown if the owner could not be found in the system.
     */
    Owner findOneById(Long id);

19 20 21 22
    /**
     * @param owner to create
     * @return the new owner
     * @throws ValidationException will be thrown if something goes wrong during verification.
23
     * @throws DataAccessException will be thrown if the owner could not be saved in the database.
24 25 26
     */
    Owner addOwner(Owner owner) throws ValidationException, DataAccessException;

27 28 29 30 31 32 33
    /**
     * @param owner that specifies the new owner values alongside with the id of the owner to update
     * @return the updated owner
     * @throws ValidationException will be thrown if something goes wrong during verification.
     * @throws DataAccessException will be thrown if the owner could not be saved in the database.
     */
    Owner updateOwner(Owner owner) throws ValidationException, DataAccessException;
34 35 36 37 38 39 40

    /**
     * @param id of the owner to delete
     * @throws NotFoundException   will be thrown if the owner could not be found in the system
     * @throws DataAccessException will be thrown if the owner could not be deleted from the database
     */
    void deleteOwner(Long id) throws NotFoundException, DataAccessException;
41
}