1 /*
2 Copyright (C) 2000 - 2007 Grid Systems, S.A.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18 /*
19 * Project: IGUtils
20 * Created on 10-feb-2004
21 *
22 * Copyright (c)2003 Grid Systems
23 */
24 package com.gridsystems.storage;
25
26 /**
27 * This interface gives file backup services.
28 *
29 * @version 1.0
30 */
31 public interface FailSafe {
32 /**
33 * It returns all the files that will be safe saved.
34 *
35 * @return a list of files.
36 */
37 String[] getFileNameList();
38
39 /**
40 * It stores the information of the class in that files.
41 * <p>
42 * IMPORTANT: This method MUST be synchronized.
43 *
44 * @param fileNames List of files to store the class information
45 * @throws Exception if the files cannot be stored correctly.
46 */
47 void store(String[] fileNames) throws Exception;
48
49 /**
50 * Error treatment of the store method.
51 * <p>
52 * IMPORTANT: This method MUST be synchronized.
53 *
54 * @param error Error thrown by store method.
55 * @throws Exception if error cannot be handled
56 */
57 void recoverFromStoreError(Exception error) throws Exception;
58
59 /**
60 * Loads information of the class contained in the files.
61 * <p>
62 * IMPORTANT: This method MUST be synchronized.
63 *
64 * @param fileNames List of files to store the class information
65 * @throws Exception if the files cannot be loaded correctly.
66 */
67 void load(String[] fileNames) throws Exception;
68
69 /**
70 * Error treatment of the load method.
71 * <p>
72 * IMPORTANT: This method MUST be synchronized.
73 *
74 * @param error Error throwed by load method.
75 * @throws Exception if error cannot be handled
76 */
77 void recoverFromLoadError(Exception error) throws Exception;
78 }