public class EventEJB extends Object
| Constructor and Description |
|---|
EventEJB() |
| Modifier and Type | Method and Description |
|---|---|
int |
count()
Counts how many
Events currently exist in the database. |
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. |
int |
getCountEventsJoinedByUser()
Retrieves a number of
Events that authenticated User
is joined. |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsCreatedByOwnerUser()
Get events created by the active user.
|
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsJoinedByUser(int start,
int count)
|
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> |
listHighlighted()
Returns a paginated
List of Events with all the
currently highlighted events, sorted by a magician. |
void |
registerToEvent(int eventId)
Register the current identified
User into a Event. |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
search(String search,
int start,
int count)
|
@PermitAll public int count()
Events currently exist in the database.@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.@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") 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. 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.@RolesAllowed(value="USER") public void registerToEvent(int eventId) throws EventAlredyJoinedException, SecurityException
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
(!!!).@RolesAllowed(value="USER") public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsJoinedByUser(int start, int count)
List of Events that authenticated User
is joined.@RolesAllowed(value="USER") public int getCountEventsJoinedByUser()
Events that authenticated User
is joined.
This function is usefull to do the paginate of the list of events.Events that authenticated User
is joined.@RolesAllowed(value="USER") public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsCreatedByOwnerUser()
Event that contains events of the current user.Copyright © 2015. All rights reserved.