Package com.syzygy.events.database
Class EventAssociation.Methods<T extends Database.Querrier<T>>
java.lang.Object
com.syzygy.events.database.Database.Querrier.QueryResult<List<V>>
com.syzygy.events.database.Database.Querrier.QueryInstanceResult<EventAssociation>
com.syzygy.events.database.EventAssociation.Methods<T>
- All Implemented Interfaces:
Database.Dissolvable
- Enclosing class:
- EventAssociation
@Dissolves
public static class EventAssociation.Methods<T extends Database.Querrier<T>>
extends Database.Querrier.QueryInstanceResult<EventAssociation>
implements Database.Dissolvable
A query result of EventAssociations. This provides a methods to mass modify and notify user
-
Field Summary
FieldsFields inherited from class com.syzygy.events.database.Database.Querrier.QueryResult
result
-
Constructor Summary
ConstructorsConstructorDescriptionMethods
(Database db, T querrier, List<EventAssociation> list) Fetches all instances in the list and stores them in a unmodifiable reference -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels all users from the respective events.void
delete()
Deletes all associations.void
dissolve()
Returns the referencesstatic <T extends Database.Querrier<T>>
EventAssociation.Methods<T>void
inviteUsersToEventFromLottery
(Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Invites all users to the corresponding events.void
notify
(String subject, String body, boolean attachEvent, boolean fromOrganizer, boolean ignoresOptOut, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Sends a notification to all usersvoid
notify
(Consumer<EventAssociation> consumer, String subject, String body, boolean attachEvent, boolean fromOrganizer, boolean ignoresOptOut, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Applies the consumer to each association and notifies the usersvoid
rejectUsersFromLottery
(Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Notifies the users that they were rejected by the lottery for their associated eventvoid
setStatus
(int statusID) Sets the status of each associationvoid
setStatus
(int statusID, String notificationSubject, String notificationBody, boolean notificationAttachEvent, boolean notificationFromOrganizer, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Sets the status of each association and notifies the userstatic <T extends Database.Querrier<T>>
EventAssociation.Methods<T>SINGLETON
(Database db, T q, EventAssociation assoc) int
size()
-
Field Details
-
dissolved
private boolean dissolved -
db
-
querrier
-
-
Constructor Details
-
Methods
Fetches all instances in the list and stores them in a unmodifiable reference- Parameters:
db
- The databasequerrier
- The querrier that got the resultslist
- The list of results
-
-
Method Details
-
setStatus
public void setStatus(int statusID) Sets the status of each association- Parameters:
statusID
- The resId of the new status
-
inviteUsersToEventFromLottery
@Stirred public void inviteUsersToEventFromLottery(Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Invites all users to the corresponding events. Sets the association to Invited and notifies the user that they were selected by the lottery- Parameters:
listener
- The listener called on completion with theEventAssociation.NotificationResult
-
rejectUsersFromLottery
@Stirred public void rejectUsersFromLottery(Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Notifies the users that they were rejected by the lottery for their associated event- Parameters:
listener
- The listener called on completion with theEventAssociation.NotificationResult
-
cancelUsers
@Stirred public void cancelUsers(Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Cancels all users from the respective events. Sets the association to Cancelled and notifies the users that they were removed from the event- Parameters:
listener
- The listener called on completion with theEventAssociation.NotificationResult
-
delete
Deletes all associations. Then dissolves self -
setStatus
@Stirred public void setStatus(int statusID, String notificationSubject, String notificationBody, boolean notificationAttachEvent, boolean notificationFromOrganizer, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Sets the status of each association and notifies the user- Parameters:
statusID
- The resId of the new statusnotificationSubject
- The subject of the notificationnotificationBody
- The body of the notificationnotificationAttachEvent
- If the event should be attached to the notificationnotificationFromOrganizer
- If the even should be sent from the organizerlistener
- The listener that is called with the notification result upon completion. Only theonSuccess
is called- See Also:
-
notify
@Stirred public void notify(String subject, String body, boolean attachEvent, boolean fromOrganizer, boolean ignoresOptOut, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Sends a notification to all users- Parameters:
subject
- The subject of the notificationbody
- The body of the notificationattachEvent
- If the event should be attached to the notificationfromOrganizer
- If the even should be sent from the organizerignoresOptOut
- If the notification should ignore opt out settingslistener
- The listener that is called with the notification result upon completion. Only theonSuccess
is called- See Also:
-
notify
@Stirred public void notify(@Observes Consumer<EventAssociation> consumer, String subject, String body, boolean attachEvent, boolean fromOrganizer, boolean ignoresOptOut, Database.Querrier.DataListener<T, EventAssociation.NotificationResult> listener) Applies the consumer to each association and notifies the users- Parameters:
subject
- The subject of the notificationbody
- The body of the notificationattachEvent
- If the event should be attached to the notificationfromOrganizer
- If the notification should be sent from the organizerignoresOptOut
- If the notification should ignore opt out settingslistener
- The listener that is called with the notification result upon completion. Only theonSuccess
is called. Ownership is passed on to the caller- See Also:
-
size
public int size() -
dissolve
Returns the references- Specified by:
dissolve
in interfaceDatabase.Dissolvable
-
EMPTY
@MustStir public static <T extends Database.Querrier<T>> EventAssociation.Methods<T> EMPTY(Database db, @Observes T q) -
SINGLETON
@MustStir public static <T extends Database.Querrier<T>> EventAssociation.Methods<T> SINGLETON(Database db, @Observes T q, @Dilutes EventAssociation assoc)
-