KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > commonimpl > CollectionStrategy


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.outerj.daisy.repository.commonimpl;
17
18 import org.outerj.daisy.repository.RepositoryException;
19
20 import java.util.Collection JavaDoc;
21
22 public interface CollectionStrategy {
23     /**
24      * Stores a collection.
25      * @param collection the collection to store
26      */

27     public void store(DocumentCollectionImpl collection) throws RepositoryException;
28
29     /**
30      * Loads a DocumentCollection for a specified documentcollectionid. A RepositoryException
31      * is thrown if no DocumentCollection could be found for the specified id.
32      * @param collectionId
33      * @param user
34      * @return the DocumentCollection for the specified id, if found
35      */

36     public DocumentCollectionImpl loadCollection(long collectionId, AuthenticatedUser user) throws RepositoryException;
37
38     public DocumentCollectionImpl loadCollectionByName(String JavaDoc name, AuthenticatedUser user) throws RepositoryException;
39
40     /**
41      * Loads all the available collections in the repository.
42      * @param user the user requesting the DocumentCollections
43      * @return the available collections in the repository, null if no collections can be found.
44      */

45     public Collection JavaDoc loadCollections(AuthenticatedUser user) throws RepositoryException;
46
47     /**
48      * Removes the collection, identified by the specified identifier, from the Repository.
49      *
50      * @param collectionId the collection id of the collection to remove
51      * @param user the user who wants to delete the collection
52      */

53     public void deleteCollection(long collectionId, AuthenticatedUser user) throws RepositoryException;
54 }
55
Popular Tags