From 46f581603e4dee970688daadce4cb470c3df7e16 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 27 Apr 2017 14:27:52 +0200 Subject: [PATCH] this has been moved out from jaddressbook-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 | 9 +- nbproject/project.xml | 2 +- .../AddressbookSessionBeanRemote.java | 121 ------------------ ...=> AddressbookShareSessionBeanRemote.java} | 28 +++- 6 files changed, 39 insertions(+), 137 deletions(-) delete mode 100644 src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java rename src/org/mxchange/addressbook/model/shared/{SharedAddressbooksSessionBeanRemote.java => AddressbookShareSessionBeanRemote.java} (71%) diff --git a/build.xml b/build.xml index 2be6f40..272fbc4 100644 --- a/build.xml +++ b/build.xml @@ -7,8 +7,8 @@ - - Builds, tests, and runs the project jaddressbook-lib. + + Builds, tests, and runs the project jaddressbook-share-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 48242fe..f4797cc 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=jaddressbook-lib +application.title=jaddressbook-share-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,11 +26,12 @@ debug.test.classpath=\ dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist -dist.jar=${dist.dir}/jaddressbook-lib.jar +dist.jar=${dist.dir}/jaddressbook-share-lib.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= file.reference.jaddressbook-core.jar=lib/jaddressbook-core.jar +file.reference.jaddressbook-share-core.jar=lib/jaddressbook-share-core.jar file.reference.jcontacts-business-core.jar=lib/jcontacts-business-core.jar file.reference.jcontacts-core.jar=lib/jcontacts-core.jar file.reference.juser-core.jar=lib/juser-core.jar @@ -43,6 +44,7 @@ javac.classpath=\ ${file.reference.jcontacts-business-core.jar}:\ ${file.reference.juser-core.jar}:\ ${file.reference.jaddressbook-core.jar}:\ + ${file.reference.jaddressbook-share-core.jar}:\ ${libs.javaee-api-7.0.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation @@ -67,7 +69,7 @@ javadoc.private=true javadoc.splitindex=true javadoc.use=true javadoc.version=true -javadoc.windowtitle=Addressbook Library +javadoc.windowtitle=Addressbook-Share Remote Interfaces jnlp.codebase.type=no.codebase jnlp.descriptor=application jnlp.enabled=false @@ -98,6 +100,7 @@ run.test.classpath=\ ${build.test.classes.dir} source.encoding=UTF-8 source.reference.jaddressbook-core.jar=../jaddressbook-core/src/ +source.reference.jaddressbook-share-core.jar=../jaddressbook-share-core/src source.reference.jcontacts-business-core.jar=../jcontacts-business-core/src/ source.reference.jcontacts-core.jar=../jcontacts-core/src/ source.reference.juser-core.jar=../juser-core/src/ diff --git a/nbproject/project.xml b/nbproject/project.xml index a47248c..dce97ff 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.java.j2seproject - jaddressbook-lib + jaddressbook-share-lib diff --git a/src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java b/src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java deleted file mode 100644 index 2c8dfc9..0000000 --- a/src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (C) 2016 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.addressbook.model.addressbook; - -import java.io.Serializable; -import java.util.List; -import javax.ejb.Remote; -import org.mxchange.jaddressbookcore.exceptions.AddressbookNameAlreadyUsedException; -import org.mxchange.jaddressbookcore.exceptions.AddressbookNotFoundException; -import org.mxchange.jaddressbookcore.model.addressbook.Addressbook; -import org.mxchange.jaddressbookcore.model.addressbook.entry.AddressbookEntry; -import org.mxchange.jusercore.model.user.User; - -/** - * A remote session interface for addressbook handling - *

- * @author Roland Häder - */ -@Remote -public interface AddressbookSessionBeanRemote extends Serializable { - - /** - * Retrieves a list of all users this user is not sharing the given address - * book with. - *

- * @param user User instance - * @param addressbook Address book instance - *

- * @return List of users - */ - List allUsersNotSharing (final User user, final Addressbook addressbook); - - /** - * Count all shared address books by given user - *

- * @param user User instance - *

- * @return Count of all user's shared address books - */ - Integer countAllUserSharedAddressbooks (final User user); - - /** - * Some getter for an address book instance from given id number. If the - * address book is not found, an exception is thrown. - *

- * @param addressbookId Id number for address book instance - *

- * @return Address book instance - *

- * @throws AddressbookNotFoundException If the address book cannot be found - * by given id number - * @throws NullPointerException If addressbookId is null - * @throws IllegalArgumentException If the id number is below 1 - */ - Addressbook getAddressbookById (final Long addressbookId) throws AddressbookNotFoundException; - - /** - * Returns a list of all entries of given address book, whether the assigned - * user is the "owner" or "sharer" of the entry. - *

- * @param addressbook Address book instance - *

- * @return List of all entries - */ - List allEntries (final Addressbook addressbook); - - /** - * Some "getter" for a list of address books the logged-in user has created - *

- * @param loggedInUser Logged-in user - *

- * @return List of all address books - */ - List getUsersAddressbookList (final User loggedInUser); - - /** - * Creates given address book by persisting it. A User instance must be set, - * else an exception is thrown. - *

- * @param addressbook Address book instance to create - *

- * @return Updated address book instance - *

- * @throws AddressbookNameAlreadyUsedException If the address book's name - * has already been used by the user. - */ - Addressbook createAddressbook (final Addressbook addressbook) throws AddressbookNameAlreadyUsedException; - - /** - * Checks whether the given address book id is used (means available). - *

- * @param addressbookId Address book id to check - *

- * @return Whether the id is valid - */ - boolean isAddressbookIdUsed (final Long addressbookId); - - /** - * Checks if the given address book's name is already used by the user. - *

- * @param addressbook Address bok instance to check - *

- * @return Whether the name has already been used by the user - */ - boolean isAddressbookNameUsed (final Addressbook addressbook); - -} diff --git a/src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java b/src/org/mxchange/addressbook/model/shared/AddressbookShareSessionBeanRemote.java similarity index 71% rename from src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java rename to src/org/mxchange/addressbook/model/shared/AddressbookShareSessionBeanRemote.java index e27d89c..191076c 100644 --- a/src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java +++ b/src/org/mxchange/addressbook/model/shared/AddressbookShareSessionBeanRemote.java @@ -19,9 +19,9 @@ package org.mxchange.addressbook.model.shared; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jaddressbookcore.exceptions.UserAlreadySharingAddressbookException; -import org.mxchange.jaddressbookcore.model.addressbook.Addressbook; -import org.mxchange.jaddressbookcore.model.addressbook.shared.ShareableAddressbook; +import org.mxchange.jaddressbook.model.addressbook.Addressbook; +import org.mxchange.jaddressbookshare.exceptions.UserAlreadySharingAddressbookException; +import org.mxchange.jaddressbookshare.model.addressbook.shared.ShareableAddressbook; import org.mxchange.jusercore.model.user.User; /** @@ -30,7 +30,27 @@ import org.mxchange.jusercore.model.user.User; * @author Roland Häder */ @Remote -public interface SharedAddressbooksSessionBeanRemote extends Serializable { +public interface AddressbookShareSessionBeanRemote extends Serializable { + + /** + * Retrieves a list of all users this user is not sharing the given address + * book with. + *

+ * @param user User instance + * @param addressbook Address book instance + *

+ * @return List of users + */ + List allUsersNotSharing (final User user, final Addressbook addressbook); + + /** + * Count all shared address books by given user + *

+ * @param user User instance + *

+ * @return Count of all user's shared address books + */ + Integer countAllUserSharedAddressbooks (final User user); /** * Retrieves a list of all user's shared address books. The list contains -- 2.39.5