@RolesAllowed(value="RegisteredUser") public class UserEJB extends Object
| Constructor and Description |
|---|
UserEJB() |
| Modifier and Type | Method and Description |
|---|---|
es.uvigo.esei.dgss.teama.letta.entities.Event |
attendToEvent(int eventId)
Attend an event by an user
|
boolean |
checkEventAtendance(es.uvigo.esei.dgss.teama.letta.entities.Event event)
Checks if the authenticated user is already attending the given event.
|
boolean |
checkIsCreator(es.uvigo.esei.dgss.teama.letta.entities.Event event)
Checks if the authenticated user is the given event creator.
|
es.uvigo.esei.dgss.teama.letta.entities.User |
confirmRegistration(String t)
Confirms a pre-registered user through the given token.
|
es.uvigo.esei.dgss.teama.letta.entities.User |
findByLoginAndPassword(String user,
String password)
Gets the user from the database with the given login and password
|
es.uvigo.esei.dgss.teama.letta.entities.User |
findByName(String login)
Gets the user from the database with the given login
|
boolean |
isRegistered(String login)
Checks if the given user login is registered in the system.
|
es.uvigo.esei.dgss.teama.letta.entities.User |
loggingUser()
Return the user logged
|
void |
preRegistration(es.uvigo.esei.dgss.teama.letta.entities.User user)
Generates a verification token used to confirm the registration later.
|
es.uvigo.esei.dgss.teama.letta.entities.Event |
unAttendToEvent(int eventId)
Unattend an event by an user
|
@PermitAll public boolean isRegistered(String login)
login - login of the user.User@PermitAll public void preRegistration(es.uvigo.esei.dgss.teama.letta.entities.User user) throws javax.mail.MessagingException
user - the user that will be pre-registered.javax.mail.MessagingException - when an error to send message is produced.User,
VerificationToken,
confirmRegistration(String)@PermitAll public es.uvigo.esei.dgss.teama.letta.entities.User confirmRegistration(String t)
t - the VerificationToken id.InvalidParameterException - when the given token is not valid.@PermitAll public es.uvigo.esei.dgss.teama.letta.entities.User loggingUser()
@PermitAll public es.uvigo.esei.dgss.teama.letta.entities.User findByName(String login)
login - a string with the user's login@PermitAll public es.uvigo.esei.dgss.teama.letta.entities.Event attendToEvent(int eventId) throws LettaIllegalArgumentException
eventId - the event to attendLettaIllegalArgumentException - if event is empty or user is already attending the eventpublic es.uvigo.esei.dgss.teama.letta.entities.Event unAttendToEvent(int eventId)
throws LettaIllegalArgumentException
eventId - the id of event to unfollowLettaIllegalArgumentException - if event is not found@PermitAll public boolean checkEventAtendance(es.uvigo.esei.dgss.teama.letta.entities.Event event) throws LettaIllegalArgumentException
event - event to attend.LettaIllegalArgumentException - if the given event is null@PermitAll public boolean checkIsCreator(es.uvigo.esei.dgss.teama.letta.entities.Event event) throws LettaIllegalArgumentException
event - event to check its creator.LettaIllegalArgumentException - if the given event is null@PermitAll public es.uvigo.esei.dgss.teama.letta.entities.User findByLoginAndPassword(String user, String password)
user - a string with the user's loginpassword - a string with the user's passwordCopyright © 2017. All rights reserved.