01: /*
02: * Copyright 2004 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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: import org.outerj.daisy.repository.DocumentCollection;
20:
21: import java.util.Collection;
22:
23: public interface CollectionStrategy {
24: /**
25: * Stores a collection.
26: * @param collection the collection to store
27: */
28: public void store(DocumentCollectionImpl collection)
29: throws RepositoryException;
30:
31: /**
32: * Loads a DocumentCollection for a specified documentcollectionid. A RepositoryException
33: * is thrown if no DocumentCollection could be found for the specified id.
34: * @param collectionId
35: * @param user
36: * @return the DocumentCollection for the specified id, if found
37: */
38: public DocumentCollectionImpl loadCollection(long collectionId,
39: AuthenticatedUser user) throws RepositoryException;
40:
41: public DocumentCollectionImpl loadCollectionByName(String name,
42: AuthenticatedUser user) throws RepositoryException;
43:
44: /**
45: * Loads all the available collections in the repository.
46: * @param user the user requesting the DocumentCollections
47: * @return the available collections in the repository, null if no collections can be found.
48: */
49: public Collection<DocumentCollectionImpl> loadCollections(
50: AuthenticatedUser user) throws RepositoryException;
51:
52: /**
53: * Removes the collection, identified by the specified identifier, from the Repository.
54: *
55: * @param collectionId the collection id of the collection to remove
56: * @param user the user who wants to delete the collection
57: */
58: public void deleteCollection(long collectionId,
59: AuthenticatedUser user) throws RepositoryException;
60: }
|