]> git.mxchange.org Git - jcontacts-business-lib.git/blob - src/org/mxchange/jcontactsbusiness/model/department/AdminDepartmentSessionBeanRemote.java
468d18044c0a6c8758905f8535ff839292af8f5b
[jcontacts-business-lib.git] / src / org / mxchange / jcontactsbusiness / model / department / AdminDepartmentSessionBeanRemote.java
1 /*
2  * Copyright (C) 2017 - 2022 Free Software Foundation
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 package org.mxchange.jcontactsbusiness.model.department;
18
19 import java.io.Serializable;
20 import javax.ejb.Remote;
21 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
22 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
23
24 /**
25  * A remote interface for departments
26  * <p>
27  * @author Roland Häder<roland@mxchange.org>
28  */
29 @Remote
30 public interface AdminDepartmentSessionBeanRemote extends Serializable {
31
32         /**
33          * Updates the given department instance in database and returns an updated
34          * version of it. If the department is not found, a checked exception is
35          * thrown.
36          * <p>
37          * @param department Department being updated
38          * <p>
39          * @return Updated department instance
40          * <p>
41          * @throws DepartmentNotFoundException If the department was not found
42          */
43         Department updateDepartment (final Department department) throws DepartmentNotFoundException;
44
45         /**
46          * Adds a given department instance to the database. If it is already found
47          * (department name and company in combination), then throw a proper
48          * exception.
49          * <p>
50          * @param department Department instance to add
51          * <p>
52          * @return Updated department instance
53          * <p>
54          * @throws DepartmentAlreadyAddedException If the department is already
55          * added
56          */
57         Department addDepartment (final Department department) throws DepartmentAlreadyAddedException;
58
59 }