From 07dd67fd617e84466dbc0c348ca243bd19efe9c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 4 Sep 2017 00:59:11 +0200 Subject: [PATCH] Continued: - renamed + moved allBusinessContacts() -> allBusinessContacts() as this is a generic method (not only admin) - added admin-only addCompanyBasicData() buisness method - added initial remote interfaces for admin and general purposes for branch offices - the later one has its first business method allBranchOffices() - added initial remote interface for headquarters data and first business method findCompanyHeadquartersById() - fixed copyright MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../AdminBusinessDataSessionBeanRemote.java | 15 ++++--- .../BusinessDataSessionBeanRemote.java | 22 +++++++++- .../AdminBranchOfficeSessionBeanRemote.java | 30 +++++++++++++ .../BranchOfficeSessionBeanRemote.java | 38 ++++++++++++++++ ...AdminCompanyEmployeeSessionBeanRemote.java | 4 +- .../CompanyEmployeeSessionBeanRemote.java | 4 +- .../CompanyHeadquartersSessionBeanRemote.java | 43 +++++++++++++++++++ 7 files changed, 145 insertions(+), 11 deletions(-) create mode 100644 src/org/mxchange/jcontactsbusiness/branchoffice/AdminBranchOfficeSessionBeanRemote.java create mode 100644 src/org/mxchange/jcontactsbusiness/branchoffice/BranchOfficeSessionBeanRemote.java create mode 100644 src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadquartersSessionBeanRemote.java diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/AdminBusinessDataSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/basicdata/AdminBusinessDataSessionBeanRemote.java index f942639..aee3674 100644 --- a/src/org/mxchange/jcontactsbusiness/basicdata/AdminBusinessDataSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/basicdata/AdminBusinessDataSessionBeanRemote.java @@ -17,8 +17,8 @@ package org.mxchange.jcontactsbusiness.basicdata; import java.io.Serializable; -import java.util.List; import javax.ejb.Remote; +import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataAlreadyAddedException; /** * A remote interface for business contact data @@ -29,11 +29,16 @@ import javax.ejb.Remote; public interface AdminBusinessDataSessionBeanRemote extends Serializable { /** - * Returns a list, even empty if not thing found, from all business - * contacts. NULL should not be returned by this method. + * Adds basic business data to database, if not found. If found, a proper + * exception is being thrown. *

- * @return A list with all business contacts + * @param basicData Basic data to be persisted + *

+ * @return Updated basic data + *

+ * @throws BusinessDataAlreadyAddedException If the company name was already + * found */ - List allBusinessContacts (); + BusinessBasicData addCompanyBasicData (final BusinessBasicData basicData) throws BusinessDataAlreadyAddedException; } diff --git a/src/org/mxchange/jcontactsbusiness/basicdata/BusinessDataSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/basicdata/BusinessDataSessionBeanRemote.java index a44f443..cc437aa 100644 --- a/src/org/mxchange/jcontactsbusiness/basicdata/BusinessDataSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/basicdata/BusinessDataSessionBeanRemote.java @@ -17,6 +17,7 @@ package org.mxchange.jcontactsbusiness.basicdata; import java.io.Serializable; +import java.util.List; import javax.ejb.Remote; import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataNotFoundException; @@ -28,17 +29,34 @@ import org.mxchange.jcontactsbusiness.exceptions.basicdata.BusinessDataNotFoundE @Remote public interface BusinessDataSessionBeanRemote extends Serializable { + /** + * Checks whether given company name already exists + *

+ * @param companyName Company name to check + *

+ * @return Whether the company name exists + */ + Boolean isCompanyNameUsed (final String companyName); + /** * Retrieves a single business data entity for given id number or throws a * proper exception if not found. *

- * @param businessDataId Business data id to lookup + * @param companyDataId Company basic data id to lookup *

* @return Business contact instance *

* @throws BusinessDataNotFoundException If the id number could not be * looked up and solved into an entity */ - BusinessBasicData findBusinessDataById (final Long businessDataId) throws BusinessDataNotFoundException; + BusinessBasicData findBasicDataById (final Long companyDataId) throws BusinessDataNotFoundException; + + /** + * Returns a list, even empty if not thing found, from all business + * contacts. NULL should not be returned by this method. + *

+ * @return A list with all business contacts + */ + List allCompanyBasicData (); } diff --git a/src/org/mxchange/jcontactsbusiness/branchoffice/AdminBranchOfficeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/branchoffice/AdminBranchOfficeSessionBeanRemote.java new file mode 100644 index 0000000..f2b4cad --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/branchoffice/AdminBranchOfficeSessionBeanRemote.java @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.branchoffice; + +import java.io.Serializable; +import javax.ejb.Remote; + +/** + * A remote interface for business contact data + *

+ * @author Roland Häder + */ +@Remote +public interface AdminBranchOfficeSessionBeanRemote extends Serializable { + +} diff --git a/src/org/mxchange/jcontactsbusiness/branchoffice/BranchOfficeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/branchoffice/BranchOfficeSessionBeanRemote.java new file mode 100644 index 0000000..029a1ce --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/branchoffice/BranchOfficeSessionBeanRemote.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.branchoffice; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Remote; + +/** + * A remote interface for business contact data + *

+ * @author Roland Häder + */ +@Remote +public interface BranchOfficeSessionBeanRemote extends Serializable { + + /** + * Returns a list of all branch offices + *

+ * @return All branch offices + */ + List allBranchOffices (); + +} diff --git a/src/org/mxchange/jcontactsbusiness/employee/AdminCompanyEmployeeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/employee/AdminCompanyEmployeeSessionBeanRemote.java index 8a61e1a..3e9fb0d 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/AdminCompanyEmployeeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/employee/AdminCompanyEmployeeSessionBeanRemote.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Roland Haeder + * Copyright (C) 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,7 @@ import javax.ejb.Remote; /** * An interface for administrative purposes on handling company employee data *

- * @author Roland Haeder + * @author Roland Häder */ @Remote public interface AdminCompanyEmployeeSessionBeanRemote extends Serializable { diff --git a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployeeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployeeSessionBeanRemote.java index c841ff2..68da109 100644 --- a/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployeeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/employee/CompanyEmployeeSessionBeanRemote.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Roland Haeder + * Copyright (C) 2017 Roland Häder * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoun /** * An interface for company employee data being handled *

- * @author Roland Haeder + * @author Roland Häder */ @Remote public interface CompanyEmployeeSessionBeanRemote extends Serializable { diff --git a/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadquartersSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadquartersSessionBeanRemote.java new file mode 100644 index 0000000..a17fbad --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/headquarters/CompanyHeadquartersSessionBeanRemote.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2017 Roland Häder + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.mxchange.jcontactsbusiness.headquarters; + +import java.io.Serializable; +import javax.ejb.Remote; +import org.mxchange.jcontactsbusiness.exceptions.headquarters.CompanyHeadquartersNotFoundException; + +/** + * A remote interface for company headquarters data + *

+ * @author Roland Häder + */ +@Remote +public interface CompanyHeadquartersSessionBeanRemote extends Serializable { + + /** + * Tries to find company headquarters data by given id number. If not found, + * a proper exception is thrown. + *

+ * @param headquartersId

+ * @return Headquarters data entity + *

+ * @throws CompanyHeadquartersNotFoundException If no headquarters data + * could be found + */ + HeadquartersData findCompanyHeadquartersById (final Long headquartersId) throws CompanyHeadquartersNotFoundException; + +} -- 2.39.5