org.outerj.daisy.repository
Interface CollectionManager


public interface CollectionManager

The CollectionManager is responsible for all tasks related to collection management (creation, deletion, listing).

Collections are named sets of documents. The same document can be part of multiple collections, thus collections can overlap.

Assigning documents to collections is done through the Document API.


Method Summary
 DocumentCollection createCollection(java.lang.String name)
          Creates a new collection.
 void deleteCollection(long collectionId)
          Deletes a collection from the repository.
 DocumentCollection getCollection(long collectionId, boolean updateable)
          Retrieves a collection by its ID.
 DocumentCollection getCollection(java.lang.String collection, boolean updateable)
          Retrieves a collection by ID or by name depending on whether the collection parameter starts with a digit.
 DocumentCollection getCollectionByName(java.lang.String name, boolean updateable)
          Retrieves a collection by its name.
 DocumentCollections getCollections(boolean updateable)
          Gets all collections, in no specific order.
 

Method Detail

createCollection

public DocumentCollection createCollection(java.lang.String name)
                                    throws RepositoryException
Creates a new collection. This does not immediately create the collection in the repository, you need to call the save() method on the returned DocumentCollection object to do this.

Parameters:
name - the name of the new collection
Throws:
RepositoryException

getCollection

public DocumentCollection getCollection(long collectionId,
                                        boolean updateable)
                                 throws RepositoryException
Retrieves a collection by its ID.

Throws:
RepositoryException

getCollection

public DocumentCollection getCollection(java.lang.String collection,
                                        boolean updateable)
                                 throws RepositoryException
Retrieves a collection by ID or by name depending on whether the collection parameter starts with a digit.

Throws:
RepositoryException

getCollectionByName

public DocumentCollection getCollectionByName(java.lang.String name,
                                              boolean updateable)
                                       throws RepositoryException
Retrieves a collection by its name.

Throws:
RepositoryException

deleteCollection

public void deleteCollection(long collectionId)
                      throws RepositoryException
Deletes a collection from the repository.

If any documents were associated with (contained by) this collection, these associations will be removed, but the documents themselves are not removed. Note that this can be done even if there are locks on documents contained by this collection, and that the last modified timestamp of the documents will remain untouched.

Parameters:
collectionId - the ID of the collection to remove
Throws:
RepositoryException

getCollections

public DocumentCollections getCollections(boolean updateable)
                                   throws RepositoryException
Gets all collections, in no specific order.

Throws:
RepositoryException


Copyright © -2005 . All Rights Reserved.