1 |
4080
|
daigle
|
/**
|
2 |
|
|
* '$RCSfile$'
|
3 |
|
|
* Copyright: 2008 Regents of the University of California and the
|
4 |
|
|
* National Center for Ecological Analysis and Synthesis
|
5 |
|
|
*
|
6 |
|
|
* '$Author$'
|
7 |
|
|
* '$Date$'
|
8 |
|
|
* '$Revision$'
|
9 |
|
|
*
|
10 |
|
|
* This program is free software; you can redistribute it and/or modify
|
11 |
|
|
* it under the terms of the GNU General Public License as published by
|
12 |
|
|
* the Free Software Foundation; either DBVersion 2 of the License, or
|
13 |
|
|
* (at your option) any later DBVersion.
|
14 |
|
|
*
|
15 |
|
|
* This program is distributed in the hope that it will be useful,
|
16 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
17 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
18 |
|
|
* GNU General Public License for more details.
|
19 |
|
|
*
|
20 |
|
|
* You should have received a copy of the GNU General Public License
|
21 |
|
|
* along with this program; if not, write to the Free Software
|
22 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
23 |
|
|
*/
|
24 |
5015
|
daigle
|
package edu.ucsb.nceas.metacat.database;
|
25 |
4080
|
daigle
|
|
26 |
|
|
import java.util.Vector;
|
27 |
|
|
|
28 |
5015
|
daigle
|
import edu.ucsb.nceas.metacat.Version;
|
29 |
5030
|
daigle
|
import edu.ucsb.nceas.metacat.properties.PropertyService;
|
30 |
4080
|
daigle
|
import edu.ucsb.nceas.utilities.StringUtil;
|
31 |
|
|
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
|
32 |
|
|
|
33 |
|
|
/**
|
34 |
|
|
* @author daigle@nceas.nceas.ucsb.edu
|
35 |
|
|
*
|
36 |
|
|
* DBVersion represents the current DBVersion information for this Metacat instance.
|
37 |
|
|
*/
|
38 |
|
|
public class DBVersion extends Version
|
39 |
|
|
{
|
40 |
|
|
private Vector<String> updateScriptList = null;
|
41 |
|
|
|
42 |
|
|
/**
|
43 |
|
|
* Create a database version. Get the update script list from properties for
|
44 |
|
|
* this version and save in a vector.
|
45 |
|
|
*
|
46 |
|
|
* @param DBVersionId
|
47 |
|
|
* a string representing the version of the database.
|
48 |
|
|
* @throws PropertyNotFoundException
|
49 |
|
|
*/
|
50 |
|
|
public DBVersion(String DBVersionId) throws PropertyNotFoundException {
|
51 |
|
|
super(DBVersionId);
|
52 |
|
|
String updateScriptString = PropertyService.getProperty("database.upgradeVersion." + DBVersionId);
|
53 |
|
|
updateScriptList = StringUtil.toVector(updateScriptString, ',');
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
/**
|
57 |
|
|
* Get the update script list for this version
|
58 |
|
|
* @return a Vector of update script names.
|
59 |
|
|
*/
|
60 |
|
|
public Vector<String> getUpdateScripts() {
|
61 |
|
|
return updateScriptList;
|
62 |
|
|
}
|
63 |
|
|
}
|