+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jcontacts.contact;
-
-import java.io.Serializable;
-import javax.ejb.Remote;
-import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
-import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-
-/**
- * A remote interface for administrative contact purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface AdminContactSessionBeanRemote extends Serializable {
-
- /**
- * Deletes given contact instance
- * <p>
- * @param contact Contact instance being deleted
- * <p>
- * @throws ContactNotFoundException If the contact is not found
- */
- void deleteContactData (final Contact contact) throws ContactNotFoundException;
-
- /**
- * 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
- * <p>
- * @return Updated contact instance
- * <p>
- * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException
- * Contact already found
- */
- Contact addContact (final Contact contact) throws ContactAlreadyAddedException;
-
-}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@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.
- * <p>
- * @param emailAddress Email address to check
- * <p>
- * @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.
- * <p>
- * @param contact Contact instance to check
- * <p>
- * @return Whether the found instance or null
- */
- Contact lookupContact (final Contact contact);
-
- /**
- * Updates given contact data
- * <p>
- * @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
- * <p>
- * @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.
- * <p>
- * @param contact Contact to update
- * <p>
- * @return Updated contact instance
- */
- Contact updateContactData (final Contact contact);
-
- /**
- * Returns a list of all found contacts
- * <p>
- * @return A list of call contacts
- */
- List<Contact> allContacts ();
-
- /**
- * Returns a list of all registered email addresses.
- * <p>
- * @return A list of all email addresses
- */
- List<String> allEmailAddresses ();
-
- /**
- * Returns a contact instance which has the given id number.
- * <p>
- * @param contactId Contact id
- * <p>
- * @return Contact instance
- * <p>
- * @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.
- * <p>
- * @param emailAddress Email address
- * <p>
- * @return Contact instance
- * <p>
- * @throws ContactNotFoundException If the contact was not found
- */
- Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException;
-
-}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontacts.model.contact;
+
+import org.mxchange.jcontacts.model.contact.Contact;
+import java.io.Serializable;
+import javax.ejb.Remote;
+import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
+import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
+
+/**
+ * A remote interface for administrative contact purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface AdminContactSessionBeanRemote extends Serializable {
+
+ /**
+ * Deletes given contact instance
+ * <p>
+ * @param contact Contact instance being deleted
+ * <p>
+ * @throws ContactNotFoundException If the contact is not found
+ */
+ void deleteContactData (final Contact contact) throws ContactNotFoundException;
+
+ /**
+ * 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
+ * <p>
+ * @return Updated contact instance
+ * <p>
+ * @throws org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException
+ * Contact already found
+ */
+ Contact addContact (final Contact contact) throws ContactAlreadyAddedException;
+
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontacts.model.contact;
+
+import org.mxchange.jcontacts.model.contact.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
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@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.
+ * <p>
+ * @param emailAddress Email address to check
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact instance to check
+ * <p>
+ * @return Whether the found instance or null
+ */
+ Contact lookupContact (final Contact contact);
+
+ /**
+ * Updates given contact data
+ * <p>
+ * @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
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to update
+ * <p>
+ * @return Updated contact instance
+ */
+ Contact updateContactData (final Contact contact);
+
+ /**
+ * Returns a list of all found contacts
+ * <p>
+ * @return A list of call contacts
+ */
+ List<Contact> allContacts ();
+
+ /**
+ * Returns a list of all registered email addresses.
+ * <p>
+ * @return A list of all email addresses
+ */
+ List<String> allEmailAddresses ();
+
+ /**
+ * Returns a contact instance which has the given id number.
+ * <p>
+ * @param contactId Contact id
+ * <p>
+ * @return Contact instance
+ * <p>
+ * @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.
+ * <p>
+ * @param emailAddress Email address
+ * <p>
+ * @return Contact instance
+ * <p>
+ * @throws ContactNotFoundException If the contact was not found
+ */
+ Contact findContactByEmailAddress (final String emailAddress) throws ContactNotFoundException;
+
+}
--- /dev/null
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontacts.model.phone;
+
+import java.io.Serializable;
+import javax.ejb.Remote;
+import org.mxchange.jcontacts.model.contact.Contact;
+import org.mxchange.jphone.exceptions.PhoneNumberAlreadyLinkedException;
+import org.mxchange.jphone.exceptions.PhoneNumberNotLinkedException;
+import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
+import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
+
+/**
+ * A remote interface for administrative purposes around contact's phone numbers
+ * (any type).
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
+
+ /**
+ * Links existing fax number with given contact instance. The id number
+ * should be set.
+ * <p>
+ * @param contact Contact to link to
+ * @param faxNumber Fax number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to link to
+ * @param landLineNumber Land-line number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to link to
+ * @param mobileNumber Mobile number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to link to
+ * @param faxNumber Fax number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to link to
+ * @param landLineNumber Land-line number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to link to
+ * @param mobileNumber Mobile number to link
+ * <p>
+ * @return Updated contact
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to unlink mobile instance
+ * @param faxNumber Fax number being unlinked
+ * <p>
+ * @return Updated contact instance
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to unlink mobile instance
+ * @param landLineNumber Land-line number being unlinked
+ * <p>
+ * @return Updated contact instance
+ * <p>
+ * @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.
+ * <p>
+ * @param contact Contact to unlink mobile instance
+ * @param mobileNumber Mobile number being unlinked
+ * <p>
+ * @return Updated contact instance
+ * <p>
+ * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
+ * (null) with this contact
+ */
+ Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;
+
+}
+++ /dev/null
-/*
- * 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 <http://www.gnu.org/licenses/>.
- */
-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).
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface AdminContactsPhoneSessionBeanRemote extends Serializable {
-
- /**
- * Links existing fax number with given contact instance. The id number
- * should be set.
- * <p>
- * @param contact Contact to link to
- * @param faxNumber Fax number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to link to
- * @param landLineNumber Land-line number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to link to
- * @param mobileNumber Mobile number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to link to
- * @param faxNumber Fax number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to link to
- * @param landLineNumber Land-line number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to link to
- * @param mobileNumber Mobile number to link
- * <p>
- * @return Updated contact
- * <p>
- * @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.
- * <p>
- * @param contact Contact to unlink mobile instance
- * @param faxNumber Fax number being unlinked
- * <p>
- * @return Updated contact instance
- * <p>
- * @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.
- * <p>
- * @param contact Contact to unlink mobile instance
- * @param landLineNumber Land-line number being unlinked
- * <p>
- * @return Updated contact instance
- * <p>
- * @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.
- * <p>
- * @param contact Contact to unlink mobile instance
- * @param mobileNumber Mobile number being unlinked
- * <p>
- * @return Updated contact instance
- * <p>
- * @throws PhoneNumberNotLinkedException If a mobile instance is not linked
- * (null) with this contact
- */
- Contact unlinkMobileDataFromContact (final Contact contact, final DialableMobileNumber mobileNumber) throws PhoneNumberNotLinkedException;
-
-}