From: Roland Häder Date: Thu, 22 Jun 2017 20:36:49 +0000 (+0200) Subject: Continued a bit: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1998d4a8e7e0cc637e2fde0048b3dcce19a9d968;p=juser-login-lib.git Continued a bit: - a randomly-generated password is now accepted to show it in mail. - moved to proper package as this is user-related registration Signed-off-by: Roland Häder --- diff --git a/src/org/mxchange/jusercore/model/register/UserRegistrationSessionBeanRemote.java b/src/org/mxchange/jusercore/model/register/UserRegistrationSessionBeanRemote.java deleted file mode 100644 index e701d29..0000000 --- a/src/org/mxchange/jusercore/model/register/UserRegistrationSessionBeanRemote.java +++ /dev/null @@ -1,76 +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.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 registtration - *

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

- * @param user User instance - *

- * @return Non-existing confirmation key - */ - String generateConfirmationKey (User user); - - /** - * Registers given user data, if not yet found - *

- * @param user User instance to register - * @param baseUrl Base URL - *

- * @return The fully registered user account - *

- * @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) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException; - - /** - * Checks if the user's name is already registered - *

- * @param user User instance to check - *

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

- * @param user User instance to check - *

- * @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/register/UserRegistrationSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java new file mode 100644 index 0000000..817d05f --- /dev/null +++ b/src/org/mxchange/jusercore/model/user/register/UserRegistrationSessionBeanRemote.java @@ -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 . + */ +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 + *

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

+ * @param user User instance + *

+ * @return Non-existing confirmation key + */ + String generateConfirmationKey (User user); + + /** + * Registers given user data, if not yet found + *

+ * @param user User instance to register + * @param baseUrl Base URL + * @param randomPassword A randomly-generated password or NULL if user had + * to enter it. + *

+ * @return The fully registered user account + *

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

+ * @param user User instance to check + *

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

+ * @param user User instance to check + *

+ * @return Whether the user's email address has already been registered + */ + boolean isEmailAddressRegistered (final User user); +}