Package net.fortuna.ical4j.connector.jcr
Class JcrCalendarCollection
- java.lang.Object
-
- org.jcrom.AbstractJcrEntity
-
- net.fortuna.ical4j.connector.jcr.AbstractJcrObjectCollection<Calendar>
-
- net.fortuna.ical4j.connector.jcr.JcrCalendarCollection
-
- All Implemented Interfaces:
Serializable
,CalendarCollection
,ObjectCollection<Calendar>
public class JcrCalendarCollection extends AbstractJcrObjectCollection<Calendar> implements CalendarCollection
$Id$ Created on: 15/01/2009- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JcrCalendarCollection()
-
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()
String[]
getSupportedComponentTypes()
MediaType[]
getSupportedMediaTypes()
Calendar
getTimeZone()
void
merge(Calendar calendar)
Merges the specified calendar object with this collecton.Calendar
removeCalendar(String uid)
-
Methods inherited from class net.fortuna.ical4j.connector.jcr.AbstractJcrObjectCollection
getCollectionName, getDescription, getDisplayName, getNode, getStore, setCollectionName, setDescription, setDisplayName, setStore
-
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.ObjectCollection
getDescription, getDisplayName
-
-
-
-
Method Detail
-
addCalendar
public void addCalendar(Calendar calendar) throws ObjectStoreException, ConstraintViolationException
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)
-
export
public Calendar export() throws ObjectStoreException
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
-
getCalendar
public Calendar getCalendar(String uid) throws ObjectNotFoundException
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
-
getComponents
public Calendar[] getComponents() throws ObjectStoreException
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
-
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.
-
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.
-
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.
-
getSupportedComponentTypes
public String[] getSupportedComponentTypes()
- Specified by:
getSupportedComponentTypes
in interfaceCalendarCollection
- Returns:
- an array of component names indicating the type of components supported by the collection.
-
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).
-
getTimeZone
public Calendar getTimeZone()
- Specified by:
getTimeZone
in interfaceCalendarCollection
- Returns:
- an iCalendar object with exactly one VTIMEZONE component.
-
removeCalendar
public Calendar removeCalendar(String uid) throws ObjectStoreException, 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:
ObjectStoreException
- where an unexpected error occursObjectNotFoundException
-
merge
public 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:
merge
in interfaceCalendarCollection
- Parameters:
calendar
- a calendar object instance to merge into the collection- Throws:
FailedOperationException
- where the merge operation failsObjectStoreException
-
-