Class AgendaEventServiceImpl

java.lang.Object
org.exoplatform.agenda.service.AgendaEventServiceImpl
All Implemented Interfaces:
org.exoplatform.agenda.service.AgendaEventService

public class AgendaEventServiceImpl extends Object implements org.exoplatform.agenda.service.AgendaEventService
  • Field Summary

    Fields inherited from interface org.exoplatform.agenda.service.AgendaEventService

    CALENDAR_EDITED_BY_SHAREE_EVENT
  • Constructor Summary

    Constructors
    Constructor
    Description
    AgendaEventServiceImpl(org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.agenda.service.AgendaEventAttendeeService attendeeService, org.exoplatform.agenda.service.AgendaEventConferenceService conferenceService, org.exoplatform.agenda.service.AgendaEventReminderService reminderService, org.exoplatform.agenda.service.AgendaRemoteEventService remoteEventService, org.exoplatform.agenda.service.AgendaEventDatePollService datePollService, AgendaSearchConnector agendaSearchConnector, AgendaEventStorage agendaEventStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.social.metadata.MetadataService metadataService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canAccessEvent(org.exoplatform.agenda.model.Event event, long identityId)
    boolean
    canCreateEvent(org.exoplatform.agenda.model.Calendar calendar, long userIdentityId)
    Never in a subscribed calendar (EXO-90278), whose events come from its feed alone.
    boolean
    canUpdateEvent(org.exoplatform.agenda.model.Event event, long userIdentityId)
    long
    countEventDatePolls(List<Long> ownerIds, long userIdentityId)
     
    long
    countPendingEvents(List<Long> ownerIds, long userIdentityId)
     
    org.exoplatform.agenda.model.Event
    createEvent(org.exoplatform.agenda.model.Event event, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, List<org.exoplatform.agenda.model.EventDateOption> dateOptions, org.exoplatform.agenda.model.RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId)
    org.exoplatform.agenda.model.Event
    createEventExceptionalOccurrence(long eventId, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, ZonedDateTime occurrenceId)
    org.exoplatform.agenda.model.Event
    deleteEventById(long eventId, long userIdentityId)
    org.exoplatform.agenda.constant.EventAccess
    getEventAccess(org.exoplatform.agenda.model.Event event, long identityId)
    org.exoplatform.agenda.model.Event
    getEventById(long eventId)
    org.exoplatform.agenda.model.Event
    getEventById(long eventId, ZoneId timeZone, long userIdentityId)
    List<org.exoplatform.agenda.model.Event>
    getEventDatePolls(org.exoplatform.agenda.model.EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId)
     
    org.exoplatform.agenda.model.Event
    getEventOccurrence(long parentEventId, ZonedDateTime occurrenceId, ZoneId timeZone, long userIdentityId)
    List<org.exoplatform.agenda.model.Event>
    getEventOccurrencesInPeriod(org.exoplatform.agenda.model.Event recurrentEvent, ZonedDateTime start, ZonedDateTime end, ZoneId timezone, int limit)
    List<org.exoplatform.agenda.model.Event>
    getEvents(org.exoplatform.agenda.model.EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId)
    org.exoplatform.agenda.model.Event
    getExceptionalOccurrenceEvent(long eventId, ZonedDateTime occurrenceId)
    List<org.exoplatform.agenda.model.Event>
    getExceptionalOccurrenceEvents(long parentEventId, ZoneId timeZone, long userIdentityId)
    List<org.exoplatform.agenda.model.Event>
    List<org.exoplatform.agenda.model.Event>
    getPendingEvents(List<Long> ownerIds, long userIdentityId, ZoneId userTimeZone, int offset, int limit)
     
    org.exoplatform.agenda.model.Event
    saveEventExceptionalOccurrence(long eventId, ZonedDateTime occurrenceId)
    List<org.exoplatform.agenda.model.EventSearchResult>
    search(org.exoplatform.agenda.model.AgendaEventSearchFilter filter)
    void
    selectEventDateOption(long eventId, long dateOptionId, long userIdentityId)
     
    void
    Replaces how calendar shares are looked up, for tests: the default resolves the share service from the container on first use.
    void
    Replaces how the calendars of an owner's subscriptions are looked up, for tests: the default resolves the subscription service from the container on first use.
    org.exoplatform.agenda.model.Event
    updateEvent(org.exoplatform.agenda.model.Event event, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, List<org.exoplatform.agenda.model.EventDateOption> dateOptions, org.exoplatform.agenda.model.RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId)
    void
    updateEventFields(long eventId, Map<String,List<String>> fields, boolean updateAllOccurrences, boolean sendInvitations, long userIdentityId)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgendaEventServiceImpl

      public AgendaEventServiceImpl(org.exoplatform.agenda.service.AgendaCalendarService agendaCalendarService, org.exoplatform.agenda.service.AgendaEventAttendeeService attendeeService, org.exoplatform.agenda.service.AgendaEventConferenceService conferenceService, org.exoplatform.agenda.service.AgendaEventReminderService reminderService, org.exoplatform.agenda.service.AgendaRemoteEventService remoteEventService, org.exoplatform.agenda.service.AgendaEventDatePollService datePollService, AgendaSearchConnector agendaSearchConnector, AgendaEventStorage agendaEventStorage, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.social.metadata.MetadataService metadataService)
  • Method Details

    • setCalendarShareAccess

      public void setCalendarShareAccess(CalendarShareAccess calendarShareAccess)
      Replaces how calendar shares are looked up, for tests: the default resolves the share service from the container on first use.
      Parameters:
      calendarShareAccess - the lookup
    • getEventById

      public org.exoplatform.agenda.model.Event getEventById(long eventId, ZoneId timeZone, long userIdentityId) throws IllegalAccessException
      Specified by:
      getEventById in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
    • getEventById

      public org.exoplatform.agenda.model.Event getEventById(long eventId)
      Specified by:
      getEventById in interface org.exoplatform.agenda.service.AgendaEventService
    • getEventOccurrence

      public org.exoplatform.agenda.model.Event getEventOccurrence(long parentEventId, ZonedDateTime occurrenceId, ZoneId timeZone, long userIdentityId) throws IllegalAccessException
      Specified by:
      getEventOccurrence in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
    • getExceptionalOccurrenceEvents

      public List<org.exoplatform.agenda.model.Event> getExceptionalOccurrenceEvents(long parentEventId, ZoneId timeZone, long userIdentityId) throws IllegalAccessException
      Specified by:
      getExceptionalOccurrenceEvents in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
    • getExceptionalOccurrenceEvent

      public org.exoplatform.agenda.model.Event getExceptionalOccurrenceEvent(long eventId, ZonedDateTime occurrenceId)
      Specified by:
      getExceptionalOccurrenceEvent in interface org.exoplatform.agenda.service.AgendaEventService
    • createEvent

      public org.exoplatform.agenda.model.Event createEvent(org.exoplatform.agenda.model.Event event, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, List<org.exoplatform.agenda.model.EventDateOption> dateOptions, org.exoplatform.agenda.model.RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) throws IllegalAccessException, org.exoplatform.agenda.exception.AgendaException
      Specified by:
      createEvent in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
      org.exoplatform.agenda.exception.AgendaException
    • saveEventExceptionalOccurrence

      public org.exoplatform.agenda.model.Event saveEventExceptionalOccurrence(long eventId, ZonedDateTime occurrenceId) throws org.exoplatform.agenda.exception.AgendaException
      Specified by:
      saveEventExceptionalOccurrence in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      org.exoplatform.agenda.exception.AgendaException
    • createEventExceptionalOccurrence

      public org.exoplatform.agenda.model.Event createEventExceptionalOccurrence(long eventId, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, ZonedDateTime occurrenceId) throws org.exoplatform.agenda.exception.AgendaException
      Specified by:
      createEventExceptionalOccurrence in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      org.exoplatform.agenda.exception.AgendaException
    • updateEvent

      public org.exoplatform.agenda.model.Event updateEvent(org.exoplatform.agenda.model.Event event, List<org.exoplatform.agenda.model.EventAttendee> attendees, List<org.exoplatform.agenda.model.EventConference> conferences, List<org.exoplatform.agenda.model.EventReminder> reminders, List<org.exoplatform.agenda.model.EventDateOption> dateOptions, org.exoplatform.agenda.model.RemoteEvent remoteEvent, boolean sendInvitation, long userIdentityId) throws org.exoplatform.agenda.exception.AgendaException, IllegalAccessException
      Specified by:
      updateEvent in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      org.exoplatform.agenda.exception.AgendaException
      IllegalAccessException
    • updateEventFields

      public void updateEventFields(long eventId, Map<String,List<String>> fields, boolean updateAllOccurrences, boolean sendInvitations, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException, org.exoplatform.agenda.exception.AgendaException
      Specified by:
      updateEventFields in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
      org.exoplatform.agenda.exception.AgendaException
    • deleteEventById

      public org.exoplatform.agenda.model.Event deleteEventById(long eventId, long userIdentityId) throws IllegalAccessException, org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      deleteEventById in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
      org.exoplatform.commons.exception.ObjectNotFoundException
    • setCalendarSubscriptionAccess

      public void setCalendarSubscriptionAccess(CalendarSubscriptionAccess calendarSubscriptionAccess)
      Replaces how the calendars of an owner's subscriptions are looked up, for tests: the default resolves the subscription service from the container on first use.
      Parameters:
      calendarSubscriptionAccess - the lookup
    • getEvents

      public List<org.exoplatform.agenda.model.Event> getEvents(org.exoplatform.agenda.model.EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId) throws IllegalAccessException
      Specified by:
      getEvents in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
    • getParentRecurrentEvents

      public List<org.exoplatform.agenda.model.Event> getParentRecurrentEvents(ZonedDateTime start, ZonedDateTime end, ZoneId timeZone)
      Specified by:
      getParentRecurrentEvents in interface org.exoplatform.agenda.service.AgendaEventService
    • canAccessEvent

      public boolean canAccessEvent(org.exoplatform.agenda.model.Event event, long identityId)
      Specified by:
      canAccessEvent in interface org.exoplatform.agenda.service.AgendaEventService
    • getEventAccess

      public org.exoplatform.agenda.constant.EventAccess getEventAccess(org.exoplatform.agenda.model.Event event, long identityId)

      The reading that existed before sharing — the reader may see the calendar, or is invited — is EventAccess.FULL; a reader admitted only by a share record (EXO-90357) is EventAccess.SHARED when the share is for viewing and EventAccess.SHARED_EDIT when it is for editing (EXO-90378), and only a user can be either: a share names a user, never a space or a guest. The share is asked last, so nobody who could read before is ever read as a sharee, and it is asked once — the level comes back with the answer, from the reader's own cached map.

      Specified by:
      getEventAccess in interface org.exoplatform.agenda.service.AgendaEventService
    • canUpdateEvent

      public boolean canUpdateEvent(org.exoplatform.agenda.model.Event event, long userIdentityId)
      Specified by:
      canUpdateEvent in interface org.exoplatform.agenda.service.AgendaEventService
    • canCreateEvent

      public boolean canCreateEvent(org.exoplatform.agenda.model.Calendar calendar, long userIdentityId)
      Never in a subscribed calendar (EXO-90278), whose events come from its feed alone. A colleague holding an edit share on a personal calendar creates in it as its owner would (EXO-90378).
      Specified by:
      canCreateEvent in interface org.exoplatform.agenda.service.AgendaEventService
    • search

      public List<org.exoplatform.agenda.model.EventSearchResult> search(org.exoplatform.agenda.model.AgendaEventSearchFilter filter)
      Specified by:
      search in interface org.exoplatform.agenda.service.AgendaEventService
    • getEventOccurrencesInPeriod

      public List<org.exoplatform.agenda.model.Event> getEventOccurrencesInPeriod(org.exoplatform.agenda.model.Event recurrentEvent, ZonedDateTime start, ZonedDateTime end, ZoneId timezone, int limit)
      Specified by:
      getEventOccurrencesInPeriod in interface org.exoplatform.agenda.service.AgendaEventService
    • selectEventDateOption

      public void selectEventDateOption(long eventId, long dateOptionId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException
      Specified by:
      selectEventDateOption in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
      IllegalAccessException
    • getPendingEvents

      public List<org.exoplatform.agenda.model.Event> getPendingEvents(List<Long> ownerIds, long userIdentityId, ZoneId userTimeZone, int offset, int limit) throws Exception
      Specified by:
      getPendingEvents in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      Exception
    • countPendingEvents

      public long countPendingEvents(List<Long> ownerIds, long userIdentityId) throws Exception
      Specified by:
      countPendingEvents in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      Exception
    • getEventDatePolls

      public List<org.exoplatform.agenda.model.Event> getEventDatePolls(org.exoplatform.agenda.model.EventFilter eventFilter, ZoneId userTimeZone, long userIdentityId) throws IllegalAccessException
      Specified by:
      getEventDatePolls in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException
    • countEventDatePolls

      public long countEventDatePolls(List<Long> ownerIds, long userIdentityId) throws IllegalAccessException
      Specified by:
      countEventDatePolls in interface org.exoplatform.agenda.service.AgendaEventService
      Throws:
      IllegalAccessException