Package net.fortuna.ical4j.connector.dav
Class CalDavCalendarStore
- java.lang.Object
-
- net.fortuna.ical4j.connector.dav.AbstractDavObjectStore<CalDavCalendarCollection>
-
- net.fortuna.ical4j.connector.dav.CalDavCalendarStore
-
- All Implemented Interfaces:
CalendarStore<CalDavCalendarCollection>
,ObjectStore<CalDavCalendarCollection>
public final class CalDavCalendarStore extends AbstractDavObjectStore<CalDavCalendarCollection> implements CalendarStore<CalDavCalendarCollection>
$Id$ Created on 24/02/2008
-
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.connector.dav.AbstractDavObjectStore
pathResolver
-
-
Constructor Summary
Constructors Constructor Description CalDavCalendarStore(String prodId, URL url, PathResolver pathResolver)
-
Method Summary
-
Methods inherited from class net.fortuna.ical4j.connector.dav.AbstractDavObjectStore
connect, connect, connect, disconnect, getClient, getHostURL, getPath, getUserName, isConnected, isSupportCalendarProxy, supportedFeatures
-
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.ObjectStore
connect, connect, disconnect, isConnected
-
-
-
-
Constructor Detail
-
CalDavCalendarStore
public CalDavCalendarStore(String prodId, URL url, PathResolver pathResolver)
- Parameters:
prodId
- application product identifierurl
- the URL of a CalDAV server instancepathResolver
- the path resolver for the CalDAV server type
-
-
Method Detail
-
addCollection
public CalDavCalendarCollection addCollection(String id) throws ObjectStoreException
Adds the specified collection to the store.- Specified by:
addCollection
in interfaceObjectStore<CalDavCalendarCollection>
- Parameters:
id
- a collection identifier- Returns:
- the new collection instance
- Throws:
ObjectStoreException
- if a calendar with the specified id already exists in the store
-
addCollection
public CalDavCalendarCollection addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone) throws ObjectStoreException
- Specified by:
addCollection
in interfaceObjectStore<CalDavCalendarCollection>
- Parameters:
id
- a collection identifierdisplayName
- the collection namedescription
- the collection descriptionsupportedComponents
- supported collection objectstimezone
- collection timezone- Returns:
- the new collection instance
- Throws:
ObjectStoreException
- where an unexpected error occurs
-
addCollection
public CalDavCalendarCollection addCollection(String id, org.apache.jackrabbit.webdav.property.DavPropertySet properties) throws ObjectStoreException
- Throws:
ObjectStoreException
-
getCollection
public CalDavCalendarCollection getCollection(String id) throws ObjectStoreException, ObjectNotFoundException
- Specified by:
getCollection
in interfaceObjectStore<CalDavCalendarCollection>
- Parameters:
id
- a collection identifier- Returns:
- an object collection with the specified id. If no collection with the specified id
is found in this store, an
ObjectNotFoundException
is thrown. - Throws:
ObjectStoreException
- where an unexpected error occursObjectNotFoundException
- if a collection with the specified identifier doesn't exist
-
merge
public CalendarCollection merge(String id, CalendarCollection calendar)
-
findCalendarHomeSet
public String findCalendarHomeSet() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
-
findCalendarHomeSet
protected String findCalendarHomeSet(String propfindUri) throws IOException
This method try to find the calendar-home-set attribute in the user's DAV principals. The calendar-home-set attribute is the URI of the main collection of calendars for the user.- Returns:
- the URI for the main calendar collection
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
-
getCollections
public List<CalDavCalendarCollection> getCollections() throws ObjectStoreException, ObjectNotFoundException
This method will try to find all calendar collections available at the calendar-home-set URI of the user.- Specified by:
getCollections
in interfaceObjectStore<CalDavCalendarCollection>
- Returns:
- An array of all available calendar collections
- Throws:
ParserConfigurationException
- where the parse is not configured correctlyIOException
- where a communications error occursorg.apache.jackrabbit.webdav.DavException
- where an error occurs calling the DAV methodObjectStoreException
ObjectNotFoundException
-
getCollectionsForHomeSet
protected List<CalDavCalendarCollection> getCollectionsForHomeSet(CalDavCalendarStore store, String urlForcalendarHomeSet) throws IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
IOException
org.apache.jackrabbit.webdav.DavException
-
getDelegatedCollections
public List<CalDavCalendarCollection> getDelegatedCollections() throws Exception
Get the list of available delegated collections, Apple's iCal style- Returns:
- Throws:
Exception
-
getDelegatedCollections
protected List<CalDavCalendarCollection> getDelegatedCollections(ExpandPropertyQuery.Type type) throws Exception
- Throws:
Exception
-
getWriteDelegatedCollections
public List<CalDavCalendarCollection> getWriteDelegatedCollections() throws Exception
- Throws:
Exception
-
getReadOnlyDelegatedCollections
public List<CalDavCalendarCollection> getReadOnlyDelegatedCollections() throws Exception
- Throws:
Exception
-
removeCollection
public CalDavCalendarCollection removeCollection(String id) throws ObjectStoreException, ObjectNotFoundException
Removes the collection with specified id from the store.- Specified by:
removeCollection
in interfaceObjectStore<CalDavCalendarCollection>
- Parameters:
id
- a collection identifier- Returns:
- if a collection with the specified id exists in the store it is returned. Otherwise returns null.
- Throws:
ObjectStoreException
- where an unexpected error occursObjectNotFoundException
- if a collection with the specified identifier doesn't exist
-
getDisplayName
public String getDisplayName()
-
setDisplayName
public void setDisplayName(String displayName)
-
findScheduleOutbox
public String findScheduleOutbox() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
-
findScheduleInbox
public String findScheduleInbox() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
-
findInboxOrOutbox
protected String findInboxOrOutbox(org.apache.jackrabbit.webdav.property.DavPropertyName type) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
-
findFreeBusyInfoForAttendees
public List<ScheduleResponse> findFreeBusyInfoForAttendees(Organizer organizer, ArrayList<Attendee> attendees, DtStart startTime, DtEnd endTime) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, ParseException, ParserException, SAXException
This method will return free-busy information for each attendee. If the free-busy information can't be retrieve (for example, users on an foreign server), check the isSuccess method to see if free-busy lookup was successful.- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
ParseException
ParserException
SAXException
-
getIndividuals
public List<Attendee> getIndividuals(String nameToSearch) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
getRooms
public List<Attendee> getRooms(String nameToSearch) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
getAllRooms
public List<Attendee> getAllRooms() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
getAllResources
public List<Attendee> getAllResources() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
getAllPrincipalsForType
public List<Attendee> getAllPrincipalsForType(CuType type) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
getUserTypes
protected List<Attendee> getUserTypes(CuType type, String nameToSearch) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException, URISyntaxException
Use this method to search for resources (individual, group, resource, room). For example, if you want to find all rooms that begins with "Room" in their email or email address, call this method with: getUserTypes(CuType.ROOM, "Room"); If nameToSearch is null, it will find all resources for the desired type.- Parameters:
type
-nameToSearch
-- Returns:
- Throws:
ParserConfigurationException
IOException
org.apache.jackrabbit.webdav.DavException
URISyntaxException
-
executePrincipalPropSearch
protected List<Attendee> executePrincipalPropSearch(Element principalPropSearch) throws org.apache.jackrabbit.webdav.DavException, IOException, URISyntaxException
- Throws:
org.apache.jackrabbit.webdav.DavException
IOException
URISyntaxException
-
-