KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > service > core > impl > BackupManagerImpl


1 /*
2  * Copyright 2004 Blandware (http://www.blandware.com)
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 com.blandware.atleap.service.core.impl;
17
18 import com.blandware.atleap.common.util.PartialCollection;
19 import com.blandware.atleap.common.util.QueryInfo;
20 import com.blandware.atleap.persistence.core.BackupDAO;
21 import com.blandware.atleap.persistence.exception.BackupFileAccessException;
22 import com.blandware.atleap.service.core.BackupManager;
23
24 import java.util.Date JavaDoc;
25
26 /**
27  * <p>Manager for performing backup/restore database operations</p>
28  * <p/>
29  * <p><a HREF="BackupManagerImpl.java.htm"><i>View Source</i></a></p>
30  *
31  * @author Andrey Grebnev <a HREF="mailto:andrey.grebnev@blandware.com">&lt;andrey.grebnev@blandware.com&gt;</a>
32  * @version $Revision: 1.4 $ $Date: 2006/03/25 09:04:41 $
33  */

34 public class BackupManagerImpl extends BaseManagerImpl implements BackupManager {
35
36     /**
37      * DAO to use with backup
38      */

39     protected BackupDAO backupDAO;
40
41     /**
42      * Set backup DAO
43      * @param backupDAO
44      */

45     public void setBackupDAO(BackupDAO backupDAO) {
46         this.backupDAO = backupDAO;
47     }
48
49     /**
50      * @see com.blandware.atleap.service.core.BackupManager#backup()
51      */

52     public void backup() throws BackupFileAccessException {
53         backupDAO.backup();
54     }
55
56     /**
57      * @see com.blandware.atleap.service.core.BackupManager#restore(java.util.Date, Boolean)
58      */

59     public void restore(Date JavaDoc date, Boolean JavaDoc force) throws BackupFileAccessException {
60         backupDAO.restore(date, force);
61     }
62
63     /**
64      * @see com.blandware.atleap.service.core.BackupManager#restore()
65      */

66     public void restore() throws BackupFileAccessException {
67        restore(null, Boolean.TRUE);
68     }
69
70     /**
71      * @see com.blandware.atleap.service.core.BackupManager#canListArchives()
72      */

73     public boolean canListArchives() {
74         return backupDAO.canListArchives();
75     }
76
77     /**
78      * @see com.blandware.atleap.service.core.BackupManager#listArchives(com.blandware.atleap.common.util.QueryInfo)
79      */

80     public PartialCollection listArchives(QueryInfo queryInfo) throws BackupFileAccessException {
81         return backupDAO.listArchives(queryInfo);
82     }
83
84     /**
85      * @see com.blandware.atleap.service.core.BackupManager#createDirIfNotExists()
86      */

87     public boolean createDirIfNotExists() {
88         return backupDAO.createDirIfNotExists();
89     }
90 }
91
Popular Tags