1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.tuigwaa.system;
17
18 import java.text.ParseException;
19 import java.util.Date;
20
21 public class BackupDto {
22
23 public static final String BACKUPTYPE_FULL = "full";
24 public static final String BACKUPTYPE_PAGE = "page";
25 public static final String BACKUPTYPE_DATABASE = "database";
26 public static final String BACKUPTYPE_NONE = "none";
27
28 private String type;
29 private String[] tablenames;
30 private String backupDate;
31
32 public BackupDto(){
33 }
34
35 public String[] getTablenames() {
36 return tablenames;
37 }
38
39 public void setTablenames(String[] tablenames) {
40 this.tablenames = tablenames;
41 }
42
43 public String getType() {
44 return type;
45 }
46
47 public void setType(String type) {
48 this.type = type;
49 }
50
51 public String getBackupDate() {
52 return backupDate;
53 }
54
55 public void setBackupDate(String backupDate) {
56 this.backupDate = backupDate;
57 }
58
59 public Date getBackupDateAsDate(){
60 Date date = null;
61 if(backupDate != null){
62 try {
63 date = Constants.SIMPLE_DATEFORMAT.parse(backupDate);
64 } catch (ParseException pe) {
65
66 }
67 }
68 return date;
69 }
70
71 public boolean isIncludeContents(){
72 return BACKUPTYPE_PAGE.equals(this.type) || BACKUPTYPE_FULL.equals(this.type);
73 }
74
75 public boolean isIncludeDatabase(){
76 return BACKUPTYPE_DATABASE.equals(this.type) || BACKUPTYPE_FULL.equals(this.type);
77 }
78
79 public boolean isNone(){
80 return BACKUPTYPE_NONE.equals(this.type);
81 }
82
83
84 }