KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > blandware > atleap > service > core > BackupManager


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

32 public interface BackupManager extends BaseManager {
33
34     /**
35      * Backup database into file
36      */

37     public void backup() throws BackupFileAccessException;
38
39     /**
40      * <p>
41      * Restores database from archive specified by date. If date is null we will try to restore from initial xml resource
42      * e.g. initial-data.xml
43      * </p>
44      * <p>
45      * If <b>force</b> is <code>false</code>, then, if tables already exist,
46      * nothing will be made at all: all data will remain untouched in database.
47      * </p>
48      *
49      * @param date date of archive
50      * @param force if it is <code>false</code> we will create tables and load data only if tables do not exist. If it is <code>true</code>
51      * we will drop and create tables and load data.
52      */

53     public void restore(Date JavaDoc date, Boolean JavaDoc force) throws BackupFileAccessException;
54
55     /**
56      * Restore database from initial xml resource e.g. initial-data.xml droping and creating tables in any case.
57      */

58     public void restore() throws BackupFileAccessException;
59
60     /**
61      * Returns whether list of archives is accessible or not (due to directory
62      * permissions, for example)
63      *
64      * @return whether list of archives is accessible
65      */

66     public boolean canListArchives();
67
68     /**
69      * Retrieves filtered/sorted collection of archives.
70      *
71      * @param queryInfo Object that contains information about how to filter and sort data
72      * @return Collection of archives' dates
73      */

74     public PartialCollection listArchives(QueryInfo queryInfo) throws BackupFileAccessException;
75
76     /**
77      * Tries to create a dbbackup directory if it does not exist
78      *
79      * @return true if dbbackup directory already exists or was created
80      * successfully.
81      */

82     public boolean createDirIfNotExists();
83
84 }
85
Popular Tags