From 7bab6ec49878d303580d032f995ccb8a3172a575 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 8 Jun 2017 00:08:23 +0200 Subject: [PATCH] Initialized project with remote interface for business contacts. This project has inherited from jcontacts-lib. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- build.xml | 6 +- nbproject/build-impl.xml | 10 +- nbproject/project.properties | 4 +- nbproject/project.xml | 2 +- .../AdminContactSessionBeanRemote.java | 52 ------ .../contact/ContactSessionBeanRemote.java | 114 ------------ .../AdminContactsPhoneSessionBeanRemote.java | 163 ------------------ .../BusinessContactSessionBeanRemote.java | 39 +++++ 8 files changed, 50 insertions(+), 340 deletions(-) delete mode 100644 src/org/mxchange/jcontacts/contact/AdminContactSessionBeanRemote.java delete mode 100644 src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java delete mode 100644 src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java create mode 100644 src/org/mxchange/jcontactsbusiness/BusinessContactSessionBeanRemote.java diff --git a/build.xml b/build.xml index 0544204..2ee4964 100644 --- a/build.xml +++ b/build.xml @@ -7,8 +7,8 @@ - - Builds, tests, and runs the project jcontacts-lib. + + Builds, tests, and runs the project jcontacts-business-lib. - + @@ -474,7 +474,7 @@ is divided into following sections: - + @@ -625,7 +625,7 @@ is divided into following sections: - + @@ -917,7 +917,7 @@ is divided into following sections: - + @@ -1402,7 +1402,7 @@ is divided into following sections: - + diff --git a/nbproject/project.properties b/nbproject/project.properties index 6975e89..bfb59a7 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -3,7 +3,7 @@ annotation.processing.enabled.in.editor=true annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -application.title=jcontacts-lib +application.title=jcontacts-business-lib application.vendor=Roland H\u00e4der auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml build.classes.dir=${build.dir}/classes @@ -26,7 +26,7 @@ debug.test.classpath=\ dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist -dist.jar=${dist.dir}/jcontacts-lib.jar +dist.jar=${dist.dir}/jcontacts-business-lib.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= diff --git a/nbproject/project.xml b/nbproject/project.xml index 7ef19e9..2e908bb 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.java.j2seproject - jcontacts-lib + jcontacts-business-lib diff --git a/src/org/mxchange/jcontacts/contact/AdminContactSessionBeanRemote.java b/src/org/mxchange/jcontacts/contact/AdminContactSessionBeanRemote.java deleted file mode 100644 index cf3b0ba..0000000 --- a/src/org/mxchange/jcontacts/contact/AdminContactSessionBeanRemote.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2016, 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.jcontacts.contact; - -import java.io.Serializable; -import javax.ejb.Remote; -import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; - -/** - * A remote interface for administrative contact purposes - *

- * @author Roland Häder - */ -@Remote -public interface AdminContactSessionBeanRemote extends Serializable { - - /** - * Deletes given contact instance - *

- * @param contact Contact instance being deleted - */ - void deleteContactData (final Contact contact); - - /** - * Adds (persists) given contact instance, if not found. If successfull, the - * field contactId contains the running number, otherwise an exception is - * thrown. - * - * @param contact Contact to be added - *

- * @return Updated contact instance - *

- * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException - * Contact already found - */ - Contact addContact (final Contact contact) throws ContactAlreadyAddedException; - -} diff --git a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java deleted file mode 100644 index 78431f7..0000000 --- a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2016, 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.jcontacts.contact; - -import java.io.Serializable; -import java.util.List; -import javax.ejb.Remote; -import org.mxchange.jcontacts.exceptions.ContactNotFoundException; - -/** - * A remote interface for general contact purposes - *

- * @author Roland Häder - */ -@Remote -public interface ContactSessionBeanRemote extends Serializable { - - /** - * Checks whether the given email address is already registered. The email - * address should be validated by EmailAddressValidator before calling this - * method. - *

- * @param emailAddress Email address to check - *

- * @return Whether the email address is already registered - */ - boolean isEmailAddressRegistered (final String emailAddress); - - /** - * Checks if the given contact can be found by checking the whole list. - *

- * @param contact Contact instance to check - *

- * @return Whether the found instance or null - */ - Contact lookupContact (final Contact contact); - - /** - * Updates given contact data - *

- * @param contact Contact data to update - * @param isMobileUnlinked Whether a mobile entry has been unlinked in - * contact instance - * @param isLandlineUnlinked Whether a land-line entry has been unlinked in - * contact instance - * @param isFaxUnlinked Whether a fax entry has been unlinked in contact - * instance - *

- * @return Updated contact instance - */ - Contact updateContactData (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked); - - /** - * Updates given contact in database. Please note that the id number must be - * set. This method should also make sure that mobile, land-line and fix - * numbers are updated, too. - *

- * @param contact Contact to update - *

- * @return Updated contact instance - */ - Contact updateContactData (final Contact contact); - - /** - * Returns a list of all found contacts - *

- * @return A list of call contacts - */ - List getAllContacts (); - - /** - * Returns a list of all registered email addresses. - *

- * @return A list of all email addresses - */ - List getEmailAddressList (); - - /** - * Returns a contact instance which has the given id number. - *

- * @param contactId Contact id - *

- * @return Contact instance - *

- * @throws ContactNotFoundException If the contact was not found - */ - Contact findContactById (final Long contactId) throws ContactNotFoundException; - - /** - * Returns a contact instance which has the given email address. - *

- * @param emailAddress Email address - *

- * @return Contact instance - *

- * @throws ContactNotFoundException If the contact was not found - */ - Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException; - -} diff --git a/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java b/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java deleted file mode 100644 index 615fc57..0000000 --- a/src/org/mxchange/jcontacts/phone/AdminContactsPhoneSessionBeanRemote.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (C) 2016, 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.jcontacts.phone; - -import java.io.Serializable; -import javax.ejb.Remote; -import org.mxchange.jcontacts.contact.Contact; -import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException; -import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException; -import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; -import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; -import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; - -/** - * A remote interface for administrative purposes around contact's phone numbers - * (any type). - *

- * @author Roland Häder - */ -@Remote -public interface AdminContactsPhoneSessionBeanRemote extends Serializable { - - /** - * Links existing fax number with given contact instance. The id number - * should be set. - *

- * @param contact Contact to link to - * @param faxNumber Fax number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a fax number is already - * linked in contact - */ - Contact linkExistingFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Links existing land-line number with given contact instance. The id - * number should be set. - *

- * @param contact Contact to link to - * @param landLineNumber Land-line number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a land-line number is - * already linked in contact - */ - Contact linkExistingLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Links existing mobile number with given contact instance. The id number - * should be set. - *

- * @param contact Contact to link to - * @param mobileNumber Mobile number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a mobile number is already - * linked in contact - */ - Contact linkExistingMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Links new fax number with given contact instance. The id number should - * NOT be set. - *

- * @param contact Contact to link to - * @param faxNumber Fax number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a fax number is already - * linked in contact - */ - Contact linkNewFaxNumberWithContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Links new land-line number with given contact instance. The id number - * should NOT be set. - *

- * @param contact Contact to link to - * @param landLineNumber Land-line number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a land-line number is - * already linked in contact - */ - Contact linkNewLandLineNumberWithContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Links new mobile number with given contact instance. The id number should - * NOT be set. - *

- * @param contact Contact to link to - * @param mobileNumber Mobile number to link - *

- * @return Updated contact - *

- * @throws PhoneNumberAlreadyLinkedException If a mobile number is already - * linked in contact - */ - Contact linkNewMobileNumberWithContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberAlreadyLinkedException; - - /** - * Unlinks fax data from given contact and returns the updated (managed) - * version. - *

- * @param contact Contact to unlink mobile instance - * @param faxNumber Fax number being unlinked - *

- * @return Updated contact instance - *

- * @throws PhoneNumberNotLinkedException If a mobile instance is not linked - * (null) with this contact - */ - Contact unlinkFaxDataFromContact (final Contact contact, final DialableFaxNumber faxNumber) throws PhoneNumberNotLinkedException; - - /** - * Unlinks land-line data from given contact and returns the updated - * (managed) version. - *

- * @param contact Contact to unlink mobile instance - * @param landLineNumber Land-line number being unlinked - *

- * @return Updated contact instance - *

- * @throws PhoneNumberNotLinkedException If a mobile instance is not linked - * (null) with this contact - */ - Contact unlinkLandLineDataFromContact (final Contact contact, final DialableLandLineNumber landLineNumber) throws PhoneNumberNotLinkedException; - - /** - * Unlinks mobile data from given contact and returns the updated (managed) - * version. - *

- * @param contact Contact to unlink mobile instance - * @param mobileNumber Mobile number being unlinked - *

- * @return Updated contact instance - *

- * @throws PhoneNumberNotLinkedException If a mobile instance is not linked - * (null) with this contact - */ - Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException; - -} diff --git a/src/org/mxchange/jcontactsbusiness/BusinessContactSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/BusinessContactSessionBeanRemote.java new file mode 100644 index 0000000..4561e19 --- /dev/null +++ b/src/org/mxchange/jcontactsbusiness/BusinessContactSessionBeanRemote.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2017 Roland Haeder + * + * 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; + +import java.io.Serializable; +import java.util.List; +import javax.ejb.Remote; + +/** + * A remote interface for business contact data + *

+ * @author Roland Haeder + */ +@Remote +public interface BusinessContactSessionBeanRemote extends Serializable { + + /** + * 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 allBusinessContacts (); + +} -- 2.39.5