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.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;
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 name, String label) {
34: return commonBookStore.createBookInstance(name, label,
35: repository);
36: }
37:
38: public BookInstance getBookInstance(String name) {
39: return commonBookStore.getBookInstance(name, repository);
40: }
41:
42: public void deleteBookInstance(String name) {
43: commonBookStore.deleteBookInstance(name, repository);
44: }
45:
46: public Collection<BookInstance> getBookInstances() {
47: return commonBookStore.getBookInstances(repository);
48: }
49:
50: public void renameBookInstance(String oldName, String newName) {
51: commonBookStore
52: .renameBookInstance(oldName, newName, repository);
53: }
54:
55: public boolean existsBookInstance(String name) {
56: return commonBookStore.existsBookInstance(name, repository);
57: }
58: }
|