Class AbstractLocalObjectStore<C extends AbstractLocalObjectCollection<?>>
- java.lang.Object
-
- net.fortuna.ical4j.connector.local.AbstractLocalObjectStore<C>
-
- All Implemented Interfaces:
ObjectStore<C>
- Direct Known Subclasses:
LocalCalendarStore,LocalCardStore
public abstract class AbstractLocalObjectStore<C extends AbstractLocalObjectCollection<?>> extends Object implements ObjectStore<C>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete 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()protected FilegetRoot()booleanisConnected()protected abstract CnewCollection(String id)CremoveCollection(String id)Removes the collection with specified id from the store.
-
-
-
Method Detail
-
getRoot
protected File getRoot()
-
connect
public boolean connect() throws ObjectStoreExceptionDescription copied from interface:ObjectStoreConnect to a object store anonymously.- Specified by:
connectin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- Returns:
- true if connection is successful, otherwise false
- Throws:
ObjectStoreException- where an unexpected error occurs
-
connect
public boolean connect(String username, char[] password) throws ObjectStoreException
Description copied from interface:ObjectStoreConnect to a object store using the specified credentials.- Specified by:
connectin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- Parameters:
username- connection usernamepassword- connection password- Returns:
- true if connection is successful, otherwise false
- Throws:
ObjectStoreException- where an unexpected error occurs
-
disconnect
public void disconnect()
- Specified by:
disconnectin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>
-
addCollection
public C addCollection(String id) throws ObjectStoreException
Description copied from interface:ObjectStoreAdds the specified collection to the store.- Specified by:
addCollectionin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- 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 C addCollection(String id, String displayName, String description, String[] supportedComponents, Calendar timezone) throws ObjectStoreException
- Specified by:
addCollectionin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- 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
public C removeCollection(String id)
Description copied from interface:ObjectStoreRemoves the collection with specified id from the store.- Specified by:
removeCollectionin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- Parameters:
id- a collection identifier- Returns:
- if a collection with the specified id exists in the store it is returned. Otherwise returns null.
-
getCollection
public C getCollection(String id) throws ObjectStoreException, ObjectNotFoundException
- Specified by:
getCollectionin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>- 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
public List<C> getCollections()
- Specified by:
getCollectionsin interfaceObjectStore<C extends AbstractLocalObjectCollection<?>>
-
-