From 45908c8c77e54e6ef66f81b4949b1b2a2af557c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 12 Jul 2017 21:02:54 +0200 Subject: [PATCH] created new project based on juser-lib to swap out login/registration stuff 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 | 7 +- nbproject/project.xml | 2 +- .../user/AdminUserSessionBeanRemote.java | 103 ---------- .../model/user/UserSessionBeanRemote.java | 194 ------------------ .../UserEmailChangeSessionBeanRemote.java | 63 ------ .../UserPasswordHistorySessionBeanRemote.java | 44 ---- .../user/UserLoginSessionBeanRemote.java | 6 +- .../UserRegistrationSessionBeanRemote.java | 2 +- .../ResendLinkSessionBeanRemote.java | 2 +- 11 files changed, 19 insertions(+), 420 deletions(-) delete mode 100644 src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java delete mode 100644 src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java delete mode 100644 src/org/mxchange/jusercore/model/user/email_address/UserEmailChangeSessionBeanRemote.java delete mode 100644 src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistorySessionBeanRemote.java rename src/org/mxchange/{jusercore => juserlogincore}/model/login/user/UserLoginSessionBeanRemote.java (91%) rename src/org/mxchange/{jusercore => juserlogincore}/model/user/register/UserRegistrationSessionBeanRemote.java (97%) rename src/org/mxchange/{jusercore => juserlogincore}/model/user/resendlink/ResendLinkSessionBeanRemote.java (97%) diff --git a/build.xml b/build.xml index ce0b319..cf7cce4 100644 --- a/build.xml +++ b/build.xml @@ -7,8 +7,8 @@ - - Builds, tests, and runs the project juser-lib. + + Builds, tests, and runs the project juser-login-lib. - + @@ -475,7 +475,7 @@ is divided into following sections: - + @@ -626,7 +626,7 @@ is divided into following sections: - + @@ -918,7 +918,7 @@ is divided into following sections: - + @@ -1403,7 +1403,7 @@ is divided into following sections: - + diff --git a/nbproject/project.properties b/nbproject/project.properties index e0ca0b7..ec8432c 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=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 diff --git a/nbproject/project.xml b/nbproject/project.xml index d716dce..f5a0d2f 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -3,7 +3,7 @@ org.netbeans.modules.java.j2seproject - juser-lib + juser-login-lib diff --git a/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java deleted file mode 100644 index c19070d..0000000 --- a/src/org/mxchange/jusercore/model/user/AdminUserSessionBeanRemote.java +++ /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 . - */ -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 - *

- * @author Roland Häder - */ -@Remote -public interface AdminUserSessionBeanRemote extends Serializable { - - /** - * Deletes given user instance - *

- * @param user User instance to delete - * @param userDeleteReason Delete reason - *

- * @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 - *

- * @param user User account to be locked, must be status CONFIRMED - * @param userLockReason Lock reason - * @param baseUrl Base URL for all URLs - *

- * @return Updated (and detached) user instance - *

- * @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 - *

- * @param user User account to be unlocked, must be status LOCKED - * @param baseUrl Base URL for all URLs - *

- * @return Updated (and detached) user instance - *

- * @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 - *

- * @param user User instance to - *

- * @return Updated user instance - *

- * @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. - *

- * @param user User instance to add - *

- * @return Updated user instance - *

- * @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 index f590661..0000000 --- a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java +++ /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 . - */ -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 - *

- * @author Roland Häder - */ -@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. - *

- * @param user User instance with updated password - * @param baseUrl Base URL for all links - *

- * @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. - *

- * @param user Unconfirmed user instance - * @param baseUrl Base URL - *

- * @return Updated user instance - *

- * @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. - *

- * @return Generated user name - */ - String generateRandomUserName (); - - /** - * Updates entiity from given user instance and returns updated instance. - *

- * @param user User instance to update - *

- * @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. - *

- * @param userId User id - *

- * @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. - *

- * @return A list of all users - */ - List allUsers (); - - /** - * Returns a list with all public and member-visible users. Members are - * logged-in users. ;-) - *

- * @return A list of public and member-visible users - */ - List allMemberPublicVisibleUsers (); - - /** - * Returns a list of all public user profiles - *

- * @return A list of all public user profiles - */ - List allPublicUsers (); - - /** - * Fills given user instance with all available data - *

- * @param user Initial User instance - *

- * @return Prepared User instance - */ - User fillUserData (final User user); - - /** - * Some "getter" for a full user name list - *

- * @return User name list - */ - List getUserNameList (); - - /** - * Some "getter" for a full email address list - *

- * @return User name list - */ - List getEmailAddressList (); - - /** - * Checks if given user id exists - *

- * @param userId User id to check - *

- * @return Whether the user id exists - */ - boolean ifUserIdExists (final Long userId); - - /** - * Checks if given user name is already used - *

- * @param userName User name to check - *

- * @return Whether given user name is found - */ - boolean ifUserNameExists (final String userName); - - /** - * Checks if given user exists - *

- * @param user User to check - *

- * @return Whether the user exists - */ - boolean ifUserExists (final User user); - - /** - * Checks if the the given user's name is already registered - *

- * @param user User instance - *

- * @return Whether the user is already registered - */ - boolean isUserNameRegistered (final User user); - - /** - * Checks if the the given user's email address is already registered - *

- * @param user User instance - *

- * @return Whether the user is already registered - */ - boolean isEmailAddressRegistered (final User user); - - /** - * Updates given user instance in database - *

- * @param user User instance to update - *

- * @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 index 36aea74..0000000 --- a/src/org/mxchange/jusercore/model/user/email_address/UserEmailChangeSessionBeanRemote.java +++ /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 . - */ -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 - *

- * @author Roland Häder - */ -@Remote -public interface UserEmailChangeSessionBeanRemote extends Serializable { - - /** - * Checks whether given email address is already enqueued - *

- * @param emailAddress Email address to check - *

- * @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 - *

- * @return A list of all queued email addresses - */ - List allQueuedAddresses (); - - /** - * "Enqueues" given email change object - *

- * @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. - *

- * @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 index 9ecce09..0000000 --- a/src/org/mxchange/jusercore/model/user/password_history/UserPasswordHistorySessionBeanRemote.java +++ /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 . - */ -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 - *

- * @author Roland Häder - */ -@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. - *

- * @param user User instance to get all password histories for - *

- * @return List of all user's password history - */ - List getUserPasswordHistory (final User user); - -} diff --git a/src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java similarity index 91% rename from src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java rename to src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java index e56410d..4d2cc0c 100644 --- a/src/org/mxchange/jusercore/model/login/user/UserLoginSessionBeanRemote.java +++ b/src/org/mxchange/juserlogincore/model/login/user/UserLoginSessionBeanRemote.java @@ -14,16 +14,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.login.user; +package org.mxchange.juserlogincore.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; +import org.mxchange.juserlogincore.container.login.LoginContainer; +import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException; /** * A remote interface for user login diff --git a/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java similarity index 97% rename from src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java rename to src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java index 817d05f..55517b1 100644 --- a/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java +++ b/src/org/mxchange/juserlogincore/model/user/register/UserRegistrationSessionBeanRemote.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.user.register; +package org.mxchange.juserlogincore.model.user.register; import java.io.Serializable; import javax.ejb.Remote; diff --git a/src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java b/src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java similarity index 97% rename from src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java rename to src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java index dcd1332..2e4e475 100644 --- a/src/org/mxchange/jusercore/model/user/resendlink/ResendLinkSessionBeanRemote.java +++ b/src/org/mxchange/juserlogincore/model/user/resendlink/ResendLinkSessionBeanRemote.java @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.mxchange.jusercore.model.user.resendlink; +package org.mxchange.juserlogincore.model.user.resendlink; import java.io.Serializable; import java.util.Locale; -- 2.39.5