Project

General

Profile

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: 2000 Regents of the University of California and the
6
 *             National Center for Ecological Analysis and Synthesis
7
 *    Authors: Matt Jones
8
 *
9
 *   '$Author: daigle $'
10
 *     '$Date: 2008-10-21 15:20:52 -0700 (Tue, 21 Oct 2008) $'
11
 * '$Revision: 4468 $'
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.accesscontrol;
29

    
30
import java.sql.Date;
31

    
32
import org.apache.log4j.Logger;
33

    
34
import edu.ucsb.nceas.metacat.shared.BaseDAO;
35

    
36
/**
37
 * A Class that represents an XML access rule. It include principal and 
38
 * permission
39
 */
40
public class XMLAccessDAO extends BaseDAO {
41

    
42
	private String _docId = null;
43
	private String _guid = null;
44
	private String _accessFileId = null;
45
	private String _principalName = null;
46
	private Long _permission = null;
47
	private String _permType = null;
48
	private String _permOrder = null;
49
	private Date _beginTime = null;
50
	private Date _endTime = null;
51
	private Long _ticketCount = null;
52
	private String _subTreeId = null;
53
	private String _startNodeId = null;
54
	private String _endNodeId = null;
55

    
56
	public String getDocId() {
57
		return _docId;
58
	}
59
	
60
	public void setDocId(String docId) {
61
		if (docId != null && docId.equals("")) {
62
			docId = null;
63
		} else {
64
			_docId = docId;
65
		}
66
	}
67
	
68
	public String getGuid() {
69
		return _guid;
70
	}
71
	
72
	public void setGuid(String guid) {
73
		if (guid != null && guid.equals("")) {
74
			guid = null;
75
		} else {
76
			_guid = guid;
77
		}
78
	}
79

    
80
	public String getAccessFileId() {
81
		return _accessFileId;
82
	}
83
	
84
	public void setAccessFileId(String accessFileId) {
85
		if(accessFileId != null && accessFileId.equals("")) {
86
			_accessFileId = null;
87
		} else {
88
			_accessFileId = accessFileId;
89
		}
90
	}
91
	
92
	public String getPrincipalName() {
93
		return _principalName;
94
	}
95
	
96
	public void setPrincipalName(String principalName) {
97
		if (principalName != null && principalName.equals("")) {
98
			_principalName = null;
99
		} else {
100
			_principalName = principalName;
101
		}
102
	}
103
	
104
	public Long getPermission() {
105
		return _permission;
106
	}
107
	
108
	public void setPermission(Long permission) {
109
		if (_permission == null) {
110
			_permission = new Long(0);
111
		}
112
		_permission = permission;
113
	}
114
	
115
	public void addPermission(Long permission) {
116
		if (_permission != null) {
117
			_permission |= permission;
118
		} else {
119
			_permission = permission;
120
		}
121
	}
122
	
123
	public String getPermType() {
124
		return _permType;
125
	}
126
	
127
	public void setPermType(String permType) {
128
		if (permType != null && permType.equals("")) {
129
			_permType = null;
130
		} else {
131
			_permType = permType;
132
		}
133
	}
134
	
135
	public String getPermOrder() {
136
		return _permOrder;
137
	}
138
	
139
	public void setPermOrder(String permOrder) {
140
		if (permOrder != null && permOrder.equals("")) {
141
			_permOrder = null;
142
		} else {
143
			_permOrder = permOrder;
144
		}
145
	}
146
	
147
	public Date getBeginTime() {
148
		return _beginTime;
149
	}
150
	
151
	public void setBeginTime(Date beginTime) {
152
		_beginTime = beginTime;
153
	}
154
	
155
	public Date getEndTime() {
156
		return _endTime;
157
	}
158
	
159
	public void setEndTime(Date endTime) {
160
		_endTime = endTime;
161
	}
162
	
163
	public Long getTicketCount() {
164
		return _ticketCount;
165
	}
166
	
167
	public void setTicketCount(Long ticketCount) {
168
		_ticketCount = ticketCount;
169
	}
170
	
171
	public String getSubTreeId() {
172
		return _subTreeId;
173
	}
174
	
175
	public void setSubTreeId(String subTreeId) {
176
		if (subTreeId != null && subTreeId.equals("")) {
177
			_subTreeId = null;
178
		} else {
179
			_subTreeId = subTreeId;
180
		}
181
	}
182
	
183
	public String getStartNodeId() {
184
		return _startNodeId;
185
	}
186
	
187
	public void setStartNodeId(String startNodeId) {
188
		if (startNodeId != null && startNodeId.equals("")) {
189
			_startNodeId = null;
190
		} else {
191
			_startNodeId = startNodeId;
192
		}
193
	}
194
	
195
	public String getEndNodeId() {
196
		return _endNodeId;
197
	}
198
	
199
	public void setEndNodeId(String endNodeId) {
200
		if (endNodeId != null && endNodeId.equals("")) {
201
			endNodeId = null;
202
		} else {
203
			_endNodeId = endNodeId;
204
		}
205
	}
206

    
207
}
(9-9/9)