Project

General

Profile

1 4676 daigle
/**
2
 *  '$RCSfile$'
3
 *    Purpose: A Class that represents an XML Text node and its contents,
4
 *             and can build itself from a database connection
5
 *  Copyright: 2008 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Michael Daigle
8
 *
9
 *   '$Author: daigle $'
10
 *     '$Date: 2008-10-21 15:22:01 -0700 (Tue, 21 Oct 2008) $'
11
 * '$Revision: 4469 $'
12
 *
13
 * This program is free software; you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation; either version 2 of the License, or
16
 * (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
 */
27
28
package edu.ucsb.nceas.metacat;
29
30
import java.util.Vector;
31
32
import org.apache.log4j.Logger;
33
34
/**
35
 * A Class that represents an XML access rule. It include principal and
36
 * permission
37
 */
38
public class DistributionSection {
39
	// We don't know what kind of distribution this is
40
	public static final int UNKNOWN_DISTRIBUTION = 0;
41
	// Standard data, usually located locally
42
	public static final int DATA_DISTRIBUTION = 1;
43
	// Online data, usually available via a URL
44
	public static final int ONLINE_DATA_DISTRIBUTION = 2;
45
	// Inline data, located within the metadata (until we extract it).
46
	public static final int INLINE_DATA_DISTRIBUTION = 3;
47
	// Offline data, other kinds of data.  Usually physical media that is not available online
48
	public static final int OFFLINE_DATA_DISTRIBUTION = 4;
49
50
	private int distributionId;
51
	private int distributionType;
52
	private String dataFileName;
53
	private AccessSection accessSection = null;
54
	private Logger logMetacat = Logger.getLogger(DistributionSection.class);
55
56
57
	public DistributionSection(int id) {
58
		setDistributionType(UNKNOWN_DISTRIBUTION);
59
		setDistributionId(id);
60
	}
61
62
	/**
63
	 * Set the distribution id
64
	 */
65
	public void setDistributionId(int id) {
66
		distributionId = id;
67
	}
68
69
	/**
70
	 * Get the access type
71
	 */
72
	public int getDistributionId() {
73
		return distributionId;
74
	}
75
76
	/**
77
	 * Set the distribution type
78
	 */
79
	public void setDistributionType(int type) {
80
		distributionType = type;
81
	}
82
83
	/**
84
	 * Get the online data file name
85
	 */
86
	public String getDataFileName() {
87
		return dataFileName;
88
	}
89
90
	/**
91
	 * Set the online data file name
92
	 */
93
	public void setDataFileName(String name) {
94
		dataFileName = name;
95
	}
96
97
	/**
98
	 * Get the access type
99
	 */
100
	public int getDistributionType() {
101
		return distributionType;
102
	}
103
104
	public void setAccessSection(AccessSection aSection) {
105
		accessSection = aSection;
106
	}
107
108
	public AccessSection getAccessSection() {
109
		return accessSection;
110
	}
111
112
}