]> git.mxchange.org Git - jaddressbook-share-lib.git/commitdiff
this has been moved out from jaddressbook-lib
authorRoland Häder <roland@mxchange.org>
Thu, 27 Apr 2017 12:27:52 +0000 (14:27 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 27 Apr 2017 12:27:52 +0000 (14:27 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
build.xml
nbproject/build-impl.xml
nbproject/project.properties
nbproject/project.xml
src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java [deleted file]
src/org/mxchange/addressbook/model/shared/AddressbookShareSessionBeanRemote.java [new file with mode: 0644]
src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java [deleted file]

index 2be6f40c419f04e4224d04dc7fcad5c1f2904166..272fbc48010f80fff96b05d59de22b627d52e653 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -7,8 +7,8 @@
 <!-- the Compile on Save feature is turned off for the project. -->
 <!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
 <!-- in the project's Project Properties dialog box.-->
-<project name="jaddressbook-lib" default="default" basedir=".">
-    <description>Builds, tests, and runs the project jaddressbook-lib.</description>
+<project name="jaddressbook-share-lib" default="default" basedir=".">
+    <description>Builds, tests, and runs the project jaddressbook-share-lib.</description>
     <import file="nbproject/build-impl.xml"/>
     <!--
 
@@ -58,7 +58,7 @@
 
     An example of overriding the target for project execution could look like this:
 
-        <target name="run" depends="jaddressbook-lib-impl.jar">
+        <target name="run" depends="jaddressbook-share-lib-impl.jar">
             <exec dir="bin" executable="launcher.exe">
                 <arg file="${dist.jar}"/>
             </exec>
index 7feacd41d5e45f44f0bd0e5daa46976b1f7a143d..52e72cfad60e82d4837449e8a7e51855474c916a 100644 (file)
@@ -19,7 +19,7 @@ is divided into following sections:
   - cleanup
 
         -->
-<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jaddressbook-lib-impl">
+<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="jaddressbook-share-lib-impl">
     <fail message="Please build using Ant 1.8.0 or higher.">
         <condition>
             <not>
@@ -474,7 +474,7 @@ is divided into following sections:
                     </fileset>
                 </union>
                 <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
-                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="jaddressbook-lib" testname="TestNG tests" workingDir="${work.dir}">
+                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="jaddressbook-share-lib" testname="TestNG tests" workingDir="${work.dir}">
                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
                     <propertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -625,7 +625,7 @@ is divided into following sections:
                 <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
                     <isset property="test.method"/>
                 </condition>
-                <condition else="-suitename jaddressbook-lib -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                <condition else="-suitename jaddressbook-share-lib -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
                     <matches pattern=".*\.xml" string="@{testClass}"/>
                 </condition>
                 <delete dir="${build.test.results.dir}" quiet="true"/>
@@ -917,7 +917,7 @@ is divided into following sections:
         <delete file="${built-jar.properties}" quiet="true"/>
     </target>
     <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
-        <echo level="warn" message="Cycle detected: jaddressbook-lib was already built"/>
+        <echo level="warn" message="Cycle detected: jaddressbook-share-lib was already built"/>
     </target>
     <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
         <mkdir dir="${build.dir}"/>
@@ -1402,7 +1402,7 @@ is divided into following sections:
         <delete file="${built-clean.properties}" quiet="true"/>
     </target>
     <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
-        <echo level="warn" message="Cycle detected: jaddressbook-lib was already built"/>
+        <echo level="warn" message="Cycle detected: jaddressbook-share-lib was already built"/>
     </target>
     <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
         <mkdir dir="${build.dir}"/>
index 48242fee4285923b0ab7a993e30232e79134f260..f4797cc8312326bde8128f8f3806fc37e7a94680 100644 (file)
@@ -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/
index a47248c4356c1cf31221d91db93e325b5c3ab080..dce97ff0b1d9e17544e9523b367571763eafe40d 100644 (file)
@@ -3,7 +3,7 @@
     <type>org.netbeans.modules.java.j2seproject</type>
     <configuration>
         <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
-            <name>jaddressbook-lib</name>
+            <name>jaddressbook-share-lib</name>
             <source-roots>
                 <root id="src.dir"/>
             </source-roots>
diff --git a/src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java b/src/org/mxchange/addressbook/model/addressbook/AddressbookSessionBeanRemote.java
deleted file mode 100644 (file)
index 2c8dfc9..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-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
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface AddressbookSessionBeanRemote extends Serializable {
-
-       /**
-        * Retrieves a list of all users this user is not sharing the given address
-        * book with.
-        * <p>
-        * @param user User instance
-        * @param addressbook Address book instance
-        * <p>
-        * @return List of users
-        */
-       List<User> allUsersNotSharing (final User user, final Addressbook addressbook);
-
-       /**
-        * Count all shared address books by given user
-        * <p>
-        * @param user User instance
-        * <p>
-        * @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.
-        * <p>
-        * @param addressbookId Id number for address book instance
-        * <p>
-        * @return Address book instance
-        * <p>
-        * @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.
-        * <p>
-        * @param addressbook Address book instance
-        * <p>
-        * @return List of all entries
-        */
-       List<AddressbookEntry> allEntries (final Addressbook addressbook);
-
-       /**
-        * Some "getter" for a list of address books the logged-in user has created
-        * <p>
-        * @param loggedInUser Logged-in user
-        * <p>
-        * @return List of all address books
-        */
-       List<Addressbook> getUsersAddressbookList (final User loggedInUser);
-
-       /**
-        * Creates given address book by persisting it. A User instance must be set,
-        * else an exception is thrown.
-        * <p>
-        * @param addressbook Address book instance to create
-        * <p>
-        * @return Updated address book instance
-        * <p>
-        * @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).
-        * <p>
-        * @param addressbookId Address book id to check
-        * <p>
-        * @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.
-        * <p>
-        * @param addressbook Address bok instance to check
-        * <p>
-        * @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/AddressbookShareSessionBeanRemote.java b/src/org/mxchange/addressbook/model/shared/AddressbookShareSessionBeanRemote.java
new file mode 100644 (file)
index 0000000..191076c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.addressbook.model.shared;
+
+import java.io.Serializable;
+import java.util.List;
+import javax.ejb.Remote;
+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;
+
+/**
+ * A remote interface for sharing address books
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface AddressbookShareSessionBeanRemote extends Serializable {
+
+       /**
+        * Retrieves a list of all users this user is not sharing the given address
+        * book with.
+        * <p>
+        * @param user User instance
+        * @param addressbook Address book instance
+        * <p>
+        * @return List of users
+        */
+       List<User> allUsersNotSharing (final User user, final Addressbook addressbook);
+
+       /**
+        * Count all shared address books by given user
+        * <p>
+        * @param user User instance
+        * <p>
+        * @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
+        * only the shares. But the address books and sharee can be easily
+        * extracted.
+        * <p>
+        * @param user User instance to get list of shared address books (shares)
+        * from
+        * <p>
+        * @return List of shares (= shared address book entries)
+        */
+       List<ShareableAddressbook> allSharedAddressbooks (final User user);
+
+       /**
+        * Starts an address book share between currently logged-in user and
+        * assigned user for current address book.
+        * <p>
+        * @param sharee User sharee instance
+        * @param addressbook Address book instance
+        * <p>
+        * @return Updated share instance
+        * <p>
+        * @throws UserAlreadySharingAddressbookException When the user is already
+        * sharing the address book
+        */
+       ShareableAddressbook startSharing (final User sharee, final Addressbook addressbook) throws UserAlreadySharingAddressbookException;
+
+       /**
+        * Checks if the given user is sharing address books with others
+        * <p>
+        * @param user User instance
+        *
+        * @return Whether the user is sharing address books
+        */
+       Boolean isUserSharingAddressbooks (final User user);
+
+}
diff --git a/src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java b/src/org/mxchange/addressbook/model/shared/SharedAddressbooksSessionBeanRemote.java
deleted file mode 100644 (file)
index e27d89c..0000000
+++ /dev/null
@@ -1,70 +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 <http://www.gnu.org/licenses/>.
- */
-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.jusercore.model.user.User;
-
-/**
- * A remote interface for sharing address books
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface SharedAddressbooksSessionBeanRemote extends Serializable {
-
-       /**
-        * Retrieves a list of all user's shared address books. The list contains
-        * only the shares. But the address books and sharee can be easily
-        * extracted.
-        * <p>
-        * @param user User instance to get list of shared address books (shares)
-        * from
-        * <p>
-        * @return List of shares (= shared address book entries)
-        */
-       List<ShareableAddressbook> allSharedAddressbooks (final User user);
-
-       /**
-        * Starts an address book share between currently logged-in user and
-        * assigned user for current address book.
-        * <p>
-        * @param sharee User sharee instance
-        * @param addressbook Address book instance
-        * <p>
-        * @return Updated share instance
-        * <p>
-        * @throws UserAlreadySharingAddressbookException When the user is already
-        * sharing the address book
-        */
-       ShareableAddressbook startSharing (final User sharee, final Addressbook addressbook) throws UserAlreadySharingAddressbookException;
-
-       /**
-        * Checks if the given user is sharing address books with others
-        * <p>
-        * @param user User instance
-        *
-        * @return Whether the user is sharing address books
-        */
-       Boolean isUserSharingAddressbooks (final User user);
-
-}