]> git.mxchange.org Git - juser-login-lib.git/commitdiff
created new project based on juser-lib to swap out login/registration stuff
authorRoland Häder <roland@mxchange.org>
Wed, 12 Jul 2017 19:02:54 +0000 (21:02 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 12 Jul 2017 19:04:10 +0000 (21:04 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
14 files changed:
build.xml
nbproject/build-impl.xml
nbproject/project.properties
nbproject/project.xml
src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/email_address/UserEmailChangeSessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistorySessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java [deleted file]
src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java [deleted file]
src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java [new file with mode: 0644]
src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java [new file with mode: 0644]
src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java [new file with mode: 0644]

index ce0b319d880d7a059256a2ed1c9a8f5c16ecb188..cf7cce4a04f80cccd11f611c4cf93a8ba7701726 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="juser-lib" default="default" basedir=".">
-    <description>Builds, tests, and runs the project juser-lib.</description>
+<project name="juser-login-lib" default="default" basedir=".">
+    <description>Builds, tests, and runs the project juser-login-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="juser-lib-impl.jar">
+        <target name="run" depends="juser-login-lib-impl.jar">
             <exec dir="bin" executable="launcher.exe">
                 <arg file="${dist.jar}"/>
             </exec>
index 7dcde0a1c365c6a48f97449b4e794d9613b72589..547a7ee91cfe25f45f4661b3e60c4136c33270c1 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="juser-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="juser-login-lib-impl">
     <fail message="Please build using Ant 1.8.0 or higher.">
         <condition>
             <not>
@@ -475,7 +475,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="juser-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="juser-login-lib" testname="TestNG tests" workingDir="${work.dir}">
                     <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
                     <propertyset>
                         <propertyref prefix="test-sys-prop."/>
@@ -626,7 +626,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 juser-lib -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
+                <condition else="-suitename juser-login-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"/>
@@ -918,7 +918,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: juser-lib was already built"/>
+        <echo level="warn" message="Cycle detected: juser-login-lib was already built"/>
     </target>
     <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
         <mkdir dir="${build.dir}"/>
@@ -1403,7 +1403,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: juser-lib was already built"/>
+        <echo level="warn" message="Cycle detected: juser-login-lib was already built"/>
     </target>
     <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
         <mkdir dir="${build.dir}"/>
index e0ca0b7479c9aa120bacd4d9a40423239084ea4a..ec8432caa2806b26e25a393bc0e20cd7f51cbec6 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=juser-lib
+application.title=juser-login-lib
 application.vendor=Roland H\u00e4der
 build.classes.dir=${build.dir}/classes
 build.classes.excludes=**/*.java,**/*.form
@@ -25,17 +25,19 @@ debug.test.classpath=\
 dist.archive.excludes=
 # This directory is removed when the project is cleaned:
 dist.dir=dist
-dist.jar=${dist.dir}/juser-lib.jar
+dist.jar=${dist.dir}/juser-login-lib.jar
 dist.javadoc.dir=${dist.dir}/javadoc
 endorsed.classpath=
 excludes=
 file.reference.juser-core.jar=lib/juser-core.jar
+file.reference.juser-login-core.jar=lib/juser-login-core.jar
 includes=**
 jar.archive.disabled=${jnlp.enabled}
 jar.compress=false
 jar.index=${jnlp.enabled}
 javac.classpath=\
     ${file.reference.juser-core.jar}:\
+    ${file.reference.juser-login-core.jar}:\
     ${libs.javaee-api-7.0.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
@@ -90,5 +92,6 @@ run.test.classpath=\
     ${build.test.classes.dir}
 source.encoding=UTF-8
 source.reference.juser-core.jar=../juser-core/src/
+source.reference.juser-login-core.jar=../juser-login-core/src/
 src.dir=src
 test.src.dir=test
index d716dce1c7446ecd068d59ecfed8a4002176a885..f5a0d2fcadbb759fc5c99babeaa60472fdf8489c 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>juser-lib</name>
+            <name>juser-login-lib</name>
             <source-roots>
                 <root id="src.dir"/>
             </source-roots>
diff --git a/src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java b/src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java
deleted file mode 100644 (file)
index e56410d..0000000
+++ /dev/null
@@ -1,54 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.login.user;
-
-import java.io.Serializable;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.container.login.LoginContainer;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserPasswordMismatchException;
-import org.mxchange.jusercore.exceptions.UserStatusLockedException;
-import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A remote interface for user login
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface UserLoginSessionBeanRemote extends Serializable {
-
-       /**
-        * Validates if the user is a confirmed account and returns the full user
-        * instance
-        * <p>
-        * @param container Login container holding user instance and clear-text password
-        * <p>
-        * @return Full confirmed user account
-        * <p>
-        * @throws org.mxchange.jusercore.exceptions.UserNotFoundException If the
-        * user account was not found
-        * @throws org.mxchange.jusercore.exceptions.UserStatusLockedException If
-        * the user account is locked
-        * @throws org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException
-        * If the user account is unconfirmed
-        * @throws org.mxchange.jusercore.exceptions.UserPasswordMismatchException
-        * If the password is not matching
-        */
-       User validateUserAccountStatus (final LoginContainer container) throws UserNotFoundException, UserStatusLockedException, UserStatusUnconfirmedException, UserPasswordMismatchException;
-}
diff --git a/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java
deleted file mode 100644 (file)
index c19070d..0000000
+++ /dev/null
@@ -1,103 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user;
-
-import java.io.Serializable;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
-import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
-import org.mxchange.jusercore.exceptions.UserStatusLockedException;
-import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
-
-/**
- * An interface for administrative user beans
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface AdminUserSessionBeanRemote extends Serializable {
-
-       /**
-        * Deletes given user instance
-        * <p>
-        * @param user User instance to delete
-        * @param userDeleteReason Delete reason
-        * <p>
-        * @throws UserNotFoundException If the user account is not found
-        */
-       void deleteUser (final User user, final String userDeleteReason) throws UserNotFoundException;
-
-       /**
-        * Locks given user account with given reason
-        * <p>
-        * @param user User account to be locked, must be status CONFIRMED
-        * @param userLockReason Lock reason
-        * @param baseUrl Base URL for all URLs
-        * <p>
-        * @return Updated (and detached) user instance
-        * <p>
-        * @throws UserStatusLockedException The account is already locked
-        * @throws UserStatusUnconfirmedException The account is not confirmed
-        * @throws UserNotFoundException The user account is not found
-        */
-       User lockUserAccount (final User user, final String userLockReason, final String baseUrl) throws UserStatusLockedException, UserStatusUnconfirmedException, UserNotFoundException;
-
-       /**
-        * Unlocks given user account
-        * <p>
-        * @param user User account to be unlocked, must be status LOCKED
-        * @param baseUrl Base URL for all URLs
-        * <p>
-        * @return Updated (and detached) user instance
-        * <p>
-        * @throws UserStatusConfirmedException The account is already locked
-        * @throws UserStatusUnconfirmedException The account is not confirmed
-        * @throws UserNotFoundException The user account is not found
-        */
-       User unlockUserAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusUnconfirmedException, UserNotFoundException;
-
-       /**
-        * Creates the user instance and links it with the set contact instance
-        * <p>
-        * @param user User instance to
-        * <p>
-        * @return Updated user instance
-        * <p>
-        * @throws UserNameAlreadyRegisteredException When the user name is already
-        * used
-        * @throws EmailAddressAlreadyRegisteredException When the email address is
-        * already used
-        */
-       User linkUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
-
-       /**
-        * Adds given user to database, if not found by user name or email address.
-        * <p>
-        * @param user User instance to add
-        * <p>
-        * @return Updated user instance
-        * <p>
-        * @throws UserNameAlreadyRegisteredException When the user name is already
-        * used
-        * @throws EmailAddressAlreadyRegisteredException When the email address is
-        * already used
-        */
-       User addUser (final User user) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
-
-}
diff --git a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java
deleted file mode 100644 (file)
index f590661..0000000
+++ /dev/null
@@ -1,194 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
-import org.mxchange.jusercore.exceptions.UserStatusLockedException;
-import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
-import org.mxchange.jusercore.model.user.password_history.PasswordHistory;
-
-/**
- * An interface for user beans
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface UserSessionBeanRemote extends Serializable {
-
-       /**
-        * Updates user's password (must be set encrypted before calling this
-        * method) and records the password change in user's password history.
-        * <p>
-        * @param user User instance with updated password
-        * @param baseUrl Base URL for all links
-        * <p>
-        * @return Password history entry with updated user instance
-        *
-        * @throws UserNotFoundException If the user is not found
-        * @throws UserStatusUnconfirmedException If the user status is unconfirmed
-        * @throws UserStatusLockedException If the user status is locked
-        */
-       PasswordHistory updateUserPassword (final User user, final String baseUrl) throws UserNotFoundException, UserStatusUnconfirmedException, UserStatusLockedException;
-
-       /**
-        * Changes the user' account status to CONFIRMED if the status is
-        * UNCONFIRMED, else propper exceptions are thrown.
-        * <p>
-        * @param user Unconfirmed user instance
-        * @param baseUrl Base URL
-        * <p>
-        * @return Updated user instance
-        * <p>
-        * @throws UserStatusConfirmedException If the user account is confirmed
-        * @throws UserStatusLockedException If the user account is locked
-        */
-       User confirmAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusLockedException;
-
-       /**
-        * Generates random user name that is available.
-        * <p>
-        * @return Generated user name
-        */
-       String generateRandomUserName ();
-
-       /**
-        * Updates entiity from given user instance and returns updated instance.
-        * <p>
-        * @param user User instance to update
-        * <p>
-        * @return Updated user instance
-        */
-       User updateUserData (final User user);
-
-       /**
-        * Find user by given user id and returns fetched instance. If the user is
-        * not found, an exception is thrown.
-        * <p>
-        * @param userId User id
-        * <p>
-        * @return User instance
-        *
-        * @throws org.mxchange.jusercore.exceptions.UserNotFoundException If the
-        * user is not found
-        */
-       User findUserById (final Long userId) throws UserNotFoundException;
-
-       /**
-        * Returns a list of all users. This is mostly suitable for administrative
-        * interfaces.
-        * <p>
-        * @return A list of all users
-        */
-       List<User> allUsers ();
-
-       /**
-        * Returns a list with all public and member-visible users. Members are
-        * logged-in users. ;-)
-        * <p>
-        * @return A list of public and member-visible users
-        */
-       List<User> allMemberPublicVisibleUsers ();
-
-       /**
-        * Returns a list of all public user profiles
-        * <p>
-        * @return A list of all public user profiles
-        */
-       List<User> allPublicUsers ();
-
-       /**
-        * Fills given user instance with all available data
-        * <p>
-        * @param user Initial User instance
-        * <p>
-        * @return Prepared User instance
-        */
-       User fillUserData (final User user);
-
-       /**
-        * Some "getter" for a full user name list
-        * <p>
-        * @return User name list
-        */
-       List<String> getUserNameList ();
-
-       /**
-        * Some "getter" for a full email address list
-        * <p>
-        * @return User name list
-        */
-       List<String> getEmailAddressList ();
-
-       /**
-        * Checks if given user id exists
-        * <p>
-        * @param userId User id to check
-        * <p>
-        * @return Whether the user id exists
-        */
-       boolean ifUserIdExists (final Long userId);
-
-       /**
-        * Checks if given user name is already used
-        * <p>
-        * @param userName User name to check
-        * <p>
-        * @return Whether given user name is found
-        */
-       boolean ifUserNameExists (final String userName);
-
-       /**
-        * Checks if given user exists
-        * <p>
-        * @param user User to check
-        * <p>
-        * @return Whether the user exists
-        */
-       boolean ifUserExists (final User user);
-
-       /**
-        * Checks if the the given user's name is already registered
-        * <p>
-        * @param user User instance
-        * <p>
-        * @return Whether the user is already registered
-        */
-       boolean isUserNameRegistered (final User user);
-
-       /**
-        * Checks if the the given user's email address is already registered
-        * <p>
-        * @param user User instance
-        * <p>
-        * @return Whether the user is already registered
-        */
-       boolean isEmailAddressRegistered (final User user);
-
-       /**
-        * Updates given user instance in database
-        * <p>
-        * @param user User instance to update
-        * <p>
-        * @return Updated user instance (detached)
-        */
-       User updateUserPersonalData (final User user);
-
-}
diff --git a/src/org/mxchange/jusercore/model/user/email_address/UserEmailChangeSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/email_address/UserEmailChangeSessionBeanRemote.java
deleted file mode 100644 (file)
index 36aea74..0000000
+++ /dev/null
@@ -1,63 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user.email_address;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
-
-/**
- * A remote interface for changing email addresses
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface UserEmailChangeSessionBeanRemote extends Serializable {
-
-       /**
-        * Checks whether given email address is already enqueued
-        * <p>
-        * @param emailAddress Email address to check
-        * <p>
-        * @return Whether the email address has already been enqueued
-        */
-       boolean isEmailAddressEnqueued (final String emailAddress);
-
-       /**
-        * Returns a list of all queued email addresses, not limited to a user
-        * <p>
-        * @return A list of all queued email addresses
-        */
-       List<String> allQueuedAddresses ();
-
-       /**
-        * "Enqueues" given email change object
-        * <p>
-        * @param emailChange Email change instance to insert
-        * @param baseUrl Base URL
-        */
-       void enqueueEmailAddressForChange (final ChangeableEmailAddress emailChange, final String baseUrl);
-
-       /**
-        * Updates given user's email address.
-        * <p>
-        * @param emailChange Email change instance to mark as used
-        */
-       void updateEmailAddress (final ChangeableEmailAddress emailChange);
-
-}
diff --git a/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistorySessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistorySessionBeanRemote.java
deleted file mode 100644 (file)
index 9ecce09..0000000
+++ /dev/null
@@ -1,44 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user.password_history;
-
-import java.io.Serializable;
-import java.util.List;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A remote interface for user's password history
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface UserPasswordHistorySessionBeanRemote extends Serializable {
-
-       /**
-        * Returns a list of user's password history entries ("unlimited"). The
-        * application then should limit the amount by itself for its specific
-        * purpose. If the user has never changed password, an empty list is being
-        * returned.
-        * <p>
-        * @param user User instance to get all password histories for
-        * <p>
-        * @return List of all user's password history
-        */
-       List<PasswordHistory> getUserPasswordHistory (final User user);
-
-}
diff --git a/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java
deleted file mode 100644 (file)
index 817d05f..0000000
+++ /dev/null
@@ -1,78 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user.register;
-
-import java.io.Serializable;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
-import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A remote interface for user registration
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface UserRegistrationSessionBeanRemote extends Serializable {
-
-       /**
-        * Generates a non-existing confirmation key for given user instance. The
-        * user instance is being used as entropy source to make the key more harder
-        * to "guess".
-        * <p>
-        * @param user User instance
-        * <p>
-        * @return Non-existing confirmation key
-        */
-       String generateConfirmationKey (User user);
-
-       /**
-        * Registers given user data, if not yet found
-        * <p>
-        * @param user           User instance to register
-        * @param baseUrl        Base URL
-        * @param randomPassword A randomly-generated password or NULL if user had
-        *                       to enter it.
-        * <p>
-        * @return The fully registered user account
-        * <p>
-        * @throws UserNameAlreadyRegisteredException If the user name has already
-        * been registered
-        * @throws EmailAddressAlreadyRegisteredException If the email address has
-        * already been registered
-        */
-       User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
-
-       /**
-        * Checks if the user's name is already registered
-        * <p>
-        * @param user User instance to check
-        * <p>
-        * @return Whether the user's name has already been registered
-        */
-       boolean isUserNameRegistered (final User user);
-
-       /**
-        * Checks if the user's email address is already registered
-        * <p>
-        * @param user User instance to check
-        * <p>
-        * @return Whether the user's email address has already been registered
-        */
-       boolean isEmailAddressRegistered (final User user);
-}
diff --git a/src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java
deleted file mode 100644 (file)
index dcd1332..0000000
+++ /dev/null
@@ -1,54 +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 <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jusercore.model.user.resendlink;
-
-import java.io.Serializable;
-import java.util.Locale;
-import javax.ejb.Remote;
-import org.mxchange.jusercore.exceptions.UserNotFoundException;
-import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
-import org.mxchange.jusercore.exceptions.UserStatusLockedException;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A remote interface for resending confirmation link.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Remote
-public interface ResendLinkSessionBeanRemote extends Serializable {
-
-       /**
-        * Send confirmation link out to given user and returns a proper redirection
-        * target. The user's account status should be UNCONFIRMED and should
-        * contain a confirmation key. After confirmation the account's status
-        * should be changed to CONFIRMED and the key removed (nulled).
-        * <p>
-        * @param user    User instance
-        * @param locale  Locale instance
-        * @param baseUrl Base URL
-        * <p>
-        * @return Updated (aka "managed") instance with new confirmation key
-        *
-        * @throws UserNotFoundException If the user's account was not found
-        * @throws UserStatusLockedException If the user's account is locked
-        * @throws UserStatusConfirmedException If the user's account is already
-        * confirmed
-        */
-       User resendConfirmationLink (final User user, final Locale locale, final String baseUrl) throws UserNotFoundException, UserStatusLockedException, UserStatusConfirmedException;
-
-}
diff --git a/src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java
new file mode 100644 (file)
index 0000000..4d2cc0c
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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.juserlogincore.model.login.user;
+
+import java.io.Serializable;
+import javax.ejb.Remote;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.exceptions.UserStatusLockedException;
+import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
+import org.mxchange.jusercore.model.user.User;
+import org.mxchange.juserlogincore.container.login.LoginContainer;
+import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
+
+/**
+ * A remote interface for user login
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface UserLoginSessionBeanRemote extends Serializable {
+
+       /**
+        * Validates if the user is a confirmed account and returns the full user
+        * instance
+        * <p>
+        * @param container Login container holding user instance and clear-text password
+        * <p>
+        * @return Full confirmed user account
+        * <p>
+        * @throws org.mxchange.jusercore.exceptions.UserNotFoundException If the
+        * user account was not found
+        * @throws org.mxchange.jusercore.exceptions.UserStatusLockedException If
+        * the user account is locked
+        * @throws org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException
+        * If the user account is unconfirmed
+        * @throws org.mxchange.jusercore.exceptions.UserPasswordMismatchException
+        * If the password is not matching
+        */
+       User validateUserAccountStatus (final LoginContainer container) throws UserNotFoundException, UserStatusLockedException, UserStatusUnconfirmedException, UserPasswordMismatchException;
+}
diff --git a/src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java
new file mode 100644 (file)
index 0000000..55517b1
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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.juserlogincore.model.user.register;
+
+import java.io.Serializable;
+import javax.ejb.Remote;
+import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
+import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A remote interface for user registration
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface UserRegistrationSessionBeanRemote extends Serializable {
+
+       /**
+        * Generates a non-existing confirmation key for given user instance. The
+        * user instance is being used as entropy source to make the key more harder
+        * to "guess".
+        * <p>
+        * @param user User instance
+        * <p>
+        * @return Non-existing confirmation key
+        */
+       String generateConfirmationKey (User user);
+
+       /**
+        * Registers given user data, if not yet found
+        * <p>
+        * @param user           User instance to register
+        * @param baseUrl        Base URL
+        * @param randomPassword A randomly-generated password or NULL if user had
+        *                       to enter it.
+        * <p>
+        * @return The fully registered user account
+        * <p>
+        * @throws UserNameAlreadyRegisteredException If the user name has already
+        * been registered
+        * @throws EmailAddressAlreadyRegisteredException If the email address has
+        * already been registered
+        */
+       User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException;
+
+       /**
+        * Checks if the user's name is already registered
+        * <p>
+        * @param user User instance to check
+        * <p>
+        * @return Whether the user's name has already been registered
+        */
+       boolean isUserNameRegistered (final User user);
+
+       /**
+        * Checks if the user's email address is already registered
+        * <p>
+        * @param user User instance to check
+        * <p>
+        * @return Whether the user's email address has already been registered
+        */
+       boolean isEmailAddressRegistered (final User user);
+}
diff --git a/src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java
new file mode 100644 (file)
index 0000000..2e4e475
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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.juserlogincore.model.user.resendlink;
+
+import java.io.Serializable;
+import java.util.Locale;
+import javax.ejb.Remote;
+import org.mxchange.jusercore.exceptions.UserNotFoundException;
+import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
+import org.mxchange.jusercore.exceptions.UserStatusLockedException;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A remote interface for resending confirmation link.
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Remote
+public interface ResendLinkSessionBeanRemote extends Serializable {
+
+       /**
+        * Send confirmation link out to given user and returns a proper redirection
+        * target. The user's account status should be UNCONFIRMED and should
+        * contain a confirmation key. After confirmation the account's status
+        * should be changed to CONFIRMED and the key removed (nulled).
+        * <p>
+        * @param user    User instance
+        * @param locale  Locale instance
+        * @param baseUrl Base URL
+        * <p>
+        * @return Updated (aka "managed") instance with new confirmation key
+        *
+        * @throws UserNotFoundException If the user's account was not found
+        * @throws UserStatusLockedException If the user's account is locked
+        * @throws UserStatusConfirmedException If the user's account is already
+        * confirmed
+        */
+       User resendConfirmationLink (final User user, final Locale locale, final String baseUrl) throws UserNotFoundException, UserStatusLockedException, UserStatusConfirmedException;
+
+}