Package net.fortuna.ical4j.connector.dav
Class CardDavStore
- java.lang.Object
-
- net.fortuna.ical4j.connector.dav.AbstractDavObjectStore<CardDavCollection>
-
- net.fortuna.ical4j.connector.dav.CardDavStore
-
- All Implemented Interfaces:
CardStore<CardDavCollection>,ObjectStore<CardDavCollection>
public final class CardDavStore extends AbstractDavObjectStore<CardDavCollection> implements CardStore<CardDavCollection>
$Id$ Created on 24/02/2008
-
-
Field Summary
-
Fields inherited from class net.fortuna.ical4j.connector.dav.AbstractDavObjectStore
pathResolver
-
-
Constructor Summary
Constructors Constructor Description CardDavStore(String prodId, URL url)CardDavStore(String prodId, URL url, PathResolver pathResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CardDavCollectionaddCollection(String id)Adds the specified collection to the store.CardDavCollectionaddCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone)CardDavCollectionaddCollection(String id, org.apache.jackrabbit.webdav.property.DavPropertySet properties)protected StringfindAddressBookHomeSet()protected StringfindAddressBookHomeSet(String propfindUri)This method try to find the calendar-home-set attribute in the user's DAV principals.CardDavCollectiongetCollection(String id)List<CardDavCollection>getCollections()This method will try to find all calendar collections available at the calendar-home-set URI of the user.protected List<CardDavCollection>getCollectionsForHomeSet(CardDavStore store, String urlForcalendarHomeSet)List<CardDavCollection>getDelegatedCollections()Get the list of available delegated collections, Apple's iCal styleStringgetDisplayName()CalendarCollectionmerge(String id, CalendarCollection calendar)CardDavCollectionremoveCollection(String id)Removes the collection with specified id from the store.voidsetDisplayName(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
-
CardDavStore
public CardDavStore(String prodId, URL url)
- Parameters:
prodId- application product identifierurl- the URL of a CardDav server instance
-
CardDavStore
public CardDavStore(String prodId, URL url, PathResolver pathResolver)
- Parameters:
prodId- application product identifierurl- the URL of a CardDav server instancepathResolver- the path resolver for the CardDav server type
-
-
Method Detail
-
addCollection
public CardDavCollection addCollection(String id) throws ObjectStoreException
Adds the specified collection to the store.- Specified by:
addCollectionin interfaceObjectStore<CardDavCollection>- 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 CardDavCollection addCollection(String id, org.apache.jackrabbit.webdav.property.DavPropertySet properties) throws ObjectStoreException
- Throws:
ObjectStoreException
-
getCollection
public CardDavCollection getCollection(String id) throws ObjectStoreException, ObjectNotFoundException
- Specified by:
getCollectionin interfaceObjectStore<CardDavCollection>- 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
ObjectNotFoundExceptionis 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)
-
findAddressBookHomeSet
protected String findAddressBookHomeSet() throws ParserConfigurationException, IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
ParserConfigurationExceptionIOExceptionorg.apache.jackrabbit.webdav.DavException
-
findAddressBookHomeSet
protected String findAddressBookHomeSet(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:
ParserConfigurationExceptionIOExceptionorg.apache.jackrabbit.webdav.DavException
-
getCollections
public List<CardDavCollection> 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:
getCollectionsin interfaceObjectStore<CardDavCollection>- 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 methodObjectStoreExceptionObjectNotFoundException
-
getCollectionsForHomeSet
protected List<CardDavCollection> getCollectionsForHomeSet(CardDavStore store, String urlForcalendarHomeSet) throws IOException, org.apache.jackrabbit.webdav.DavException
- Throws:
IOExceptionorg.apache.jackrabbit.webdav.DavException
-
getDelegatedCollections
public List<CardDavCollection> getDelegatedCollections() throws Exception
Get the list of available delegated collections, Apple's iCal style- Returns:
- Throws:
Exception
-
removeCollection
public CardDavCollection removeCollection(String id) throws ObjectStoreException, ObjectNotFoundException
Removes the collection with specified id from the store.- Specified by:
removeCollectionin interfaceObjectStore<CardDavCollection>- 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)
-
addCollection
public CardDavCollection addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone) throws ObjectStoreException
- Specified by:
addCollectionin interfaceObjectStore<CardDavCollection>- 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
-
-