Class LocalCalendarCollection
- java.lang.Object
-
- net.fortuna.ical4j.connector.local.AbstractLocalObjectCollection<Calendar>
-
- net.fortuna.ical4j.connector.local.LocalCalendarCollection
-
- All Implemented Interfaces:
CalendarCollection
,ObjectCollection<Calendar>
public class LocalCalendarCollection extends AbstractLocalObjectCollection<Calendar> implements CalendarCollection
-
-
Constructor Summary
Constructors Constructor Description LocalCalendarCollection(File root)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCalendar(Calendar calendar)
Stores the specified calendar in this collection.Calendar
export()
Exports the entire collection as a single calendar object.Calendar
getCalendar(String uid)
Returns the calendar object with the specified UID.Calendar[]
getComponents()
Returns all objects stored in the collection.Integer
getMaxAttendeesPerInstance()
String
getMaxDateTime()
Integer
getMaxInstances()
long
getMaxResourceSize()
String
getMinDateTime()
MediaType[]
getSupportedMediaTypes()
void
merge(Calendar calendar)
Merges the specified calendar object with this collecton.Calendar
removeCalendar(String uid)
-
Methods inherited from class net.fortuna.ical4j.connector.local.AbstractLocalObjectCollection
getDescription, getDisplayName, getRoot, getSupportedComponentTypes, getTimeZone, setDescription, setDisplayName, setSupportedComponents, setTimeZone
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.connector.CalendarCollection
getSupportedComponentTypes, getTimeZone
-
Methods inherited from interface net.fortuna.ical4j.connector.ObjectCollection
getDescription, getDisplayName
-
-
-
-
Constructor Detail
-
LocalCalendarCollection
public LocalCalendarCollection(File root)
-
-
Method Detail
-
getSupportedMediaTypes
public MediaType[] getSupportedMediaTypes()
- Specified by:
getSupportedMediaTypes
in interfaceCalendarCollection
- Returns:
- the media type supported for the calendar object resources contained in a given calendar collection (e.g., iCalendar version 2.0).
-
getMaxResourceSize
public long getMaxResourceSize()
- Specified by:
getMaxResourceSize
in interfaceCalendarCollection
- Returns:
- a numeric value indicating the maximum size of a resource in octets that the server is willing to accept when a calendar object resource is stored in a calendar collection.
-
getMinDateTime
public String getMinDateTime()
- Specified by:
getMinDateTime
in interfaceCalendarCollection
- Returns:
- a DATE-TIME value indicating the earliest date and time (in UTC) that the server is willing to accept for any DATE or DATE-TIME value in a calendar object resource stored in a calendar collection.
-
getMaxDateTime
public String getMaxDateTime()
- Specified by:
getMaxDateTime
in interfaceCalendarCollection
- Returns:
- a DATE-TIME value indicating the latest date and time (in UTC) that the server is willing to accept for any DATE or DATE-TIME value in a calendar object resource stored in a calendar collection.
-
getMaxInstances
public Integer getMaxInstances()
- Specified by:
getMaxInstances
in interfaceCalendarCollection
- Returns:
- a numeric value indicating the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate.
-
getMaxAttendeesPerInstance
public Integer getMaxAttendeesPerInstance()
- Specified by:
getMaxAttendeesPerInstance
in interfaceCalendarCollection
- Returns:
- a numeric value indicating the maximum number of ATTENDEE properties in any instance of a calendar object resource stored in a calendar collection.
-
addCalendar
public void addCalendar(Calendar calendar) throws ObjectStoreException, ConstraintViolationException
Description copied from interface:CalendarCollection
Stores the specified calendar in this collection.- Specified by:
addCalendar
in interfaceCalendarCollection
- Parameters:
calendar
- a calendar object instance to be added to the collection- Throws:
ObjectStoreException
- when an unexpected error occurs (implementation-specific)ConstraintViolationException
- if the specified calendar has no single unique identifier (UID)
-
getCalendar
public Calendar getCalendar(String uid) throws ObjectNotFoundException
Description copied from interface:CalendarCollection
Returns the calendar object with the specified UID.- Specified by:
getCalendar
in interfaceCalendarCollection
- Parameters:
uid
- the UID associated with the returned calendar- Returns:
- a calendar object or null if no calendar with the specified UID exists
- Throws:
ObjectNotFoundException
-
removeCalendar
public Calendar removeCalendar(String uid) throws FailedOperationException, ObjectNotFoundException
- Specified by:
removeCalendar
in interfaceCalendarCollection
- Parameters:
uid
- the UID of the calendar to remove- Returns:
- the calendar that was successfully removed from the collection
- Throws:
FailedOperationException
ObjectNotFoundException
-
merge
public void merge(Calendar calendar) throws FailedOperationException, ObjectStoreException
Description copied from interface:CalendarCollection
Merges the specified calendar object with this collecton. This is done by decomposing the calendar object into a set of objects per unique identifier (UID) and adding these objects to the collection.- Specified by:
merge
in interfaceCalendarCollection
- Parameters:
calendar
- a calendar object instance to merge into the collection- Throws:
FailedOperationException
- where the merge operation failsObjectStoreException
-
export
public Calendar export() throws ObjectStoreException
Description copied from interface:CalendarCollection
Exports the entire collection as a single calendar object.- Specified by:
export
in interfaceCalendarCollection
- Returns:
- a calendar object instance that contains all calendars in the collection
- Throws:
ObjectStoreException
- where an unexpected error occurs
-
getComponents
public Calendar[] getComponents() throws ObjectStoreException
Description copied from interface:ObjectCollection
Returns all objects stored in the collection.- Specified by:
getComponents
in interfaceObjectCollection<Calendar>
- Returns:
- an array of collection objects
- Throws:
ObjectStoreException
- where an unexpected error occurs
-
-