* <p>
* @throws UserStatusConfirmedException If the user account is confirmed
* @throws UserStatusLockedException If the user account is locked
+ * @throws UserNotFoundException If the given User instance was not found
*/
- User confirmAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusLockedException;
+ User confirmAccount (final User user, final String baseUrl) throws UserStatusConfirmedException, UserStatusLockedException, UserNotFoundException;
/**
* Updates entity from given user instance and returns updated instance.
* @param user User instance to update
* <p>
* @return Updated user instance
+ * <p>
+ * @throws UserNotFoundException If the given User instance is not found
*/
- User updateUserData (final User user);
+ User updateUserData (final User user) throws UserNotFoundException;
/**
* Returns a list of all users. This is mostly suitable for administrative
*/
User updateUserPersonalData (final User user);
+ /**
+ * 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. You should only use this method within the
+ * EJB container as might cause a lot EJB method invocations and having a
+ * similar method implemented on your web container/Swing or console side
+ * with local cache is much better for overall performance.
+ * <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);
+
}