Package net.fortuna.ical4j.connector.dav
Class CalDavCalendarCollection
- java.lang.Object
-
- net.fortuna.ical4j.connector.dav.AbstractDavObjectCollection<Calendar>
-
- net.fortuna.ical4j.connector.dav.CalDavCalendarCollection
-
- All Implemented Interfaces:
CalendarCollection,ObjectCollection<Calendar>
public class CalDavCalendarCollection extends AbstractDavObjectCollection<Calendar> implements CalendarCollection
$Id$ Created on 24/02/2008
-
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.connector.dav.AbstractDavObjectCollection
properties
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCalendar(String uri, Calendar calendar)Stores the specified calendar in this collection, using the specified URI.voidaddCalendar(Calendar calendar)Add a new calendar object in the collection.Calendar[]doFreeBusyQuery()TODO: implement free-busy-queryCalendarexport()Exports the entire collection as a single calendar object.CalendargetCalendar(String uid)Returns the calendar object with the specified UID.CalendargetCalendarFromUri(String uri)Returns the calendar object located at the specified URI.Calendar[]getCalendars()Deprecated.Use the getEvents() methodStringgetColor()Calendar[]getComponents()Returns all objects stored in the collection.Calendar[]getComponentsByType(String componentType)StringgetDescription()Provides a human-readable description of the calendar collection.StringgetDisplayName()Human-readable name of the collection.Calendar[]getEvents()List<Calendar>getEventsForTimePeriod(DateTime startTime, DateTime endTime)Get a list of calendar objects of VEVENT type for a specific time period.IntegergetMaxAttendeesPerInstance()Provides a numeric value indicating the maximum number of ATTENDEE properties in any instance of a calendar object resource stored in a calendar collection.StringgetMaxDateTime()Provides 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.IntegergetMaxInstances()Provides a numeric value indicating the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate.longgetMaxResourceSize()Provides 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.StringgetMinDateTime()Provides 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.Calendar[]getObjectsByMultiget(ArrayList<URI> hrefs, Element calData)TODO: implement calendar-multiget to fetch objects based on hrefintgetOrder()String[]getSupportedComponentTypes()Get the list of calendar components (VEVENT, VTODO, etc.) that this collection supports.Calendar[]getTasks()CalendargetTimeZone()The CALDAV:calendar-timezone property is used to specify the time zone the server should rely on to resolve "date" values and "date with local time" values (i.e., floating time) to "date with UTC time" values.voidmerge(Calendar calendar)Merges the specified calendar object with this collecton.static org.apache.jackrabbit.webdav.property.DavPropertyNameSetpropertiesForFetch()CalendarremoveCalendar(String uid)CalendarremoveCalendarFromUri(String uri)StringtoString()voidupdateCalendar(String uri, Calendar calendar)Update a calendar object in the collection.voidupdateCalendar(Calendar calendar)Update a calendar object in the collection.voidwriteCalendarOnServer(String uri, Calendar calendar, boolean isNew)voidwriteCalendarOnServer(Calendar calendar, boolean isNew)-
Methods inherited from class net.fortuna.ical4j.connector.dav.AbstractDavObjectCollection
delete, exists, getId, getOwnerHref, getOwnerName, getPath, getProperty, getQuotaAvailableBytes, getQuotaUsedBytes, getResourceTypes, getStore, getSupportedMediaTypes, isReadOnly, setReadOnly
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.connector.CalendarCollection
getSupportedMediaTypes
-
-
-
-
Method Detail
-
getCalendars
@Deprecated public Calendar[] getCalendars()
Deprecated.Use the getEvents() method- Returns:
- an array of calendar objects
- See Also:
ObjectCollection.getComponents()
-
getEvents
public Calendar[] getEvents()
- Returns:
- and array of calendar objects
-
getTasks
public Calendar[] getTasks()
- Returns:
- and array of calendar objects
-
getComponentsByType
public Calendar[] getComponentsByType(String componentType)
- Parameters:
componentType- the type of component- Returns:
- and array of calendar objects
-
getDescription
public String getDescription()
Provides a human-readable description of the calendar collection.- Specified by:
getDescriptionin interfaceObjectCollection<Calendar>- Returns:
- the collection description
-
getDisplayName
public String getDisplayName()
Human-readable name of the collection.- Specified by:
getDisplayNamein interfaceObjectCollection<Calendar>- Returns:
- the collection name
-
getMaxAttendeesPerInstance
public Integer getMaxAttendeesPerInstance()
Provides a numeric value indicating the maximum number of ATTENDEE properties in any instance of a calendar object resource stored in a calendar collection.- Specified by:
getMaxAttendeesPerInstancein 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.
-
getMaxDateTime
public String getMaxDateTime()
Provides 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.- Specified by:
getMaxDateTimein 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()
Provides a numeric value indicating the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate.- Specified by:
getMaxInstancesin interfaceCalendarCollection- Returns:
- a numeric value indicating the maximum number of recurrence instances that a calendar object resource stored in a calendar collection can generate.
-
getMaxResourceSize
public long getMaxResourceSize()
Provides 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. 0 = no limits.- Specified by:
getMaxResourceSizein 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()
Provides 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.- Specified by:
getMinDateTimein 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.
-
getSupportedComponentTypes
public String[] getSupportedComponentTypes()
Get the list of calendar components (VEVENT, VTODO, etc.) that this collection supports.- Specified by:
getSupportedComponentTypesin interfaceCalendarCollection- Returns:
- an array of component names indicating the type of components supported by the collection.
-
getTimeZone
public Calendar getTimeZone()
The CALDAV:calendar-timezone property is used to specify the time zone the server should rely on to resolve "date" values and "date with local time" values (i.e., floating time) to "date with UTC time" values.- Specified by:
getTimeZonein interfaceCalendarCollection- Returns:
- an iCalendar object with exactly one VTIMEZONE component.
-
getColor
public String getColor()
-
getOrder
public int getOrder()
-
addCalendar
public void addCalendar(Calendar calendar) throws ObjectStoreException, ConstraintViolationException
Add a new calendar object in the collection. Creation will be done on the server right away.- Specified by:
addCalendarin 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)
-
addCalendar
public void addCalendar(String uri, Calendar calendar) throws ObjectStoreException
Stores the specified calendar in this collection, using the specified URI.- Parameters:
uri- the URI (relative to this collection's path) where the calendar is to be storedcalendar- a calendar object instance to be added to the collection- Throws:
ObjectStoreException- when an unexpected error occurs (implementation-specific)
-
updateCalendar
public void updateCalendar(Calendar calendar) throws ObjectStoreException, ConstraintViolationException
Update a calendar object in the collection. Update will be send to the server right away.- Parameters:
calendar-- Throws:
ObjectStoreExceptionConstraintViolationException
-
updateCalendar
public void updateCalendar(String uri, Calendar calendar) throws ObjectStoreException
Update a calendar object in the collection. Update will be send to the server right away.- Parameters:
calendar-- Throws:
ObjectStoreException
-
writeCalendarOnServer
public void writeCalendarOnServer(Calendar calendar, boolean isNew) throws ObjectStoreException, ConstraintViolationException
-
writeCalendarOnServer
public void writeCalendarOnServer(String uri, Calendar calendar, boolean isNew) throws ObjectStoreException
- Throws:
ObjectStoreException
-
getCalendar
public Calendar getCalendar(String uid) throws ObjectNotFoundException
Returns the calendar object with the specified UID.- Specified by:
getCalendarin 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
-
getCalendarFromUri
public Calendar getCalendarFromUri(String uri) throws ObjectNotFoundException
Returns the calendar object located at the specified URI.- Parameters:
uri- the URI (relative to this collection's path) where the calendar is to be found- Returns:
- a calendar object or null if no calendar exists under the specified URI
- Throws:
ObjectNotFoundException
-
removeCalendar
public Calendar removeCalendar(String uid) throws FailedOperationException, ObjectStoreException, ObjectNotFoundException
- Specified by:
removeCalendarin interfaceCalendarCollection- Parameters:
uid- the UID of the calendar to remove- Returns:
- the calendar that was successfully removed from the collection
- Throws:
ObjectStoreException- where an unexpected error occursFailedOperationExceptionObjectNotFoundException
-
removeCalendarFromUri
public Calendar removeCalendarFromUri(String uri) throws FailedOperationException, ObjectStoreException, ObjectNotFoundException
- Parameters:
uri- the URI (relative to this collection's path) where the calendar is to be found- Returns:
- the calendar that was successfully removed from the collection
- Throws:
ObjectStoreException- where an unexpected error occursFailedOperationExceptionObjectNotFoundException
-
merge
public final void merge(Calendar calendar) throws FailedOperationException, ObjectStoreException
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:
mergein 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
Exports the entire collection as a single calendar object.- Specified by:
exportin 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
Returns all objects stored in the collection.- Specified by:
getComponentsin interfaceObjectCollection<Calendar>- Returns:
- an array of collection objects
- Throws:
ObjectStoreException- where an unexpected error occurs
-
getEventsForTimePeriod
public List<Calendar> getEventsForTimePeriod(DateTime startTime, DateTime endTime) throws IOException, org.apache.jackrabbit.webdav.DavException, ParserConfigurationException, ParserException
Get a list of calendar objects of VEVENT type for a specific time period.- Parameters:
startTime-endTime-- Returns:
- Throws:
IOExceptionorg.apache.jackrabbit.webdav.DavExceptionParserConfigurationExceptionParserException
-
getObjectsByMultiget
public Calendar[] getObjectsByMultiget(ArrayList<URI> hrefs, Element calData) throws IOException, org.apache.jackrabbit.webdav.DavException, ParserConfigurationException, ParserException
TODO: implement calendar-multiget to fetch objects based on href- Parameters:
hrefs-calData-- Returns:
- Throws:
IOExceptionorg.apache.jackrabbit.webdav.DavExceptionParserConfigurationExceptionParserException
-
doFreeBusyQuery
public Calendar[] doFreeBusyQuery()
TODO: implement free-busy-query- Returns:
-
propertiesForFetch
public static final org.apache.jackrabbit.webdav.property.DavPropertyNameSet propertiesForFetch()
-
-