1 |
8810
|
leinfelder
|
/**
|
2 |
|
|
* '$RCSfile$'
|
3 |
|
|
* Copyright: 2000-2011 Regents of the University of California and the
|
4 |
|
|
* National Center for Ecological Analysis and Synthesis
|
5 |
|
|
*
|
6 |
|
|
* '$Author$'
|
7 |
|
|
* '$Date$'
|
8 |
|
|
*
|
9 |
|
|
* This program is free software; you can redistribute it and/or modify
|
10 |
|
|
* it under the terms of the GNU General Public License as published by
|
11 |
|
|
* the Free Software Foundation; either version 2 of the License, or
|
12 |
|
|
* (at your option) any later version.
|
13 |
|
|
*
|
14 |
|
|
* This program is distributed in the hope that it will be useful,
|
15 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
|
|
* GNU General Public License for more details.
|
18 |
|
|
*
|
19 |
|
|
* You should have received a copy of the GNU General Public License
|
20 |
|
|
* along with this program; if not, write to the Free Software
|
21 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
22 |
|
|
*/
|
23 |
|
|
|
24 |
|
|
package edu.ucsb.nceas.metacat.dataone.v1;
|
25 |
|
|
|
26 |
|
|
import java.io.InputStream;
|
27 |
9359
|
tao
|
import java.math.BigInteger;
|
28 |
9032
|
tao
|
import java.sql.SQLException;
|
29 |
8810
|
leinfelder
|
import java.util.Date;
|
30 |
9083
|
tao
|
import java.util.List;
|
31 |
8810
|
leinfelder
|
|
32 |
|
|
import javax.servlet.http.HttpServletRequest;
|
33 |
|
|
|
34 |
9600
|
tao
|
import org.apache.commons.io.IOUtils;
|
35 |
8810
|
leinfelder
|
import org.apache.log4j.Logger;
|
36 |
|
|
import org.dataone.service.cn.v1.CNAuthorization;
|
37 |
|
|
import org.dataone.service.cn.v1.CNCore;
|
38 |
|
|
import org.dataone.service.cn.v1.CNRead;
|
39 |
|
|
import org.dataone.service.cn.v1.CNReplication;
|
40 |
|
|
import org.dataone.service.exceptions.BaseException;
|
41 |
|
|
import org.dataone.service.exceptions.IdentifierNotUnique;
|
42 |
|
|
import org.dataone.service.exceptions.InsufficientResources;
|
43 |
|
|
import org.dataone.service.exceptions.InvalidRequest;
|
44 |
|
|
import org.dataone.service.exceptions.InvalidSystemMetadata;
|
45 |
|
|
import org.dataone.service.exceptions.InvalidToken;
|
46 |
|
|
import org.dataone.service.exceptions.NotAuthorized;
|
47 |
|
|
import org.dataone.service.exceptions.NotFound;
|
48 |
|
|
import org.dataone.service.exceptions.NotImplemented;
|
49 |
|
|
import org.dataone.service.exceptions.ServiceFailure;
|
50 |
|
|
import org.dataone.service.exceptions.UnsupportedType;
|
51 |
|
|
import org.dataone.service.exceptions.VersionMismatch;
|
52 |
|
|
import org.dataone.service.types.v1.AccessPolicy;
|
53 |
|
|
import org.dataone.service.types.v1.Checksum;
|
54 |
|
|
import org.dataone.service.types.v1.ChecksumAlgorithmList;
|
55 |
|
|
import org.dataone.service.types.v1.DescribeResponse;
|
56 |
|
|
import org.dataone.service.types.v1.Event;
|
57 |
|
|
import org.dataone.service.types.v1.Identifier;
|
58 |
|
|
import org.dataone.service.types.v1.Log;
|
59 |
|
|
import org.dataone.service.types.v1.NodeList;
|
60 |
|
|
import org.dataone.service.types.v1.NodeReference;
|
61 |
|
|
import org.dataone.service.types.v1.ObjectFormat;
|
62 |
|
|
import org.dataone.service.types.v1.ObjectFormatIdentifier;
|
63 |
|
|
import org.dataone.service.types.v1.ObjectFormatList;
|
64 |
|
|
import org.dataone.service.types.v1.ObjectList;
|
65 |
|
|
import org.dataone.service.types.v1.ObjectLocationList;
|
66 |
|
|
import org.dataone.service.types.v1.Permission;
|
67 |
|
|
import org.dataone.service.types.v1.Replica;
|
68 |
|
|
import org.dataone.service.types.v1.ReplicationPolicy;
|
69 |
|
|
import org.dataone.service.types.v1.ReplicationStatus;
|
70 |
|
|
import org.dataone.service.types.v1.Session;
|
71 |
|
|
import org.dataone.service.types.v1.Subject;
|
72 |
|
|
import org.dataone.service.types.v1.SystemMetadata;
|
73 |
|
|
import org.dataone.service.types.v1_1.QueryEngineDescription;
|
74 |
|
|
import org.dataone.service.types.v1_1.QueryEngineList;
|
75 |
9304
|
tao
|
import org.dataone.service.types.v2.TypeFactory;
|
76 |
8810
|
leinfelder
|
|
77 |
9032
|
tao
|
import edu.ucsb.nceas.metacat.IdentifierManager;
|
78 |
9359
|
tao
|
import edu.ucsb.nceas.metacat.dataone.D1NodeVersionChecker;
|
79 |
9074
|
tao
|
import edu.ucsb.nceas.metacat.dataone.convert.LogV2toV1Converter;
|
80 |
9249
|
tao
|
import edu.ucsb.nceas.metacat.properties.PropertyService;
|
81 |
9032
|
tao
|
|
82 |
8810
|
leinfelder
|
/**
|
83 |
|
|
* Represents Metacat's implementation of the DataONE Coordinating Node service
|
84 |
|
|
* API. Methods implement the various CN* interfaces, and methods common to both
|
85 |
|
|
* Member Node and Coordinating Node interfaces are found in the D1NodeService
|
86 |
|
|
* super class.
|
87 |
|
|
*
|
88 |
|
|
*/
|
89 |
|
|
public class CNodeService implements CNAuthorization, CNCore, CNRead,
|
90 |
|
|
CNReplication {
|
91 |
|
|
|
92 |
|
|
// pass through to the most recent implementation
|
93 |
|
|
private edu.ucsb.nceas.metacat.dataone.CNodeService impl = null;
|
94 |
|
|
|
95 |
|
|
/* the logger instance */
|
96 |
|
|
private Logger logMetacat = null;
|
97 |
|
|
|
98 |
|
|
/**
|
99 |
|
|
* singleton accessor
|
100 |
|
|
*/
|
101 |
|
|
public static CNodeService getInstance(HttpServletRequest request) {
|
102 |
|
|
return new CNodeService(request);
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
/**
|
106 |
|
|
* Constructor, private for singleton access
|
107 |
|
|
*/
|
108 |
|
|
private CNodeService(HttpServletRequest request) {
|
109 |
|
|
|
110 |
|
|
logMetacat = Logger.getLogger(CNodeService.class);
|
111 |
|
|
|
112 |
|
|
impl = edu.ucsb.nceas.metacat.dataone.CNodeService.getInstance(request);
|
113 |
|
|
|
114 |
|
|
}
|
115 |
|
|
|
116 |
|
|
@Override
|
117 |
|
|
public boolean deleteReplicationMetadata(Identifier pid,
|
118 |
|
|
NodeReference nodeId, long serialVersion) throws InvalidToken, InvalidRequest,
|
119 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented,
|
120 |
|
|
VersionMismatch {
|
121 |
|
|
return impl.deleteReplicationMetadata(null, pid, nodeId, serialVersion);
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
@Override
|
125 |
|
|
@Deprecated
|
126 |
|
|
public boolean deleteReplicationMetadata(Session session, Identifier pid,
|
127 |
|
|
NodeReference nodeId, long serialVersion) throws InvalidToken, InvalidRequest,
|
128 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented,
|
129 |
|
|
VersionMismatch {
|
130 |
|
|
return impl.deleteReplicationMetadata(session, pid, nodeId, serialVersion);
|
131 |
|
|
|
132 |
|
|
}
|
133 |
|
|
|
134 |
|
|
@Override
|
135 |
|
|
public boolean isNodeAuthorized(Subject targetNodeSubject, Identifier pid)
|
136 |
|
|
throws NotImplemented, NotAuthorized, InvalidToken, ServiceFailure,
|
137 |
|
|
NotFound, InvalidRequest {
|
138 |
|
|
return impl.isNodeAuthorized(null, targetNodeSubject, pid);
|
139 |
|
|
|
140 |
|
|
}
|
141 |
|
|
|
142 |
|
|
@Override
|
143 |
|
|
@Deprecated
|
144 |
|
|
public boolean isNodeAuthorized(Session originatingNodeSession, Subject targetNodeSubject, Identifier pid)
|
145 |
|
|
throws NotImplemented, NotAuthorized, InvalidToken, ServiceFailure,
|
146 |
|
|
NotFound, InvalidRequest {
|
147 |
|
|
return impl.isNodeAuthorized(originatingNodeSession, targetNodeSubject, pid);
|
148 |
|
|
}
|
149 |
|
|
|
150 |
|
|
@Override
|
151 |
|
|
public boolean setReplicationPolicy(Identifier pid,
|
152 |
|
|
ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
|
153 |
|
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
154 |
|
|
VersionMismatch {
|
155 |
9065
|
tao
|
String serviceFailure = "4882";
|
156 |
|
|
String notFound = "4884";
|
157 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
158 |
|
|
"No object could be found for given PID: "+pid.getValue());
|
159 |
8810
|
leinfelder
|
return impl.setReplicationPolicy(null, pid, policy, serialVersion);
|
160 |
|
|
}
|
161 |
|
|
|
162 |
|
|
@Override
|
163 |
|
|
@Deprecated
|
164 |
|
|
public boolean setReplicationPolicy(Session session, Identifier pid,
|
165 |
|
|
ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
|
166 |
|
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
167 |
|
|
VersionMismatch {
|
168 |
|
|
return impl.setReplicationPolicy(session, pid, policy, serialVersion);
|
169 |
|
|
|
170 |
|
|
}
|
171 |
|
|
|
172 |
|
|
@Override
|
173 |
|
|
public boolean setReplicationStatus(Identifier pid,
|
174 |
|
|
NodeReference targetNode, ReplicationStatus status, BaseException failure)
|
175 |
|
|
throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized, InvalidRequest, NotFound {
|
176 |
|
|
return impl.setReplicationStatus(null, pid, targetNode, status, failure);
|
177 |
|
|
}
|
178 |
|
|
|
179 |
|
|
@Override
|
180 |
|
|
@Deprecated
|
181 |
|
|
public boolean setReplicationStatus(Session session, Identifier pid,
|
182 |
|
|
NodeReference targetNode, ReplicationStatus status, BaseException failure)
|
183 |
|
|
throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized,
|
184 |
|
|
InvalidRequest, NotFound {
|
185 |
9065
|
tao
|
String serviceFailure = "4700";
|
186 |
|
|
String notFound = "4740";
|
187 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
188 |
|
|
"No object could be found for given PID: "+pid.getValue());
|
189 |
8810
|
leinfelder
|
return impl.setReplicationStatus(session, pid, targetNode, status, failure);
|
190 |
|
|
}
|
191 |
|
|
|
192 |
|
|
@Override
|
193 |
|
|
public boolean updateReplicationMetadata(Identifier pid,
|
194 |
|
|
Replica replica, long serialVersion) throws NotImplemented, NotAuthorized, ServiceFailure,
|
195 |
|
|
NotFound, InvalidRequest, InvalidToken, VersionMismatch {
|
196 |
|
|
return impl.updateReplicationMetadata(null, pid, replica, serialVersion);
|
197 |
|
|
}
|
198 |
|
|
|
199 |
|
|
@Override
|
200 |
|
|
@Deprecated
|
201 |
|
|
public boolean updateReplicationMetadata(Session session, Identifier pid,
|
202 |
|
|
Replica replica, long serialVersion) throws NotImplemented, NotAuthorized,
|
203 |
|
|
ServiceFailure, NotFound, InvalidRequest, InvalidToken,
|
204 |
|
|
VersionMismatch {
|
205 |
|
|
return impl.updateReplicationMetadata(session, pid, replica, serialVersion);
|
206 |
|
|
}
|
207 |
|
|
|
208 |
|
|
@Override
|
209 |
|
|
public DescribeResponse describe(Identifier pid) throws InvalidToken,
|
210 |
|
|
NotAuthorized, NotImplemented, ServiceFailure, NotFound {
|
211 |
9036
|
tao
|
String serviceFailure = "4931";
|
212 |
|
|
String notFound = "4933";
|
213 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
214 |
|
|
"No system metadata could be found for given PID: "+pid.getValue());
|
215 |
8810
|
leinfelder
|
return impl.describe(null, pid);
|
216 |
|
|
}
|
217 |
|
|
|
218 |
|
|
@Override
|
219 |
|
|
@Deprecated
|
220 |
|
|
public DescribeResponse describe(Session session, Identifier pid)
|
221 |
|
|
throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure,
|
222 |
|
|
NotFound {
|
223 |
9036
|
tao
|
String serviceFailure = "4931";
|
224 |
|
|
String notFound = "4933";
|
225 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
226 |
|
|
"No system metadata could be found for given PID: "+pid.getValue());
|
227 |
8810
|
leinfelder
|
return impl.describe(session, pid);
|
228 |
|
|
}
|
229 |
|
|
|
230 |
|
|
@Override
|
231 |
|
|
public InputStream get(Identifier pid) throws InvalidToken,
|
232 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
233 |
9033
|
tao
|
String serviceFailure = "1030";
|
234 |
|
|
String notFound = "1020";
|
235 |
9036
|
tao
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
236 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node");
|
237 |
8810
|
leinfelder
|
return impl.get(null, pid);
|
238 |
|
|
}
|
239 |
|
|
|
240 |
|
|
@Override
|
241 |
|
|
@Deprecated
|
242 |
|
|
public InputStream get(Session session, Identifier pid) throws InvalidToken,
|
243 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
244 |
9033
|
tao
|
String serviceFailure = "1030";
|
245 |
|
|
String notFound = "1020";
|
246 |
9036
|
tao
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
247 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node");
|
248 |
8810
|
leinfelder
|
return impl.get(session, pid);
|
249 |
|
|
}
|
250 |
|
|
|
251 |
|
|
@Override
|
252 |
|
|
public Checksum getChecksum(Identifier pid) throws InvalidToken,
|
253 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
254 |
|
|
return impl.getChecksum(null, pid);
|
255 |
|
|
}
|
256 |
|
|
|
257 |
|
|
@Override
|
258 |
|
|
@Deprecated
|
259 |
|
|
public Checksum getChecksum(Session session, Identifier pid)
|
260 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
261 |
|
|
NotImplemented {
|
262 |
|
|
return impl.getChecksum(session, pid);
|
263 |
|
|
}
|
264 |
|
|
|
265 |
|
|
@Override
|
266 |
|
|
public QueryEngineDescription getQueryEngineDescription(String queryEngine)
|
267 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
268 |
|
|
NotFound {
|
269 |
|
|
return impl.getQueryEngineDescription(null, queryEngine);
|
270 |
|
|
}
|
271 |
|
|
|
272 |
|
|
@Override
|
273 |
|
|
public SystemMetadata getSystemMetadata(Identifier pid)
|
274 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
275 |
|
|
NotImplemented {
|
276 |
9037
|
tao
|
String serviceFailure = "1090";
|
277 |
|
|
String notFound = "1060";
|
278 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
279 |
|
|
"No system metadata could be found for given PID: "+pid.getValue());
|
280 |
9131
|
tao
|
org.dataone.service.types.v2.SystemMetadata sysMeta = impl.getSystemMetadata(null, pid);
|
281 |
|
|
SystemMetadata retSysMeta = null;
|
282 |
|
|
try {
|
283 |
9304
|
tao
|
retSysMeta = TypeFactory.convertTypeFromType(sysMeta, SystemMetadata.class);
|
284 |
9131
|
tao
|
} catch (Exception e) {
|
285 |
|
|
// report as service failure
|
286 |
|
|
ServiceFailure sf = new ServiceFailure("1090", e.getMessage());
|
287 |
|
|
sf.initCause(e);
|
288 |
|
|
throw sf;
|
289 |
|
|
}
|
290 |
|
|
return retSysMeta;
|
291 |
8810
|
leinfelder
|
}
|
292 |
|
|
|
293 |
|
|
@Override
|
294 |
|
|
@Deprecated
|
295 |
|
|
public SystemMetadata getSystemMetadata(Session session, Identifier pid)
|
296 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
297 |
|
|
NotImplemented {
|
298 |
9037
|
tao
|
String serviceFailure = "1090";
|
299 |
|
|
String notFound = "1060";
|
300 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
301 |
|
|
"No system metadata could be found for given PID: "+pid.getValue());
|
302 |
9131
|
tao
|
org.dataone.service.types.v2.SystemMetadata sysMeta = impl.getSystemMetadata(session, pid);
|
303 |
|
|
SystemMetadata retSysMeta = null;
|
304 |
|
|
try {
|
305 |
9304
|
tao
|
retSysMeta = TypeFactory.convertTypeFromType(sysMeta, SystemMetadata.class);
|
306 |
9131
|
tao
|
} catch (Exception e) {
|
307 |
|
|
// report as service failure
|
308 |
|
|
ServiceFailure sf = new ServiceFailure("1090", e.getMessage());
|
309 |
|
|
sf.initCause(e);
|
310 |
|
|
throw sf;
|
311 |
|
|
}
|
312 |
|
|
return retSysMeta;
|
313 |
8810
|
leinfelder
|
}
|
314 |
|
|
|
315 |
|
|
@Override
|
316 |
|
|
public ObjectList listObjects(Date startTime, Date endTime,
|
317 |
|
|
ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start,
|
318 |
|
|
Integer count) throws InvalidRequest, InvalidToken, NotAuthorized,
|
319 |
|
|
NotImplemented, ServiceFailure {
|
320 |
9249
|
tao
|
NodeReference nodeId = null;
|
321 |
|
|
if(!replicaStatus) {
|
322 |
|
|
//not include those objects whose authoritative node is not this mn
|
323 |
|
|
nodeId = new NodeReference();
|
324 |
|
|
try {
|
325 |
|
|
String currentNodeId = PropertyService.getInstance().getProperty("dataone.nodeId"); // return only pids for which this mn
|
326 |
|
|
nodeId.setValue(currentNodeId);
|
327 |
|
|
} catch(Exception e) {
|
328 |
|
|
throw new ServiceFailure("1580", e.getMessage());
|
329 |
|
|
}
|
330 |
|
|
}
|
331 |
|
|
return impl.listObjects(null, startTime, endTime, formatid, null, nodeId, start, count);
|
332 |
8810
|
leinfelder
|
}
|
333 |
|
|
|
334 |
|
|
@Override
|
335 |
|
|
@Deprecated
|
336 |
|
|
public ObjectList listObjects(Session session, Date startTime, Date endTime,
|
337 |
|
|
ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start,
|
338 |
|
|
Integer count) throws InvalidRequest, InvalidToken, NotAuthorized,
|
339 |
|
|
NotImplemented, ServiceFailure {
|
340 |
9249
|
tao
|
NodeReference nodeId = null;
|
341 |
|
|
if(!replicaStatus) {
|
342 |
|
|
//not include those objects whose authoritative node is not this mn
|
343 |
|
|
nodeId = new NodeReference();
|
344 |
|
|
try {
|
345 |
|
|
String currentNodeId = PropertyService.getInstance().getProperty("dataone.nodeId"); // return only pids for which this mn
|
346 |
|
|
nodeId.setValue(currentNodeId);
|
347 |
|
|
} catch(Exception e) {
|
348 |
|
|
throw new ServiceFailure("1580", e.getMessage());
|
349 |
|
|
}
|
350 |
|
|
}
|
351 |
|
|
return impl.listObjects(session, startTime, endTime, formatid, null, nodeId, start, count);
|
352 |
8810
|
leinfelder
|
}
|
353 |
|
|
|
354 |
|
|
@Override
|
355 |
|
|
public QueryEngineList listQueryEngines() throws InvalidToken,
|
356 |
|
|
ServiceFailure, NotAuthorized, NotImplemented {
|
357 |
|
|
return impl.listQueryEngines(null);
|
358 |
|
|
}
|
359 |
|
|
|
360 |
|
|
@Override
|
361 |
|
|
public InputStream query(String queryEngine, String query) throws InvalidToken,
|
362 |
|
|
ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented,
|
363 |
|
|
NotFound {
|
364 |
|
|
return impl.query(null, queryEngine, query);
|
365 |
|
|
}
|
366 |
|
|
|
367 |
|
|
@Override
|
368 |
|
|
public ObjectLocationList resolve(Identifier pid) throws InvalidToken,
|
369 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
370 |
|
|
return impl.resolve(null, pid);
|
371 |
|
|
}
|
372 |
|
|
|
373 |
|
|
@Override
|
374 |
|
|
@Deprecated
|
375 |
|
|
public ObjectLocationList resolve(Session session, Identifier pid)
|
376 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
377 |
|
|
NotImplemented {
|
378 |
|
|
return impl.resolve(session, pid);
|
379 |
|
|
}
|
380 |
|
|
|
381 |
|
|
@Override
|
382 |
|
|
public ObjectList search(String queryType, String query) throws InvalidToken,
|
383 |
|
|
ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented {
|
384 |
|
|
return impl.search(null, queryType, query);
|
385 |
|
|
}
|
386 |
|
|
|
387 |
|
|
@Override
|
388 |
|
|
@Deprecated
|
389 |
|
|
public ObjectList search(Session session, String queryType, String query)
|
390 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest,
|
391 |
|
|
NotImplemented {
|
392 |
|
|
return impl.search(session, queryType, query);
|
393 |
|
|
}
|
394 |
|
|
|
395 |
|
|
@Override
|
396 |
|
|
public Identifier archive(Identifier pid) throws InvalidToken,
|
397 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
398 |
9050
|
tao
|
String serviceFailure = "4972";
|
399 |
|
|
String notFound = "4971";
|
400 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
401 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
402 |
8810
|
leinfelder
|
return impl.archive(null, pid);
|
403 |
|
|
}
|
404 |
|
|
|
405 |
|
|
@Override
|
406 |
|
|
@Deprecated
|
407 |
|
|
public Identifier archive(Session session, Identifier pid)
|
408 |
|
|
throws InvalidToken, ServiceFailure, InvalidRequest, NotAuthorized,
|
409 |
|
|
NotFound, NotImplemented {
|
410 |
9050
|
tao
|
String serviceFailure = "4972";
|
411 |
|
|
String notFound = "4971";
|
412 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
413 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
414 |
8810
|
leinfelder
|
return impl.archive(session, pid);
|
415 |
|
|
}
|
416 |
|
|
|
417 |
|
|
@Override
|
418 |
|
|
public Identifier create(Identifier pid, InputStream object,
|
419 |
|
|
SystemMetadata sysmeta) throws InvalidToken, ServiceFailure,
|
420 |
|
|
NotAuthorized, IdentifierNotUnique, UnsupportedType,
|
421 |
|
|
InsufficientResources, InvalidSystemMetadata, NotImplemented,
|
422 |
|
|
InvalidRequest {
|
423 |
|
|
return this.create(null, pid, object, sysmeta);
|
424 |
|
|
}
|
425 |
|
|
|
426 |
|
|
@Override
|
427 |
|
|
@Deprecated
|
428 |
|
|
public Identifier create(Session session, Identifier pid, InputStream object,
|
429 |
|
|
SystemMetadata sysmeta) throws InvalidToken, ServiceFailure,
|
430 |
|
|
NotAuthorized, IdentifierNotUnique, UnsupportedType,
|
431 |
|
|
InsufficientResources, InvalidSystemMetadata, NotImplemented,
|
432 |
|
|
InvalidRequest {
|
433 |
|
|
|
434 |
|
|
//convert sysmeta to newer version
|
435 |
|
|
org.dataone.service.types.v2.SystemMetadata v2Sysmeta = null;
|
436 |
|
|
try {
|
437 |
9304
|
tao
|
v2Sysmeta = TypeFactory.convertTypeFromType(sysmeta, org.dataone.service.types.v2.SystemMetadata.class);
|
438 |
8810
|
leinfelder
|
} catch (Exception e) {
|
439 |
9600
|
tao
|
IOUtils.closeQuietly(object);
|
440 |
8810
|
leinfelder
|
// report as service failure
|
441 |
|
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
442 |
|
|
sf.initCause(e);
|
443 |
|
|
throw sf;
|
444 |
|
|
}
|
445 |
|
|
|
446 |
|
|
return impl.create(session, pid, object, v2Sysmeta);
|
447 |
|
|
}
|
448 |
|
|
|
449 |
|
|
@Override
|
450 |
|
|
public Identifier delete(Identifier pid) throws InvalidToken,
|
451 |
|
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
452 |
9050
|
tao
|
String serviceFailure = "4962";
|
453 |
|
|
String notFound = "4961";
|
454 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
455 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
456 |
8810
|
leinfelder
|
return impl.delete(null, pid);
|
457 |
|
|
}
|
458 |
|
|
|
459 |
|
|
@Override
|
460 |
|
|
@Deprecated
|
461 |
|
|
public Identifier delete(Session session, Identifier pid)
|
462 |
|
|
throws InvalidToken, ServiceFailure, InvalidRequest, NotAuthorized,
|
463 |
|
|
NotFound, NotImplemented {
|
464 |
9050
|
tao
|
String serviceFailure = "4962";
|
465 |
|
|
String notFound = "4961";
|
466 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
467 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
468 |
8810
|
leinfelder
|
return impl.delete(session, pid);
|
469 |
|
|
}
|
470 |
|
|
|
471 |
|
|
@Override
|
472 |
|
|
public Identifier generateIdentifier(String scheme, String fragment)
|
473 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
474 |
|
|
InvalidRequest {
|
475 |
|
|
return impl.generateIdentifier(null, scheme, fragment);
|
476 |
|
|
}
|
477 |
|
|
|
478 |
|
|
@Override
|
479 |
|
|
@Deprecated
|
480 |
|
|
public Identifier generateIdentifier(Session session, String scheme, String fragment)
|
481 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
482 |
|
|
InvalidRequest {
|
483 |
|
|
return impl.generateIdentifier(session, scheme, fragment);
|
484 |
|
|
}
|
485 |
|
|
|
486 |
|
|
@Override
|
487 |
|
|
public ObjectFormat getFormat(ObjectFormatIdentifier fmtid)
|
488 |
|
|
throws ServiceFailure, NotFound, NotImplemented, InvalidRequest {
|
489 |
9143
|
tao
|
org.dataone.service.types.v2.ObjectFormat format = impl.getFormat(fmtid);
|
490 |
|
|
ObjectFormat v1Format = null;
|
491 |
|
|
try {
|
492 |
9304
|
tao
|
v1Format = TypeFactory.convertTypeFromType(format, ObjectFormat.class);
|
493 |
9143
|
tao
|
} catch (Exception e) {
|
494 |
|
|
ServiceFailure sf = new ServiceFailure("4846", e.getMessage());
|
495 |
|
|
sf.initCause(e);
|
496 |
|
|
throw sf;
|
497 |
|
|
}
|
498 |
|
|
return v1Format;
|
499 |
8810
|
leinfelder
|
}
|
500 |
|
|
|
501 |
|
|
@Override
|
502 |
|
|
public Log getLogRecords(Date fromDate, Date toDate, Event event,
|
503 |
|
|
String pidFilter, Integer start, Integer count) throws InvalidToken, InvalidRequest,
|
504 |
|
|
ServiceFailure, NotAuthorized, NotImplemented,
|
505 |
|
|
InsufficientResources {
|
506 |
|
|
return this.getLogRecords(null, fromDate, toDate, event, pidFilter, start, count);
|
507 |
|
|
}
|
508 |
|
|
|
509 |
|
|
@Override
|
510 |
|
|
@Deprecated
|
511 |
|
|
public Log getLogRecords(Session session, Date fromDate, Date toDate, Event event,
|
512 |
|
|
String pidFilter, Integer start, Integer count) throws InvalidToken,
|
513 |
|
|
InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented,
|
514 |
|
|
InsufficientResources {
|
515 |
9061
|
tao
|
Log retLog = new Log();
|
516 |
9063
|
tao
|
if(pidFilter != null && !pidFilter.trim().equals("")) {
|
517 |
9061
|
tao
|
String serviceFailure = "1490";
|
518 |
|
|
String notFound = "1020";
|
519 |
|
|
Identifier pid = new Identifier();
|
520 |
|
|
pid.setValue(pidFilter);
|
521 |
|
|
try {
|
522 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
523 |
|
|
"The given PID: "+pid.getValue()+" doesn't exist in this node");
|
524 |
|
|
} catch (NotFound e) {
|
525 |
|
|
//return 0 record since the pid doesn't exist
|
526 |
|
|
logMetacat.info(e.getMessage());
|
527 |
|
|
return retLog;
|
528 |
|
|
}
|
529 |
|
|
|
530 |
|
|
}
|
531 |
9059
|
tao
|
String eventValue = null;
|
532 |
|
|
if(event != null) {
|
533 |
|
|
eventValue = event.xmlValue();
|
534 |
|
|
}
|
535 |
|
|
org.dataone.service.types.v2.Log log = impl.getLogRecords(session, fromDate, toDate, eventValue, pidFilter, start, count);
|
536 |
8810
|
leinfelder
|
try {
|
537 |
9317
|
tao
|
retLog = TypeFactory.convertTypeFromType(log, Log.class);
|
538 |
|
|
//LogV2toV1Converter converter = new LogV2toV1Converter();
|
539 |
|
|
//retLog = converter.convert(log);
|
540 |
8810
|
leinfelder
|
} catch (Exception e) {
|
541 |
|
|
// report as service failure
|
542 |
|
|
ServiceFailure sf = new ServiceFailure("1490", e.getMessage());
|
543 |
|
|
sf.initCause(e);
|
544 |
|
|
throw sf;
|
545 |
|
|
}
|
546 |
|
|
return retLog;
|
547 |
|
|
}
|
548 |
|
|
|
549 |
|
|
@Override
|
550 |
|
|
public boolean hasReservation(Subject subject, Identifier pid)
|
551 |
|
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
552 |
9367
|
rnahf
|
NotImplemented, InvalidRequest {
|
553 |
8810
|
leinfelder
|
return impl.hasReservation(null, subject, pid);
|
554 |
|
|
}
|
555 |
|
|
|
556 |
|
|
@Override
|
557 |
|
|
@Deprecated
|
558 |
|
|
public boolean hasReservation(Session session, Subject subject, Identifier pid)
|
559 |
|
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
560 |
9367
|
rnahf
|
NotImplemented, InvalidRequest {
|
561 |
8810
|
leinfelder
|
return impl.hasReservation(session, subject, pid);
|
562 |
|
|
|
563 |
|
|
}
|
564 |
|
|
|
565 |
|
|
@Override
|
566 |
|
|
public ChecksumAlgorithmList listChecksumAlgorithms()
|
567 |
|
|
throws ServiceFailure, NotImplemented {
|
568 |
|
|
return impl.listChecksumAlgorithms();
|
569 |
|
|
}
|
570 |
|
|
|
571 |
|
|
@Override
|
572 |
|
|
public ObjectFormatList listFormats() throws ServiceFailure, NotImplemented {
|
573 |
|
|
org.dataone.service.types.v2.ObjectFormatList formats = impl.listFormats();
|
574 |
9083
|
tao
|
ObjectFormatList retFormats = new ObjectFormatList();
|
575 |
8810
|
leinfelder
|
try {
|
576 |
9317
|
tao
|
/*if(formats != null) {
|
577 |
9083
|
tao
|
List<org.dataone.service.types.v2.ObjectFormat> objectFormatList = formats.getObjectFormatList();
|
578 |
|
|
if(objectFormatList != null) {
|
579 |
|
|
for(org.dataone.service.types.v2.ObjectFormat format : objectFormatList) {
|
580 |
9304
|
tao
|
ObjectFormat v1Format = TypeFactory.convertTypeFromType(format, ObjectFormat.class);
|
581 |
9083
|
tao
|
retFormats.addObjectFormat(v1Format);
|
582 |
|
|
}
|
583 |
|
|
}
|
584 |
|
|
|
585 |
9317
|
tao
|
}*/
|
586 |
|
|
retFormats = TypeFactory.convertTypeFromType(formats, ObjectFormatList.class);
|
587 |
8810
|
leinfelder
|
} catch (Exception e) {
|
588 |
|
|
// report as service failure
|
589 |
|
|
ServiceFailure sf = new ServiceFailure("4841", e.getMessage());
|
590 |
|
|
sf.initCause(e);
|
591 |
|
|
throw sf;
|
592 |
|
|
}
|
593 |
|
|
return retFormats;
|
594 |
|
|
}
|
595 |
|
|
|
596 |
|
|
@Override
|
597 |
|
|
public NodeList listNodes() throws NotImplemented, ServiceFailure {
|
598 |
|
|
org.dataone.service.types.v2.NodeList nodes = impl.listNodes();
|
599 |
|
|
NodeList retNodes = null;
|
600 |
|
|
try {
|
601 |
9304
|
tao
|
retNodes = TypeFactory.convertTypeFromType(nodes, NodeList.class);
|
602 |
8810
|
leinfelder
|
} catch (Exception e) {
|
603 |
|
|
// report as service failure
|
604 |
|
|
ServiceFailure sf = new ServiceFailure("4801", e.getMessage());
|
605 |
|
|
sf.initCause(e);
|
606 |
|
|
throw sf;
|
607 |
|
|
}
|
608 |
|
|
return retNodes;
|
609 |
|
|
}
|
610 |
|
|
|
611 |
|
|
@Override
|
612 |
|
|
public Date ping() throws NotImplemented, ServiceFailure,
|
613 |
|
|
InsufficientResources {
|
614 |
|
|
return impl.ping();
|
615 |
|
|
}
|
616 |
|
|
|
617 |
|
|
@Override
|
618 |
|
|
public Identifier registerSystemMetadata(Identifier pid,
|
619 |
|
|
SystemMetadata sysmeta) throws NotImplemented, NotAuthorized,
|
620 |
|
|
ServiceFailure, InvalidRequest, InvalidSystemMetadata, InvalidToken {
|
621 |
|
|
return this.registerSystemMetadata(null, pid, sysmeta);
|
622 |
|
|
|
623 |
|
|
}
|
624 |
|
|
|
625 |
|
|
@Override
|
626 |
|
|
@Deprecated
|
627 |
|
|
public Identifier registerSystemMetadata(Session session, Identifier pid,
|
628 |
|
|
SystemMetadata sysmeta) throws NotImplemented, NotAuthorized,
|
629 |
|
|
ServiceFailure, InvalidRequest, InvalidSystemMetadata, InvalidToken {
|
630 |
9359
|
tao
|
if (pid == null || pid.getValue().trim().equals("")) {
|
631 |
|
|
throw new InvalidRequest("4863", "The pid should not be null in the register system metadata request");
|
632 |
|
|
}
|
633 |
|
|
if(sysmeta == null) {
|
634 |
|
|
throw new InvalidRequest("4863", "The system metadata object should not be null in the register system metadata request for the pid"+pid.getValue());
|
635 |
|
|
}
|
636 |
8810
|
leinfelder
|
//convert sysmeta to newer version
|
637 |
|
|
org.dataone.service.types.v2.SystemMetadata v2Sysmeta = null;
|
638 |
|
|
try {
|
639 |
9304
|
tao
|
v2Sysmeta = TypeFactory.convertTypeFromType(sysmeta, org.dataone.service.types.v2.SystemMetadata.class);
|
640 |
9359
|
tao
|
|
641 |
8810
|
leinfelder
|
} catch (Exception e) {
|
642 |
|
|
// report as service failure
|
643 |
|
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
644 |
|
|
sf.initCause(e);
|
645 |
|
|
throw sf;
|
646 |
|
|
}
|
647 |
9359
|
tao
|
//this method will apply to the objects whose authoritative mn is v1.
|
648 |
|
|
D1NodeVersionChecker checker = new D1NodeVersionChecker(v2Sysmeta.getAuthoritativeMemberNode());
|
649 |
10041
|
tao
|
String version = checker.getVersion("MNRead");
|
650 |
9359
|
tao
|
if(version == null) {
|
651 |
10041
|
tao
|
throw new ServiceFailure("4862", "Couldn't determine the MNRead version of the authoritative member node for the pid "+pid.getValue());
|
652 |
9359
|
tao
|
} else if (version.equalsIgnoreCase(D1NodeVersionChecker.V2)) {
|
653 |
|
|
//we don't apply this method to an object whose authoritative node is v2
|
654 |
|
|
throw new NotAuthorized("4861", edu.ucsb.nceas.metacat.dataone.CNodeService.V2V1MISSMATCH);
|
655 |
|
|
} else if (!version.equalsIgnoreCase(D1NodeVersionChecker.V1)) {
|
656 |
|
|
//we don't understand this version (it is not v1 or v2)
|
657 |
10041
|
tao
|
throw new InvalidRequest("4863", "The version of the MNRead is "+version+" for the authoritative member node of the object "+pid.getValue()+". We don't support it.");
|
658 |
9359
|
tao
|
}
|
659 |
|
|
//set the serial version to one
|
660 |
|
|
v2Sysmeta.setSerialVersion(BigInteger.ONE);
|
661 |
|
|
// the v2(impl).registerSysteMetadata will reset the system metadata modification date
|
662 |
|
|
//for the objects whose authoritative member node is v1.
|
663 |
8810
|
leinfelder
|
return impl.registerSystemMetadata(session, pid, v2Sysmeta);
|
664 |
|
|
}
|
665 |
|
|
|
666 |
|
|
@Override
|
667 |
|
|
public Identifier reserveIdentifier(Identifier pid) throws InvalidToken,
|
668 |
|
|
ServiceFailure, NotAuthorized, IdentifierNotUnique, NotImplemented,
|
669 |
|
|
InvalidRequest {
|
670 |
|
|
return impl.reserveIdentifier(null, pid);
|
671 |
|
|
}
|
672 |
|
|
|
673 |
|
|
@Override
|
674 |
|
|
@Deprecated
|
675 |
|
|
public Identifier reserveIdentifier(Session session, Identifier pid)
|
676 |
|
|
throws InvalidToken, ServiceFailure, NotAuthorized,
|
677 |
|
|
IdentifierNotUnique, NotImplemented, InvalidRequest {
|
678 |
|
|
return impl.reserveIdentifier(session, pid);
|
679 |
|
|
}
|
680 |
|
|
|
681 |
|
|
@Override
|
682 |
|
|
public boolean setObsoletedBy(Identifier pid, Identifier obsoletedByPid, long serialVersion)
|
683 |
|
|
throws NotImplemented, NotFound, NotAuthorized, ServiceFailure,
|
684 |
|
|
InvalidRequest, InvalidToken, VersionMismatch {
|
685 |
9124
|
tao
|
/*String serviceFailure = "4941";
|
686 |
9065
|
tao
|
String notFound = "4944";
|
687 |
9066
|
tao
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
688 |
9124
|
tao
|
"No object could be found for given PID: "+obsoletedByPid.getValue());*/
|
689 |
8810
|
leinfelder
|
return impl.setObsoletedBy(null, pid, obsoletedByPid, serialVersion);
|
690 |
|
|
}
|
691 |
|
|
|
692 |
|
|
@Override
|
693 |
|
|
@Deprecated
|
694 |
|
|
public boolean setObsoletedBy(Session session, Identifier pid, Identifier obsoletedByPid, long serialVersion)
|
695 |
|
|
throws NotImplemented, NotFound,
|
696 |
|
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
697 |
|
|
VersionMismatch {
|
698 |
9124
|
tao
|
/*String serviceFailure = "4941";
|
699 |
9065
|
tao
|
String notFound = "4944";
|
700 |
9066
|
tao
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
701 |
9124
|
tao
|
"No object could be found for given PID: "+obsoletedByPid.getValue());*/
|
702 |
8810
|
leinfelder
|
return impl.setObsoletedBy(session, pid, obsoletedByPid, serialVersion);
|
703 |
|
|
|
704 |
|
|
}
|
705 |
|
|
|
706 |
|
|
@Override
|
707 |
|
|
public boolean isAuthorized(Identifier pid, Permission permission)
|
708 |
|
|
throws ServiceFailure, InvalidToken, NotFound, NotAuthorized,
|
709 |
|
|
NotImplemented, InvalidRequest {
|
710 |
9051
|
tao
|
String serviceFailure = "1760";
|
711 |
|
|
String notFound = "1800";
|
712 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
713 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
714 |
8810
|
leinfelder
|
return impl.isAuthorized(null, pid, permission);
|
715 |
|
|
}
|
716 |
|
|
|
717 |
|
|
@Override
|
718 |
|
|
@Deprecated
|
719 |
|
|
public boolean isAuthorized(Session session, Identifier pid, Permission permission)
|
720 |
|
|
throws ServiceFailure, InvalidToken, NotFound, NotAuthorized,
|
721 |
|
|
NotImplemented, InvalidRequest {
|
722 |
9051
|
tao
|
String serviceFailure = "1760";
|
723 |
|
|
String notFound = "1800";
|
724 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
725 |
|
|
"The object specified by "+pid.getValue()+" does not exist at this node.");
|
726 |
8810
|
leinfelder
|
return impl.isAuthorized(session, pid, permission);
|
727 |
|
|
}
|
728 |
|
|
|
729 |
|
|
@Override
|
730 |
|
|
public boolean setAccessPolicy(Identifier pid,
|
731 |
|
|
AccessPolicy accessPolicy, long serialVersion)
|
732 |
|
|
throws InvalidToken, NotFound, NotImplemented, NotAuthorized,
|
733 |
|
|
ServiceFailure, InvalidRequest, VersionMismatch {
|
734 |
9065
|
tao
|
String serviceFailure = "4430";
|
735 |
|
|
String notFound = "4400";
|
736 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
737 |
|
|
"No object could be found for given PID: "+pid.getValue());
|
738 |
8810
|
leinfelder
|
return impl.setAccessPolicy(null, pid, accessPolicy, serialVersion);
|
739 |
|
|
}
|
740 |
|
|
|
741 |
|
|
@Override
|
742 |
|
|
@Deprecated
|
743 |
|
|
public boolean setAccessPolicy(Session session, Identifier pid,
|
744 |
|
|
AccessPolicy accessPolicy, long serialVersion) throws InvalidToken, NotFound,
|
745 |
|
|
NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest,
|
746 |
|
|
VersionMismatch {
|
747 |
9065
|
tao
|
String serviceFailure = "4430";
|
748 |
|
|
String notFound = "4400";
|
749 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
750 |
|
|
"No object could be found for given PID: "+pid.getValue());
|
751 |
8810
|
leinfelder
|
return impl.setAccessPolicy(session, pid, accessPolicy, serialVersion);
|
752 |
|
|
}
|
753 |
|
|
|
754 |
|
|
@Override
|
755 |
|
|
public Identifier setRightsHolder(Identifier pid, Subject userId, long serialVersion)
|
756 |
|
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
757 |
|
|
NotImplemented, InvalidRequest, VersionMismatch {
|
758 |
9093
|
tao
|
String serviceFailure = "4490";
|
759 |
|
|
String notFound = "4460";
|
760 |
|
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
761 |
|
|
"No object could be found for given PID: "+pid.getValue());
|
762 |
8810
|
leinfelder
|
return impl.setRightsHolder(null, pid, userId, serialVersion);
|
763 |
|
|
}
|
764 |
|
|
|
765 |
|
|
@Override
|
766 |
|
|
@Deprecated
|
767 |
|
|
public Identifier setRightsHolder(Session session, Identifier pid,
|
768 |
|
|
Subject userId, long serialVersion) throws InvalidToken, ServiceFailure,
|
769 |
|
|
NotFound, NotAuthorized, NotImplemented, InvalidRequest,
|
770 |
|
|
VersionMismatch {
|
771 |
|
|
return impl.setRightsHolder(session, pid, userId, serialVersion);
|
772 |
|
|
|
773 |
|
|
}
|
774 |
|
|
|
775 |
|
|
}
|