From 5cbaefe7a6c62dd6fca7709a1fdea6e5f4f71b8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 26 Apr 2016 10:40:34 +0200 Subject: [PATCH] added business method isContactFound() --- .../contact/ContactSessionBeanRemote.java | 150 ++++++++++-------- 1 file changed, 81 insertions(+), 69 deletions(-) diff --git a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java index 66550fc..0641451 100644 --- a/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java +++ b/src/org/mxchange/jcontacts/contact/ContactSessionBeanRemote.java @@ -1,69 +1,81 @@ -/* - * Copyright (C) 2016 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.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 Haeder - */ -@Remote -public interface ContactSessionBeanRemote extends Serializable { - - /** - * Updates given contact data - *

- * @param contact Contact data to update - * @param isCellphoneUnlinked Whether a cellphone 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 isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked); - - /** - * 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; - -} +/* + * Copyright (C) 2016 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.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 Haeder + */ +@Remote +public interface ContactSessionBeanRemote extends Serializable { + + /** + * Checks if the given contact can be found by checking the whole list. + *

+ * @param contact Contact instance to check + *

+ * @return Whether there is already an entry + */ + boolean isContactFound (final Contact contact); + + /** + * Updates given contact data + *

+ * @param contact Contact data to update + * @param isCellphoneUnlinked Whether a cellphone 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 isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked); + + /** + * 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; + +} -- 2.39.5