| Constructor and Description |
|---|
EventEJB() |
| Modifier and Type | Method and Description |
|---|---|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
advancedSearch(String search,
Enum state,
String category,
int start,
int count)
Search for an event with advanced criteria
|
void |
attendToEvent(int eventId)
Register the current identified
User into a Event. |
void |
cancelEvent(int eventId)
Register the current identified
User into a Event. |
int |
count(String search)
Counts how many
Events currently exist in the database. |
int |
countAll()
Counts how many
Events currently exist in the database. |
int |
countAttendingEvents()
Retrieves a number of
Events that authenticated
User is joined. |
int |
countEventsOwnedBy(es.uvigo.esei.dgss.letta.domain.entities.User user)
Returns the number of
Event created by the given User |
int |
countEventsOwnedByCurrentUser()
Returns the number of
Event created by the current User |
es.uvigo.esei.dgss.letta.domain.entities.Event |
createEvent(es.uvigo.esei.dgss.letta.domain.entities.Event event)
Creates a new
Event in the database, setting its creator as the
current identified User. |
Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> |
get(int id) |
int |
getAttendees(es.uvigo.esei.dgss.letta.domain.entities.Event event)
Returns a
int with the number of User attendants of
the Event. |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getAttendingEvents(int start,
int count)
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getAttendingEventsOrderLocation(String location,
int start,
int count)
|
List<es.uvigo.esei.dgss.letta.domain.entities.Capital> |
getCapitals()
Gets all the
Capital in the database. |
es.uvigo.esei.dgss.letta.domain.entities.Event |
getEvent(int id)
Deprecated.
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsOwnedBy(es.uvigo.esei.dgss.letta.domain.entities.User user)
Get events created by a specific user.
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsOwnedByCurrentUser()
Deprecated.
Consider using
getEventsOwnedByCurrentUser(int, int)
instead, that calls to
getEventsOwnedBy(User, int, int) |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsOwnedByCurrentUser(int start,
int count)
Get the
Event created by the active User. |
Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getWithAttendees(int id) |
boolean |
isCancelled(int eventId)
Retrieves if a event is cancelled.
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
listByCreatedAt(int start,
int count)
Returns a paginated
List of Events, sorted by
descending creation date (which means that newer events will be first on
the list). |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
listByDate(int start,
int count)
Returns a paginated
List of Events, sorted by
ascending date (which means that older events will be first on the list). |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
listByLocation(String location,
int start,
int count)
Returns a paginated
List of Events, sorted by
nearest locations and ascending date (which means that older events
will be first on the list). |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
listHighlighted()
Returns a paginated
List of Events with all the
currently highlighted events, sorted by a magician. |
void |
modifyEvent(es.uvigo.esei.dgss.letta.domain.entities.Event modified)
Modifies an existent
Event if the currently identified user is
the owner. |
void |
removeEvent(int eventId)
Remove the current
Event. |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
search(String search,
int start,
int count)
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
searchWhileLoggedIn(String search,
String location,
int start,
int count)
Modification of the search method that orders by distance from the residence place
|
void |
unattendToEvent(int eventId) |
@PermitAll public Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> get(int id)
@PermitAll @Deprecated public es.uvigo.esei.dgss.letta.domain.entities.Event getEvent(int id)
@PermitAll public Optional<es.uvigo.esei.dgss.letta.domain.entities.Event> getWithAttendees(int id)
@PermitAll public int count(String search)
Events currently exist in the database.search - string to search@RolesAllowed(value="ADMIN") public int countAll()
Events currently exist in the database.@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Event> advancedSearch(String search, Enum state, String category, int start, int count)
search - Search term of the query(short description or title)state - State of the event(cancelled or open)category - Category of the eventstart - Start page of the querycount - Number of elements per page@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Event> listByDate(int start, int count) throws IllegalArgumentException
List of Events, sorted by
ascending date (which means that older events will be first on the list).start - The first Event position to return, numbered from 0.count - The number of Events to return.List with the specified number of Events, sorted by ascending date and counting from the received
start point.IllegalArgumentException - if the start or count parameters are
negative.@RolesAllowed(value="ADMIN") public List<es.uvigo.esei.dgss.letta.domain.entities.Event> listByCreatedAt(int start, int count) throws IllegalArgumentException
List of Events, sorted by
descending creation date (which means that newer events will be first on
the list).start - The first Event position to return, numbered from 0.count - The number of Events to return.List with the specified number of Events, sorted by descending creation date and counting from
the received start point.IllegalArgumentException - if the start or count parameters are negative.@RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> listByLocation(String location, int start, int count) throws IllegalArgumentException
List of Events, sorted by
nearest locations and ascending date (which means that older events
will be first on the list).location - The location of the logged User.start - The first Event position to return, numbered from 0.count - The number of Events to return.List with the specified number of Events, sorted by ascending date and counting from the received
start point.IllegalArgumentException - if the start or count parameters are
negative.@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Event> listHighlighted()
List of Events with all the
currently highlighted events, sorted by a magician.List containing all the highlighted Events, magically sorted and counting from the received start
point.@RolesAllowed(value={"USER","ADMIN"}) public es.uvigo.esei.dgss.letta.domain.entities.Event createEvent(es.uvigo.esei.dgss.letta.domain.entities.Event event) throws IllegalArgumentException, SecurityException
Event in the database, setting its creator as the
current identified User.event - The Event to be inserted into the database.Event object with all its auto-generated
fields (the event Event.getId() id) already set.IllegalArgumentException - if the received Event is nullSecurityException - if the currently identified user is not found
in the database (!!!).@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Event> search(String search, int start, int count) throws IllegalArgumentException
Events matching some given String
query, and returns the results as a paginated List. If the given
search pattern is null, a NullPointerException will be thrown.
title,
and short description and
long description. Results are sorted by
ascending date and descending number of attendees.search - The search pattern as a simple String.start - The first Event position to return, counting from 0.count - The number of Events to return.List with the specified number of Events that have matched the search query.IllegalArgumentException - if the received String with the
search terms is null, or if the start or count parameters are
negative.@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Event> searchWhileLoggedIn(String search, String location, int start, int count) throws IllegalArgumentException
search - The search termstart - The start pagecount - The number of elements per pageIllegalArgumentException@RolesAllowed(value={"USER","ADMIN"}) public void attendToEvent(int eventId) throws EventAlredyJoinedException, SecurityException, EventIsCancelledException, IllegalArgumentException
User into a Event. It the
the current User is already registered for the event the method
will throw an EventAlredyJoinedException, otherwise it will
register the User to the event.eventId - Identifier of the Event that the User
wants to register.EventAlredyJoinedException - if the current identified User
is already registered for the Event.SecurityException - if the currently identified user is not found
in the database (!!!).EventIsCancelledException - if the Event is cancelledIllegalArgumentException - if the Event does not exist@RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getAttendingEvents(int start, int count)
List of Events that authenticated
User is joined.@RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getAttendingEventsOrderLocation(String location, int start, int count)
List of Events that authenticated
User is joined ordered by location.@RolesAllowed(value={"USER","ADMIN"}) public int countAttendingEvents() throws SecurityException
Events that authenticated
User is joined. This function is useful to do the paginate of
the list of events.Events that authenticated
User is joined.SecurityException@RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsOwnedBy(es.uvigo.esei.dgss.letta.domain.entities.User user) throws IllegalArgumentException
user - the owner of the events.Event that contains the owner`s events.IllegalArgumentException - if the user is null.@RolesAllowed(value={"USER","ADMIN"}) public int countEventsOwnedBy(es.uvigo.esei.dgss.letta.domain.entities.User user)
Event created by the given Useruser - User for count his created EventEvent created by the given User@Deprecated @RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsOwnedByCurrentUser()
getEventsOwnedByCurrentUser(int, int)
instead, that calls to
getEventsOwnedBy(User, int, int)Event that contains events of the current user.@RolesAllowed(value={"USER","ADMIN"}) public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsOwnedByCurrentUser(int start, int count)
Event created by the active User.start - index of the first Event to retrieve.count - number of Event to retrieve.Event that contains the given number of events
from the given position owned by the current User.@RolesAllowed(value={"USER","ADMIN"}) public int countEventsOwnedByCurrentUser()
Event created by the current UserEvent created by the current User@RolesAllowed(value={"USER","ADMIN"}) public void unattendToEvent(int eventId) throws SecurityException, EventNotJoinedException
@PermitAll public int getAttendees(es.uvigo.esei.dgss.letta.domain.entities.Event event)
int with the number of User attendants of
the Event.event - the Event to get the attendants.int with the number of attendants.@RolesAllowed(value={"USER","ADMIN"}) public void modifyEvent(es.uvigo.esei.dgss.letta.domain.entities.Event modified) throws IllegalArgumentException, UserNotAuthorizedException, SecurityException, javax.mail.MessagingException
Event if the currently identified user is
the owner.modified - the Event already modifiedSecurityException - if the currently identified user is not found
in the database or if he is not the owner of the event.IllegalArgumentExceptionUserNotAuthorizedExceptionjavax.mail.MessagingException@RolesAllowed(value={"USER","ADMIN"}) public void cancelEvent(int eventId) throws SecurityException, EventIsCancelledException, IllegalArgumentException, IllegalEventOwnerException, javax.mail.MessagingException
User into a Event. It the
the current User is already registered for the event the method
will throw an EventAlredyJoinedException, otherwise it will
register the User to the event.eventId - Identifier of the Event that the User
wants to register.SecurityException - if the currently identified user is not found
in the database (!!!).EventIsCancelledException - if the Event is cancelledIllegalArgumentException - if the Event does not existIllegalEventOwnerException - if the event does not existjavax.mail.MessagingException@PermitAll public boolean isCancelled(int eventId) throws IllegalArgumentException
eventId - the id of the Event to checkIllegalArgumentException - if the event does not exist@PermitAll public List<es.uvigo.esei.dgss.letta.domain.entities.Capital> getCapitals()
Capital in the database.List with all the Capital@RolesAllowed(value="ADMIN") public void removeEvent(int eventId) throws IllegalArgumentException
Event.
Only a user with role ADMIN can call this.eventId - Identifier of the Event to remove.IllegalArgumentException - if the Event does not existCopyright © 2016. All rights reserved.