From: Roland Haeder Date: Fri, 15 Apr 2016 12:23:41 +0000 (+0200) Subject: added new business method findUserById() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c199732fe6575edde119bab476fd75c6719b084;p=juser-login-lib.git added new business method findUserById() --- diff --git a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java index 49ace59..de17843 100644 --- a/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java +++ b/src/org/mxchange/jusercore/model/user/UserSessionBeanRemote.java @@ -21,6 +21,7 @@ import java.util.List; import javax.ejb.Remote; import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException; import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; +import org.mxchange.jusercore.exceptions.UserNotFoundException; /** * An interface for user beans @@ -30,12 +31,25 @@ import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException; @Remote public interface UserSessionBeanRemote extends Serializable { + /** + * 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; + /** * 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 org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException When the user name is already used * @throws org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException When the email address is already used */