Class IcsReader
java.lang.Object
org.ametys.plugins.calendar.icsreader.IcsReader
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
Read a distant ICS file for a certain number of events in the future
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IcsReader.IcsEvents_getEventList(String url, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Get a list of events from an ics file, without trying the cachegetEventDates(VEvent event, EventsFilterHelper.DateTimeRange dateRange, Tag tag) Get a list ofLocalDatecovered by this eventgetEventList(String name, String content, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents) Transform a ical string into a list of eventsgetEventList(String url, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Get a list of events from an ics filegetEventsInRangeFromCalendar(Calendar calendar, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents) Extract events from a calendarvoidvoidservice(ServiceManager smanager) voidsetLogger(org.slf4j.Logger logger) Called at creation time to provide aLogger.
-
Field Details
-
ROLE
The Avalon role. -
_logger
logger
-
-
Constructor Details
-
IcsReader
public IcsReader()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getEventList
public IcsReader.IcsEvents getEventList(String url, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Get a list of events from an ics file- Parameters:
url- url of the ics filedateRange- range of dates to fetchnbEvents- number of events to readmaxFileSize- max ics file size (in bytes)- Returns:
- a List of
VEvent
-
_getEventList
protected IcsReader.IcsEvents _getEventList(String url, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents, Long maxFileSize) Get a list of events from an ics file, without trying the cache- Parameters:
url- url of the ics filedateRange- range of dates to fetchnbEvents- number of events to readmaxFileSize- max ics file size (in bytes)- Returns:
- a List of
VEvent
-
getEventList
public IcsReader.IcsEvents getEventList(String name, String content, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents) Transform a ical string into a list of events- Parameters:
name- the name of the icalcontent- the ical contentdateRange- a date range to filter the events (can be null)nbEvents- the maximum number of event to retrieve- Returns:
- the list of events
-
getEventsInRangeFromCalendar
protected List<VEvent> getEventsInRangeFromCalendar(Calendar calendar, EventsFilterHelper.DateTimeRange dateRange, Long nbEvents) Extract events from a calendar- Parameters:
calendar- the calendar to usedateRange- a range to limit event (can be null)nbEvents- a maximum number of events- Returns:
- the list of events
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
getEventDates
public List<LocalVEvent> getEventDates(VEvent event, EventsFilterHelper.DateTimeRange dateRange, Tag tag) Get a list ofLocalDatecovered by this event- Parameters:
event- the event to testdateRange- the dates to check, can be null but this will return nulltag- the tag used for this ICS- Returns:
- a list of
LocalDatefor the days in which this event appears, or null if nothing matches
-
setLogger
Description copied from interface:LogEnabledCalled at creation time to provide aLogger.- Specified by:
setLoggerin interfaceLogEnabled- Parameters:
logger- aLoggerfor messages.
-