Package net.fortuna.ical4j.connector
Interface ObjectStore<C extends ObjectCollection<?>>
-
- Type Parameters:
C- the type of collection supported by the store $Id$ Created on 27/09/2008
- All Known Subinterfaces:
CalendarStore<C>,CardStore<C>
- All Known Implementing Classes:
AbstractDavObjectStore,AbstractJcrObjectStore,AbstractLocalObjectStore,CalDavCalendarStore,CardDavStore,JcrCalendarStore,JcrCardStore,LocalCalendarStore,LocalCardStore
public interface ObjectStore<C extends ObjectCollection<?>>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CaddCollection(String id)Adds the specified collection to the store.CaddCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone)booleanconnect()Connect to a object store anonymously.booleanconnect(String username, char[] password)Connect to a object store using the specified credentials.voiddisconnect()CgetCollection(String id)List<C>getCollections()booleanisConnected()CremoveCollection(String id)Removes the collection with specified id from the store.
-
-
-
Method Detail
-
connect
boolean connect() throws ObjectStoreExceptionConnect to a object store anonymously.- Returns:
- true if connection is successful, otherwise false
- Throws:
ObjectStoreException- where an unexpected error occurs
-
connect
boolean connect(String username, char[] password) throws ObjectStoreException
Connect to a object store using the specified credentials.- Parameters:
username- connection usernamepassword- connection password- Returns:
- true if connection is successful, otherwise false
- Throws:
ObjectStoreException- where an unexpected error occurs
-
disconnect
void disconnect() throws ObjectStoreException- Throws:
ObjectStoreException- where an unexpected error occurs
-
isConnected
boolean isConnected()
-
addCollection
C addCollection(String id) throws ObjectStoreException
Adds the specified collection to the store.- 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
C addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone) throws ObjectStoreException
- 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
-
removeCollection
C removeCollection(String id) throws ObjectStoreException, ObjectNotFoundException
Removes the collection with specified id from the store.- 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
-
getCollection
C getCollection(String id) throws ObjectStoreException, ObjectNotFoundException
- 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
-
getCollections
List<C> getCollections() throws ObjectStoreException, ObjectNotFoundException
-
-