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 C
addCollection(String id)
Adds the specified collection to the store.C
addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone)
boolean
connect()
Connect to a object store anonymously.boolean
connect(String username, char[] password)
Connect to a object store using the specified credentials.void
disconnect()
C
getCollection(String id)
List<C>
getCollections()
boolean
isConnected()
C
removeCollection(String id)
Removes the collection with specified id from the store.
-
-
-
Method Detail
-
connect
boolean connect() throws ObjectStoreException
Connect 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
ObjectNotFoundException
is 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
-
-