1
|
/**
|
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
|
import edu.ucsb.nceas.metacat.accesscontrol.AccessSection;
|
35
|
|
36
|
/**
|
37
|
* A Class that represents an XML access rule. It include principal and
|
38
|
* permission
|
39
|
*/
|
40
|
public class DistributionSection {
|
41
|
// We don't know what kind of distribution this is
|
42
|
public static final int UNKNOWN_DISTRIBUTION = 0;
|
43
|
// Standard data, usually located locally
|
44
|
public static final int DATA_DISTRIBUTION = 1;
|
45
|
// Online data, usually available via a URL
|
46
|
public static final int ONLINE_DATA_DISTRIBUTION = 2;
|
47
|
// Inline data, located within the metadata (until we extract it).
|
48
|
public static final int INLINE_DATA_DISTRIBUTION = 3;
|
49
|
// Offline data, other kinds of data. Usually physical media that is not available online
|
50
|
public static final int OFFLINE_DATA_DISTRIBUTION = 4;
|
51
|
|
52
|
private int distributionId;
|
53
|
private int distributionType;
|
54
|
private String dataFileName;
|
55
|
private AccessSection accessSection = null;
|
56
|
private Logger logMetacat = Logger.getLogger(DistributionSection.class);
|
57
|
|
58
|
|
59
|
public DistributionSection(int id) {
|
60
|
setDistributionType(UNKNOWN_DISTRIBUTION);
|
61
|
setDistributionId(id);
|
62
|
}
|
63
|
|
64
|
/**
|
65
|
* Set the distribution id
|
66
|
*/
|
67
|
public void setDistributionId(int id) {
|
68
|
distributionId = id;
|
69
|
}
|
70
|
|
71
|
/**
|
72
|
* Get the access type
|
73
|
*/
|
74
|
public int getDistributionId() {
|
75
|
return distributionId;
|
76
|
}
|
77
|
|
78
|
/**
|
79
|
* Set the distribution type
|
80
|
*/
|
81
|
public void setDistributionType(int type) {
|
82
|
distributionType = type;
|
83
|
}
|
84
|
|
85
|
/**
|
86
|
* Get the online data file name
|
87
|
*/
|
88
|
public String getDataFileName() {
|
89
|
return dataFileName;
|
90
|
}
|
91
|
|
92
|
/**
|
93
|
* Set the online data file name
|
94
|
*/
|
95
|
public void setDataFileName(String name) {
|
96
|
dataFileName = name;
|
97
|
}
|
98
|
|
99
|
/**
|
100
|
* Get the access type
|
101
|
*/
|
102
|
public int getDistributionType() {
|
103
|
return distributionType;
|
104
|
}
|
105
|
|
106
|
public void setAccessSection(AccessSection aSection) {
|
107
|
accessSection = aSection;
|
108
|
}
|
109
|
|
110
|
public AccessSection getAccessSection() {
|
111
|
return accessSection;
|
112
|
}
|
113
|
|
114
|
}
|