KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > books > store > impl > BookStoreImpl


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.books.store.impl;
17
18 import org.outerj.daisy.books.store.BookStore;
19 import org.outerj.daisy.books.store.BookInstance;
20 import org.outerj.daisy.repository.Repository;
21
22 import java.util.Collection JavaDoc;
23
24 public class BookStoreImpl implements BookStore {
25     private final CommonBookStore commonBookStore;
26     private final Repository repository;
27
28     BookStoreImpl(CommonBookStore commonBookStore, Repository repository) {
29         this.commonBookStore = commonBookStore;
30         this.repository = repository;
31     }
32
33     public BookInstance createBookInstance(String JavaDoc name, String JavaDoc label) {
34         return commonBookStore.createBookInstance(name, label, repository);
35     }
36
37     public BookInstance getBookInstance(String JavaDoc name) {
38         return commonBookStore.getBookInstance(name, repository);
39     }
40
41     public void deleteBookInstance(String JavaDoc name) {
42         commonBookStore.deleteBookInstance(name, repository);
43     }
44
45     public Collection JavaDoc getBookInstances() {
46         return commonBookStore.getBookInstances(repository);
47     }
48
49     public void renameBookInstance(String JavaDoc oldName, String JavaDoc newName) {
50         commonBookStore.renameBookInstance(oldName, newName, repository);
51     }
52
53     public boolean existsBookInstance(String JavaDoc name) {
54         return commonBookStore.existsBookInstance(name, repository);
55     }
56 }
57
Popular Tags