Interface CalendarEventRepository

    • Method Detail

      • getByExternalId

        CalendarEvent getByExternalId​(Calendar calendar,
                                      String externalId)
        Gets an event by its external identifier which is unique into context of a calendar.
        Parameters:
        calendar - the calendar to search into.
        externalId - the external identifier as string.
        Returns:
        the calendar event if any, null otherwise.
      • streamAll

        Stream<CalendarEvent> streamAll​(CalendarEventFilter filter)
        Gets all the events that satisfies the specified filter
        Please be careful to always close the streams in order to avoid memory leaks!!!
         
           try(Stream<CalendarEvent> event : streamAll(myFilter)) {
             // Performing the treatment
           }
         
         
        Parameters:
        filter - a filter to apply on the calendar events to return. The filter can be empty and then no filtering will be applied on the requested calendar events.
        Returns:
        the events as a stream.
      • deleteAll

        void deleteAll​(Calendar calendar)
        Deletes all the events that belongs to the specified calendar.
        Parameters:
        calendar - the calendar for which all the events must be deleted.
      • size

        long size​(Calendar calendar)
        Gets size in events in the repository for the specified calendar.
        Parameters:
        calendar - the calendar for which all the events must be counted.
        Returns:
        the count of events in the given calendar.
      • getAllBetween

        List<CalendarEvent> getAllBetween​(CalendarEventFilter filter,
                                          Instant startDateTime,
                                          Instant endDateTime)
        Gets all the events matching the specified filter and that occur between the two specified date and times.
        Parameters:
        filter - a filter to apply on the calendar events to return. The filter can be empty and then no filtering will be applied on the requested calendar events.
        startDateTime - the inclusive instant in UTC/Greenwich at which begins the period in which the events are get.
        endDateTime - the inclusive instant in UTC/Greenwich at which ends the period in which the events are get.
        Returns:
        a list of events filtering by the given filter and that occur between the two date times or an empty list if there is no events matching the specified arguments.
      • moveToCalendar

        CalendarEvent moveToCalendar​(CalendarEvent event,
                                     Calendar target)
        Moves the given event from specified calendar to the one the CalendarEvent instance refers.
        Parameters:
        event - the event instance with previous calendar linking
        target - the calendar into which the event must be moved
        Returns:
        the updated calendar.