Project

General

Profile

1
/**
2
 *  '$RCSfile$'
3
 *  Copyright: 2008 Regents of the University of California and the
4
 *             National Center for Ecological Analysis and Synthesis
5
 *
6
 *   '$Author: daigle $'
7
 *     '$Date: 2008-07-06 21:25:34 -0700 (Sun, 06 Jul 2008) $'
8
 * '$Revision: 4080 $'
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
package edu.ucsb.nceas.metacat;
25

    
26
import java.util.Vector;
27

    
28
import edu.ucsb.nceas.metacat.service.PropertyService;
29
import edu.ucsb.nceas.utilities.StringUtil;
30
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
31

    
32
/**
33
 * @author daigle@nceas.nceas.ucsb.edu
34
 *
35
 * DBVersion represents the current DBVersion information for this Metacat instance.
36
 */
37
public class DBVersion extends Version
38
{
39
	private Vector<String> updateScriptList = null;
40
	
41
	/**
42
	 * Create a database version. Get the update script list from properties for
43
	 * this version and save in a vector.
44
	 * 
45
	 * @param DBVersionId
46
	 *            a string representing the version of the database.
47
	 * @throws PropertyNotFoundException
48
	 */
49
    public DBVersion(String DBVersionId) throws PropertyNotFoundException {
50
    	super(DBVersionId);
51
		String updateScriptString = PropertyService.getProperty("database.upgradeVersion." + DBVersionId);
52
    	updateScriptList = StringUtil.toVector(updateScriptString, ',');
53
    }
54
	
55
    /**
56
     * Get the update script list for this version
57
     * @return a Vector of update script names.
58
     */
59
    public Vector<String> getUpdateScripts() {
60
    	return updateScriptList;
61
    }
62
}
(27-27/67)