001: /*
002: * Created on May 1, 2003
003: *
004: * Dbmjui is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU General Public License version 2 as
006: * published by the Free Software Foundation.
007: *
008: * Dbmjui is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011: * General Public License for more details.
012: *
013: * You should have received a copy of the GNU General Public
014: * License along with dbmjui; see the file COPYING. If not,
015: * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
016: * Boston, MA 02111-1307, USA.
017: *
018: */
019: package fr.aliacom.dbmjui.beans;
020:
021: import java.util.Date;
022:
023: /**
024: * @author tom
025: *
026: * (c) 2001, 2003 Thomas Cataldo
027: */
028: public class BackupMedium {
029:
030: /* Medium types */
031: public static final int TYPE_TAPE = 1;
032: public static final int TYPE_FILE = 1 << 1;
033: public static final int TYPE_PIPE = 1 << 2;
034: public static final int TYPE_NO_REWIND = 1 << 3;
035: public static final int TYPE_AUTOLOADER = 1 << 4;
036: public static final int TYPE_UNKNOWN = 1 << 5;
037:
038: /* Backup types */
039: public static final int BACKUP_TYPE_DATA = 1;
040: public static final int BACKUP_TYPE_PAGES = 1 << 1;
041: public static final int BACKUP_TYPE_LOG = 1 << 2;
042: public static final int BACKUP_TYPE_AUTO = 1 << 3;
043: public static final int BACKUP_TYPE_UNKNOWN = 1 << 4;
044:
045: private String name;
046: private String location;
047: private int deviceType; // file,tape,pipe
048: private int backupType; // data, log
049: private boolean modified;
050: private long sizeKb;
051: private Date date;
052: private boolean overwritable;
053: private boolean useAutoloader;
054: private long mediumSize;
055: private int blockSize;
056:
057: public BackupMedium() {
058: }
059:
060: /**
061: * @return the backup type
062: */
063: public int getBackupType() {
064: return backupType;
065: }
066:
067: /**
068: * @return the device type
069: */
070: public int getDeviceType() {
071: return deviceType;
072: }
073:
074: /**
075: * @return the location
076: */
077: public String getLocation() {
078: return location;
079: }
080:
081: /**
082: * @return true if the backup was modified
083: */
084: public boolean isModified() {
085: return modified;
086: }
087:
088: /**
089: * @return the name of the backup
090: */
091: public String getName() {
092: return name;
093: }
094:
095: /**
096: * @return the size of backup in Kb
097: */
098: public long getSizeKb() {
099: return sizeKb;
100: }
101:
102: /**
103: * @param i
104: */
105: public void setBackupType(int i) {
106: backupType = i;
107: }
108:
109: /**
110: * @param i
111: */
112: public void setDeviceType(int i) {
113: deviceType = i;
114: }
115:
116: /**
117: * @param string
118: */
119: public void setLocation(String string) {
120: location = string;
121: }
122:
123: /**
124: * @param b
125: */
126: public void setModified(boolean b) {
127: modified = b;
128: }
129:
130: /**
131: * @param string
132: */
133: public void setName(String string) {
134: name = string;
135: }
136:
137: /**
138: * @param l
139: */
140: public void setSizeKb(long l) {
141: sizeKb = l;
142: }
143:
144: /**
145: * @return the date the medium was created (recheck this)
146: */
147: public Date getDate() {
148: return date;
149: }
150:
151: /**
152: * @param date
153: */
154: public void setDate(Date date) {
155: this .date = date;
156: }
157:
158: /**
159: * @return the size of a block
160: */
161: public int getBlockSize() {
162: return blockSize;
163: }
164:
165: /**
166: * @return the size of backup medium
167: */
168: public long getMediumSize() {
169: return mediumSize;
170: }
171:
172: /**
173: * @return true if the backup will be overwritten
174: */
175: public boolean isOverwritable() {
176: return overwritable;
177: }
178:
179: /**
180: * @return true if an auto loader is used
181: */
182: public boolean isUseAutoloader() {
183: return useAutoloader;
184: }
185:
186: /**
187: * @param i
188: */
189: public void setBlockSize(int i) {
190: blockSize = i;
191: }
192:
193: /**
194: * @param l
195: */
196: public void setMediumSize(long l) {
197: mediumSize = l;
198: }
199:
200: /**
201: * @param b
202: */
203: public void setOverwritable(boolean b) {
204: overwritable = b;
205: }
206:
207: /**
208: * @param b
209: */
210: public void setUseAutoloader(boolean b) {
211: useAutoloader = b;
212: }
213:
214: }
|