Class AgendaCalendarStorage

java.lang.Object
org.exoplatform.agenda.storage.AgendaCalendarStorage
Direct Known Subclasses:
CachedAgendaCalendarStorage

public class AgendaCalendarStorage extends Object
  • Constructor Details

    • AgendaCalendarStorage

      public AgendaCalendarStorage(AgendaEventStorage agendaEventStorage, CalendarDAO calendarDAO, org.exoplatform.services.listener.ListenerService listenerService)
  • Method Details

    • getCalendarIdsByOwnerIds

      public List<Long> getCalendarIdsByOwnerIds(int offset, int limit, Long... ownerIds)
    • getAllCalendarIdsByOwnerId

      public List<Long> getAllCalendarIdsByOwnerId(long ownerId)
      Every calendar id of an owner, subscribed calendars included.
      Parameters:
      ownerId - technical identifier of the calendar owner identity
      Returns:
      the ids, possibly empty
    • getSystemCalendarIdByOwnerId

      public Long getSystemCalendarIdByOwnerId(long ownerId)
      Retrieves the technical identifier of the system (default) calendar of a given owner.
      Parameters:
      ownerId - technical identifier of the calendar owner identity
      Returns:
      technical identifier of the owner's system calendar, or null when the owner has no system calendar
    • countCalendarsByOwners

      public int countCalendarsByOwners(Long... ownerIds)
    • getCalendarById

      public org.exoplatform.agenda.model.Calendar getCalendarById(long calendarId)
    • createCalendar

      public org.exoplatform.agenda.model.Calendar createCalendar(org.exoplatform.agenda.model.Calendar calendar)
    • updateCalendar

      public void updateCalendar(org.exoplatform.agenda.model.Calendar calendar)
    • moveCalendarEvents

      public List<Long> moveCalendarEvents(long fromCalendarId, long toCalendarId, long modifierId)
      Moves all events of a calendar to another calendar, then broadcasts one exo.agenda.event.moved event per moved event so that listeners (Elasticsearch indexing, connectors) converge on the new calendar membership. No business logic here: the decision of what to move and where belongs to the service layer.
      Parameters:
      fromCalendarId - technical identifier of the calendar the events are moved away from
      toCalendarId - technical identifier of the calendar receiving the events
      modifierId - Identity technical identifier of the user who triggered the move
      Returns:
      List of technical identifiers of the moved events, empty when the source calendar had no events
    • deleteCalendarById

      public void deleteCalendarById(long calendarId)
    • calendarDeleted

      protected void calendarDeleted(long calendarId)
      Called once a calendar is deleted, before its deletion is broadcast; a caching subclass forgets it here.
      Parameters:
      calendarId - the deleted calendar