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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CalDavCalendarCollection
addCollection(String id)
Adds the specified collection to the store.CalDavCalendarCollection
addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone)
CalDavCalendarCollection
addCollection(String id, org.apache.jackrabbit.webdav.property.DavPropertySet properties)
protected List<Attendee>
executePrincipalPropSearch(Element principalPropSearch)
String
findCalendarHomeSet()
protected String
findCalendarHomeSet(String propfindUri)
This method try to find the calendar-home-set attribute in the user's DAV principals.ArrayList<ScheduleResponse>
findFreeBusyInfoForAttendees(Organizer organizer, ArrayList<Attendee> attendees, DtStart startTime, DtEnd endTime)
This method will return free-busy information for each attendee.protected String
findInboxOrOutbox(org.apache.jackrabbit.webdav.property.DavPropertyName type)
String
findScheduleInbox()
String
findScheduleOutbox()
List<Attendee>
getAllPrincipalsForType(CuType type)
List<Attendee>
getAllResources()
List<Attendee>
getAllRooms()
CalDavCalendarCollection
getCollection(String id)
List<CalDavCalendarCollection>
getCollections()
This method will try to find all calendar collections available at the calendar-home-set URI of the user.protected List<CalDavCalendarCollection>
getCollectionsForHomeSet(CalDavCalendarStore store, String urlForcalendarHomeSet)
protected List<CalDavCalendarCollection>
getDelegateCollections(org.apache.jackrabbit.webdav.property.DavProperty<?> proxyDavProperty)
List<CalDavCalendarCollection>
getDelegatedCollections()
Get the list of available delegated collections, Apple's iCal styleprotected List<CalDavCalendarCollection>
getDelegatedCollections(String type)
String
getDisplayName()
List<Attendee>
getIndividuals(String nameToSearch)
List<CalDavCalendarCollection>
getReadOnlyDelegatedCollections()
List<Attendee>
getRooms(String nameToSearch)
protected List<Attendee>
getUserTypes(CuType type, String nameToSearch)
Use this method to search for resources (individual, group, resource, room).List<CalDavCalendarCollection>
getWriteDelegatedCollections()
CalendarCollection
merge(String id, CalendarCollection calendar)
protected Element
propertiesForPropSearch(Document document)
CalDavCalendarCollection
removeCollection(String id)
Removes the collection with specified id from the store.void
setDisplayName(String displayName)
-
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, org.apache.jackrabbit.webdav.DavException
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
-
getDelegateCollections
protected List<CalDavCalendarCollection> getDelegateCollections(org.apache.jackrabbit.webdav.property.DavProperty<?> proxyDavProperty) throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationException
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(String 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 ArrayList<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
-
-