| Constructor and Description |
|---|
UserEJB() |
| Modifier and Type | Method and Description |
|---|---|
void |
acceptOrRejectFriendRequest(String friendLogin,
boolean acceptFriendShip)
Accept or reject friend's request
Friendship |
void |
cancelFriendship(String friendLogin)
Cancel
Friendship by user |
Long |
countUnreadNotifications()
Count the unread
UserNotifications by the current User. |
List<es.uvigo.esei.dgss.letta.domain.entities.Friendship> |
friendRequestList()
Find the fiends request
Friendship |
Optional<es.uvigo.esei.dgss.letta.domain.entities.User> |
get(String login)
Retrieves the
User associated with the received login name,
returned as an Optional value that will be empty if the user is
not found. |
Optional<es.uvigo.esei.dgss.letta.domain.entities.User> |
getByEmail(String email)
Retrieves the
User associated with the received email, returned
as an Optional value that will be empty if the user is not found. |
es.uvigo.esei.dgss.letta.domain.entities.Friendship |
getFriend(String loginFriend)
Get the friend
User by the current User. |
List<es.uvigo.esei.dgss.letta.domain.entities.Friendship> |
getFriendRequestBeSentByUserList()
Get all friend' requests be sent
Friendship |
es.uvigo.esei.dgss.letta.domain.entities.Friendship |
getFriendship(String loginFriend)
Get the friend
User by the current User. |
es.uvigo.esei.dgss.letta.domain.entities.UserNotifications |
getNotification(int notificationId)
Find a
UserNotifications in the database. |
List<es.uvigo.esei.dgss.letta.domain.entities.UserNotifications> |
getNotifications()
Get all the
UserNotifications by the current User. |
List<es.uvigo.esei.dgss.letta.domain.entities.User> |
getUsers()
Gets all the
User in the database. |
void |
registerUser(es.uvigo.esei.dgss.letta.domain.entities.Registration registration)
Register an user
|
es.uvigo.esei.dgss.letta.domain.entities.Registration |
registrationWithLogin(String login)
Finds a registration by login
|
void |
removeFriendship(String friendLogin)
Remove
Friendship from database |
void |
removeUser(String login)
Remove the
User in the database. |
List<es.uvigo.esei.dgss.letta.domain.entities.User> |
searchUser(String keyword)
Search the user
User by full name |
void |
sendRequest(String friendLogin)
Make
Friendship in the database. |
es.uvigo.esei.dgss.letta.domain.entities.User |
update(es.uvigo.esei.dgss.letta.domain.entities.User user) |
boolean |
userConfirmation(String uuid)
Confirms a user registration
|
es.uvigo.esei.dgss.letta.domain.entities.User |
userWithLogin(String login)
Deprecated.
Consider using
get(String) instead, as it
already checks the failure case where the User is not
found, by returning it as an Optional value. |
@PermitAll public Optional<es.uvigo.esei.dgss.letta.domain.entities.User> get(String login) throws IllegalArgumentException
User associated with the received login name,
returned as an Optional value that will be empty if the user is
not found. If the login is null, a NullPointerException will be
thrown.login - The login String to find in the database.Optional value holding the uniquely found User
object, or empty otherwise.IllegalArgumentException - if the received login is null.@PermitAll public Optional<es.uvigo.esei.dgss.letta.domain.entities.User> getByEmail(String email) throws IllegalArgumentException
User associated with the received email, returned
as an Optional value that will be empty if the user is not found.
If the email is null, a NullPointerException will be thrown/email - The email String to find in the database.Optional value holding the uniquely found
User, or empty otherwise.IllegalArgumentException - if the received email is null.@PermitAll public void registerUser(es.uvigo.esei.dgss.letta.domain.entities.Registration registration) throws LoginDuplicateException, EmailDuplicateException, javax.mail.MessagingException
registration - indicates the user to registerLoginDuplicateException - if the user login already existsEmailDuplicateException - if the user email already existsjavax.mail.MessagingException - exception thrown by the Messaging classes@PermitAll public boolean userConfirmation(String uuid)
uuid - indicates the user uuiduuid doesn't exist@Deprecated public es.uvigo.esei.dgss.letta.domain.entities.User userWithLogin(String login)
get(String) instead, as it
already checks the failure case where the User is not
found, by returning it as an Optional value.login - indicates the user with login@PermitAll public es.uvigo.esei.dgss.letta.domain.entities.Registration registrationWithLogin(String login)
login - indicates the user with login@RolesAllowed(value={"ADMIN","USER"}) public es.uvigo.esei.dgss.letta.domain.entities.User update(es.uvigo.esei.dgss.letta.domain.entities.User user) throws IllegalArgumentException, SecurityException, EmailDuplicateException
@RolesAllowed(value="ADMIN") public List<es.uvigo.esei.dgss.letta.domain.entities.User> getUsers() throws javax.ejb.EJBTransactionRolledbackException
User in the database.List with all the User sorted alphabetically.javax.ejb.EJBTransactionRolledbackException - if the currently identified
User is not admin.@RolesAllowed(value="ADMIN") public void removeUser(String login) throws javax.ejb.EJBTransactionRolledbackException
User in the database.login - the User login.javax.ejb.EJBTransactionRolledbackException - if the User is null or
the currently identified User is not admin.@RolesAllowed(value={"ADMIN","USER"}) public List<es.uvigo.esei.dgss.letta.domain.entities.UserNotifications> getNotifications()
UserNotifications by the current User.UserNotifications.@RolesAllowed(value={"ADMIN","USER"}) public Long countUnreadNotifications()
UserNotifications by the current User.UserNotifications@RolesAllowed(value={"ADMIN","USER"}) public es.uvigo.esei.dgss.letta.domain.entities.UserNotifications getNotification(int notificationId)
UserNotifications in the database.notificationId - the id of the UserNotifications.UserNotifications.@RolesAllowed(value={"ADMIN","USER"}) public void sendRequest(String friendLogin)
Friendship in the database.friendLogin - the received User of the Friendship@RolesAllowed(value={"ADMIN","USER"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Friendship> friendRequestList()
FriendshipList in all Friendship@RolesAllowed(value={"ADMIN","USER"}) public void acceptOrRejectFriendRequest(String friendLogin, boolean acceptFriendShip)
FriendshipfriendLogin - The login' friend User}acceptFriendShip - true in case accept and vice versa@RolesAllowed(value={"ADMIN","USER"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Friendship> getFriendRequestBeSentByUserList()
FriendshipList in all Friendship@RolesAllowed(value={"ADMIN","USER"}) public void removeFriendship(String friendLogin)
Friendship from databasefriendLogin - The login's User@RolesAllowed(value={"ADMIN","USER"}) public void cancelFriendship(String friendLogin)
Friendship by userfriendLogin - User@RolesAllowed(value={"ADMIN","USER"}) public List<es.uvigo.esei.dgss.letta.domain.entities.User> searchUser(String keyword)
User by full namekeyword - List with all the User@RolesAllowed(value={"ADMIN","USER"}) public es.uvigo.esei.dgss.letta.domain.entities.Friendship getFriend(String loginFriend)
User by the current User.loginFriend - The friend of userUser.@RolesAllowed(value={"ADMIN","USER"}) public es.uvigo.esei.dgss.letta.domain.entities.Friendship getFriendship(String loginFriend)
User by the current User.loginFriend - The friend of user UserFriendship.Copyright © 2017. All rights reserved.