| Constructor and Description |
|---|
EventEJB() |
| Modifier and Type | Method and Description |
|---|---|
void |
attendToEvent(int eventId)
Register the current identified
User into a Event. |
int |
count()
Counts how many
Events currently exist in the database. |
int |
countAttendingEvents()
Retrieves a number of
Events that authenticated
User is joined. |
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 |
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)
|
es.uvigo.esei.dgss.letta.domain.entities.Event |
getEvent(int id)
Returns an
Event |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
getEventsOwnedByCurrentUser()
Get events created by the active user.
|
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. |
List<es.uvigo.esei.dgss.letta.domain.entities.Event> |
search(String search,
int start,
int count)
|
void |
unattendToEvent(int eventId) |
@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 attendToEvent(int eventId) throws EventAlredyJoinedException, SecurityException, EventIsCancelledException
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 cancelled@RolesAllowed(value="USER") 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") 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") public List<es.uvigo.esei.dgss.letta.domain.entities.Event> getEventsOwnedByCurrentUser()
Event that contains events of the current user.@RolesAllowed(value="USER") 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.@PermitAll public es.uvigo.esei.dgss.letta.domain.entities.Event getEvent(int id)
Eventid - indicates the Event id.Event if it is found, null otherwiseCopyright © 2015. All rights reserved.