Interface AgendaEventAttendeeService


public interface AgendaEventAttendeeService
  • Method Details

    • getEventAttendees

      EventAttendeeList getEventAttendees(long eventId)
      Return the list of attendees of an event
      Parameters:
      eventId - agenda Event identifier
      Returns:
      EventAttendeeList
    • getEventAttendees

      List<EventAttendee> getEventAttendees(long eventId, ZonedDateTime occurrenceId, EventAttendeeResponse... responses)
      Return the list of attendees of an event having a specific responses.
      Parameters:
      eventId - agenda Event identifier
      occurrenceId - event occurrence id
      responses - Array of answers of attendees to retrieve
      Returns:
      List of EventAttendee
    • getEventAttendees

      EventAttendeeList getEventAttendees(long eventId, EventAttendeeResponse... responses)
      Return the list of attendees of an event having a specific responses.
      Parameters:
      eventId - agenda Event identifier
      responses - Array of answers of attendees to retrieve
      Returns:
      EventAttendeeList
    • sendInvitations

      void sendInvitations(Event event, List<EventAttendee> eventAttendees, AgendaEventModification eventModifications)
      Sends an invitation to event attendees of type: user, space or external user.
      Parameters:
      event - Event
      eventAttendees - List of EventAttendee of the event
      eventModifications - AgendaEventModification contains a Set of AgendaEventModificationType to indicate event modification types: fields modifications, creation or deletion
    • saveEventAttendees

      Set<AgendaEventModificationType> saveEventAttendees(Event event, List<EventAttendee> attendees, long creatorIdentityId, boolean sendInvitations, boolean resetResponses, AgendaEventModification eventModifications)
      Parameters:
      event - Event to attach attendees
      attendees - List of EventAttendee to save for event
      creatorIdentityId - technical identifier if Identity updating event
      sendInvitations - whether send invitations to other attendees or not
      resetResponses - whether reset attendees responses or not to default EventAttendeeResponse.NEEDS_ACTION. Whatever the value of this parameter, the response of a newly added attendee is forced to EventAttendeeResponse.NEEDS_ACTION when it isn't the attendee designated by creatorIdentityId, since a user can only answer an invitation for himself
      eventModifications - AgendaEventModification contains a Set of AgendaEventModificationType to indicate event modification types: fields modifications, creation or deletion
      Returns:
      Set of AgendaEventModificationType containing modifications made on event attendees
    • generateEncryptedToken

      String generateEncryptedToken(long eventId, String email)
      Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.
      Parameters:
      eventId - Event technical identifier
      email - User email
      Returns:
      encrypted token containing "EVENT_ID|EMAIL||EXPIRY", or null when the event carries no date to bound the token by
    • generateEncryptedToken

      String generateEncryptedToken(long eventId, String emailOrUsername, EventAttendeeResponse response)
      Generates a token that will be used to authenticate user when requesting REST API in anonymous mode.

      The token expires with the meeting it answers. The expiry is the last field of the payload, an epoch second derived from the event by Utils.invitationTokenExpiry; it is a pure function of the event, so the same event and answer always yield the same token, which is what lets the calendar copy carry these links in a DESCRIPTION without being rewritten on every sweep (EXO-89752, EXO-89753).

      Parameters:
      eventId - Event technical identifier
      emailOrUsername - User name or email
      response - EventAttendeeResponse value for chosen answer, null for a token that authenticates without carrying an answer
      Returns:
      encrypted token containing "EVENT_ID|EMAIL|ATTENDEE_RESPONSE|EXPIRY", the answer field being empty when there is none; null when the event carries no date to bound the token by, in which case no link should be offered
    • decryptUserIdentity

      org.exoplatform.social.core.identity.model.Identity decryptUserIdentity(long eventId, String token, EventAttendeeResponse response) throws IllegalAccessException
      Reads token content and retrieves user Social Identity from email or username contained in token. An internal attendee is retrieved from the organization identity provider, an external attendee - a guest invited by mail address only - is retrieved among the guest attendees of the event. No identity is ever created by this lookup, so a token carrying a mail address which attends nothing resolves to null.

      A token whose meeting is over is refused, with EventInvitationExpiredException so that a caller can tell a lapsed link apart from a forged one. A token minted before EXO-89752 carries no expiry of its own and is bounded by asking the event for the same bound at this point, so no invitation already delivered stops working and none of them stays replayable either.

      Parameters:
      eventId - Event technical identifier
      token - encrypted token
      response - EventAttendeeResponse value for chosen answer
      Returns:
      Identity of user, or null when the token designates neither an existing internal user nor a guest attendee of the event
      Throws:
      IllegalAccessException - when the token has bad format, designates another event or another answer, or - as EventInvitationExpiredException - when the meeting it answers is over
    • getEventResponse

      EventAttendeeResponse getEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Retrieves the event response of a user. If the user didn't responded to the event, the default value EventAttendeeResponse.NEEDS_ACTION will be retrieved.
      Parameters:
      eventId - Technical identifier of Event
      occurrenceId - event occurrence id
      identityId - Identity technical identifier of user
      Returns:
      EventAttendeeResponse, no null value is returned
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when event with provided identifier doesn't exists
      IllegalAccessException - when the user may not answer the event: not an attendee, and the event isn't open to them (see canRespondToEvent(Event, long))
    • sendEventResponse

      void sendEventResponse(long eventId, long identityId, EventAttendeeResponse response) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Parameters:
      eventId - Technical identifier of Event
      identityId - Identity technical identifier of user
      response - User response of type EventAttendeeResponse to the event. The value EventAttendeeResponse.NEEDS_ACTION isn't allowed.
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when event with provided identifier doesn't exists
      IllegalAccessException - when the user may not answer the event: not an attendee, and the event isn't open to them (see canRespondToEvent(Event, long))
    • sendUpcomingEventResponse

      void sendUpcomingEventResponse(long eventId, ZonedDateTime occurrenceId, long identityId, EventAttendeeResponse response) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Sends an event response for a recurrent event starting from a specific occurrence
      Parameters:
      eventId - Technical identifier of Event
      occurrenceId - event occurrence id
      identityId - Identity technical identifier of user
      response - User response of type EventAttendeeResponse to the event. The value EventAttendeeResponse.NEEDS_ACTION isn't allowed.
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when event with provided identifier doesn't exists
      IllegalAccessException - when the user may not answer the event: not an attendee, and the event isn't open to them (see canRespondToEvent(Event, long))
    • sendEventResponse

      void sendEventResponse(long eventId, long identityId, EventAttendeeResponse response, boolean broadcast) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Parameters:
      eventId - Technical identifier of Event
      identityId - Identity technical identifier of user
      response - User response of type EventAttendeeResponse to the event. The value EventAttendeeResponse.NEEDS_ACTION isn't allowed.
      broadcast - whether broadcast event about this change or not
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when event with provided identifier doesn't exists
      IllegalAccessException - when the user may not answer the event: not an attendee, and the event isn't open to them (see canRespondToEvent(Event, long))
    • isEventAttendee

      boolean isEventAttendee(long eventId, long identityId)
      Checks whether the user is an attendee of the event or not
      Parameters:
      eventId - Technical identifier of Event
      identityId - user name
      Returns:
      true if user is an attendee of the event, else return false
    • canRespondToEvent

      boolean canRespondToEvent(Event event, long identityId)
      Checks whether the user may write their own answer on the event, which is the one right that opening an event widens (eXIP 7.3.0.20). Two halves:
      • the attendee half is exactly isEventAttendee(long, long) on the event itself, so an exceptional occurrence is checked against its own attendee list, as today;
      • the open half: the event is open and the user can access its calendar (a member of the owning space). The flag is the event's own: a date individually modified answers with its own value.
      Opening never widens who can see the event, only who can answer it.
      Parameters:
      event - Event to answer, as stored
      identityId - Identity technical identifier of user
      Returns:
      true when the user may send or read an answer on the event, else false