Class DefaultCalendarEventRepository

    • Constructor Detail

      • DefaultCalendarEventRepository

        public DefaultCalendarEventRepository()
    • Method Detail

      • getByExternalId

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

        public Stream<CalendarEvent> streamAll​(CalendarEventFilter filter)
        Description copied from interface: CalendarEventRepository
        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
           }
         
         
        Specified by:
        streamAll in interface CalendarEventRepository
        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.
      • size

        public long size​(Calendar calendar)
        Description copied from interface: CalendarEventRepository
        Gets size in events in the repository for the specified calendar.
        Specified by:
        size in interface CalendarEventRepository
        Parameters:
        calendar - the calendar for which all the events must be counted.
        Returns:
        the count of events in the given calendar.
      • getAllBetween

        public List<CalendarEvent> getAllBetween​(CalendarEventFilter filter,
                                                 Instant startDateTime,
                                                 Instant endDateTime)
        Description copied from interface: CalendarEventRepository
        Gets all the events matching the specified filter and that occur between the two specified date and times.
        Specified by:
        getAllBetween in interface CalendarEventRepository
        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.
      • deleteAll

        public void deleteAll​(Calendar calendar)
        Description copied from interface: CalendarEventRepository
        Deletes all the events that belongs to the specified calendar.
        Specified by:
        deleteAll in interface CalendarEventRepository
        Parameters:
        calendar - the calendar for which all the events must be deleted.