1
|
/**
|
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: tao $'
|
7
|
* '$Date: 2014-12-23 16:53:34 -0800 (Tue, 23 Dec 2014) $'
|
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
|
import java.sql.SQLException;
|
28
|
import java.util.Date;
|
29
|
|
30
|
import javax.servlet.http.HttpServletRequest;
|
31
|
|
32
|
import org.apache.log4j.Logger;
|
33
|
import org.dataone.service.cn.v1.CNAuthorization;
|
34
|
import org.dataone.service.cn.v1.CNCore;
|
35
|
import org.dataone.service.cn.v1.CNRead;
|
36
|
import org.dataone.service.cn.v1.CNReplication;
|
37
|
import org.dataone.service.exceptions.BaseException;
|
38
|
import org.dataone.service.exceptions.IdentifierNotUnique;
|
39
|
import org.dataone.service.exceptions.InsufficientResources;
|
40
|
import org.dataone.service.exceptions.InvalidRequest;
|
41
|
import org.dataone.service.exceptions.InvalidSystemMetadata;
|
42
|
import org.dataone.service.exceptions.InvalidToken;
|
43
|
import org.dataone.service.exceptions.NotAuthorized;
|
44
|
import org.dataone.service.exceptions.NotFound;
|
45
|
import org.dataone.service.exceptions.NotImplemented;
|
46
|
import org.dataone.service.exceptions.ServiceFailure;
|
47
|
import org.dataone.service.exceptions.UnsupportedType;
|
48
|
import org.dataone.service.exceptions.VersionMismatch;
|
49
|
import org.dataone.service.types.v1.AccessPolicy;
|
50
|
import org.dataone.service.types.v1.Checksum;
|
51
|
import org.dataone.service.types.v1.ChecksumAlgorithmList;
|
52
|
import org.dataone.service.types.v1.DescribeResponse;
|
53
|
import org.dataone.service.types.v1.Event;
|
54
|
import org.dataone.service.types.v1.Identifier;
|
55
|
import org.dataone.service.types.v1.Log;
|
56
|
import org.dataone.service.types.v1.NodeList;
|
57
|
import org.dataone.service.types.v1.NodeReference;
|
58
|
import org.dataone.service.types.v1.ObjectFormat;
|
59
|
import org.dataone.service.types.v1.ObjectFormatIdentifier;
|
60
|
import org.dataone.service.types.v1.ObjectFormatList;
|
61
|
import org.dataone.service.types.v1.ObjectList;
|
62
|
import org.dataone.service.types.v1.ObjectLocationList;
|
63
|
import org.dataone.service.types.v1.Permission;
|
64
|
import org.dataone.service.types.v1.Replica;
|
65
|
import org.dataone.service.types.v1.ReplicationPolicy;
|
66
|
import org.dataone.service.types.v1.ReplicationStatus;
|
67
|
import org.dataone.service.types.v1.Session;
|
68
|
import org.dataone.service.types.v1.Subject;
|
69
|
import org.dataone.service.types.v1.SystemMetadata;
|
70
|
import org.dataone.service.types.v1_1.QueryEngineDescription;
|
71
|
import org.dataone.service.types.v1_1.QueryEngineList;
|
72
|
import org.dataone.service.util.TypeMarshaller;
|
73
|
|
74
|
import edu.ucsb.nceas.metacat.IdentifierManager;
|
75
|
|
76
|
/**
|
77
|
* Represents Metacat's implementation of the DataONE Coordinating Node service
|
78
|
* API. Methods implement the various CN* interfaces, and methods common to both
|
79
|
* Member Node and Coordinating Node interfaces are found in the D1NodeService
|
80
|
* super class.
|
81
|
*
|
82
|
*/
|
83
|
public class CNodeService implements CNAuthorization, CNCore, CNRead,
|
84
|
CNReplication {
|
85
|
|
86
|
// pass through to the most recent implementation
|
87
|
private edu.ucsb.nceas.metacat.dataone.CNodeService impl = null;
|
88
|
|
89
|
/* the logger instance */
|
90
|
private Logger logMetacat = null;
|
91
|
|
92
|
/**
|
93
|
* singleton accessor
|
94
|
*/
|
95
|
public static CNodeService getInstance(HttpServletRequest request) {
|
96
|
return new CNodeService(request);
|
97
|
}
|
98
|
|
99
|
/**
|
100
|
* Constructor, private for singleton access
|
101
|
*/
|
102
|
private CNodeService(HttpServletRequest request) {
|
103
|
|
104
|
logMetacat = Logger.getLogger(CNodeService.class);
|
105
|
|
106
|
impl = edu.ucsb.nceas.metacat.dataone.CNodeService.getInstance(request);
|
107
|
|
108
|
}
|
109
|
|
110
|
@Override
|
111
|
public boolean deleteReplicationMetadata(Identifier pid,
|
112
|
NodeReference nodeId, long serialVersion) throws InvalidToken, InvalidRequest,
|
113
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented,
|
114
|
VersionMismatch {
|
115
|
return impl.deleteReplicationMetadata(null, pid, nodeId, serialVersion);
|
116
|
}
|
117
|
|
118
|
@Override
|
119
|
@Deprecated
|
120
|
public boolean deleteReplicationMetadata(Session session, Identifier pid,
|
121
|
NodeReference nodeId, long serialVersion) throws InvalidToken, InvalidRequest,
|
122
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented,
|
123
|
VersionMismatch {
|
124
|
return impl.deleteReplicationMetadata(session, pid, nodeId, serialVersion);
|
125
|
|
126
|
}
|
127
|
|
128
|
@Override
|
129
|
public boolean isNodeAuthorized(Subject targetNodeSubject, Identifier pid)
|
130
|
throws NotImplemented, NotAuthorized, InvalidToken, ServiceFailure,
|
131
|
NotFound, InvalidRequest {
|
132
|
return impl.isNodeAuthorized(null, targetNodeSubject, pid);
|
133
|
|
134
|
}
|
135
|
|
136
|
@Override
|
137
|
@Deprecated
|
138
|
public boolean isNodeAuthorized(Session originatingNodeSession, Subject targetNodeSubject, Identifier pid)
|
139
|
throws NotImplemented, NotAuthorized, InvalidToken, ServiceFailure,
|
140
|
NotFound, InvalidRequest {
|
141
|
return impl.isNodeAuthorized(originatingNodeSession, targetNodeSubject, pid);
|
142
|
}
|
143
|
|
144
|
@Override
|
145
|
public boolean setReplicationPolicy(Identifier pid,
|
146
|
ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
|
147
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
148
|
VersionMismatch {
|
149
|
return impl.setReplicationPolicy(null, pid, policy, serialVersion);
|
150
|
}
|
151
|
|
152
|
@Override
|
153
|
@Deprecated
|
154
|
public boolean setReplicationPolicy(Session session, Identifier pid,
|
155
|
ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
|
156
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
157
|
VersionMismatch {
|
158
|
return impl.setReplicationPolicy(session, pid, policy, serialVersion);
|
159
|
|
160
|
}
|
161
|
|
162
|
@Override
|
163
|
public boolean setReplicationStatus(Identifier pid,
|
164
|
NodeReference targetNode, ReplicationStatus status, BaseException failure)
|
165
|
throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized, InvalidRequest, NotFound {
|
166
|
return impl.setReplicationStatus(null, pid, targetNode, status, failure);
|
167
|
}
|
168
|
|
169
|
@Override
|
170
|
@Deprecated
|
171
|
public boolean setReplicationStatus(Session session, Identifier pid,
|
172
|
NodeReference targetNode, ReplicationStatus status, BaseException failure)
|
173
|
throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized,
|
174
|
InvalidRequest, NotFound {
|
175
|
return impl.setReplicationStatus(session, pid, targetNode, status, failure);
|
176
|
}
|
177
|
|
178
|
@Override
|
179
|
public boolean updateReplicationMetadata(Identifier pid,
|
180
|
Replica replica, long serialVersion) throws NotImplemented, NotAuthorized, ServiceFailure,
|
181
|
NotFound, InvalidRequest, InvalidToken, VersionMismatch {
|
182
|
return impl.updateReplicationMetadata(null, pid, replica, serialVersion);
|
183
|
}
|
184
|
|
185
|
@Override
|
186
|
@Deprecated
|
187
|
public boolean updateReplicationMetadata(Session session, Identifier pid,
|
188
|
Replica replica, long serialVersion) throws NotImplemented, NotAuthorized,
|
189
|
ServiceFailure, NotFound, InvalidRequest, InvalidToken,
|
190
|
VersionMismatch {
|
191
|
return impl.updateReplicationMetadata(session, pid, replica, serialVersion);
|
192
|
}
|
193
|
|
194
|
@Override
|
195
|
public DescribeResponse describe(Identifier pid) throws InvalidToken,
|
196
|
NotAuthorized, NotImplemented, ServiceFailure, NotFound {
|
197
|
String serviceFailure = "4931";
|
198
|
String notFound = "4933";
|
199
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
200
|
"No system metadata could be found for given PID: "+pid.getValue());
|
201
|
return impl.describe(null, pid);
|
202
|
}
|
203
|
|
204
|
@Override
|
205
|
@Deprecated
|
206
|
public DescribeResponse describe(Session session, Identifier pid)
|
207
|
throws InvalidToken, NotAuthorized, NotImplemented, ServiceFailure,
|
208
|
NotFound {
|
209
|
String serviceFailure = "4931";
|
210
|
String notFound = "4933";
|
211
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata for given PID "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
212
|
"No system metadata could be found for given PID: "+pid.getValue());
|
213
|
return impl.describe(session, pid);
|
214
|
}
|
215
|
|
216
|
@Override
|
217
|
public InputStream get(Identifier pid) throws InvalidToken,
|
218
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
219
|
String serviceFailure = "1030";
|
220
|
String notFound = "1020";
|
221
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
222
|
"The object specified by "+pid.getValue()+" does not exist at this node");
|
223
|
return impl.get(null, pid);
|
224
|
}
|
225
|
|
226
|
@Override
|
227
|
@Deprecated
|
228
|
public InputStream get(Session session, Identifier pid) throws InvalidToken,
|
229
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
230
|
String serviceFailure = "1030";
|
231
|
String notFound = "1020";
|
232
|
impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists", notFound,
|
233
|
"The object specified by "+pid.getValue()+" does not exist at this node");
|
234
|
return impl.get(session, pid);
|
235
|
}
|
236
|
|
237
|
@Override
|
238
|
public Checksum getChecksum(Identifier pid) throws InvalidToken,
|
239
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
240
|
return impl.getChecksum(null, pid);
|
241
|
}
|
242
|
|
243
|
@Override
|
244
|
@Deprecated
|
245
|
public Checksum getChecksum(Session session, Identifier pid)
|
246
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
247
|
NotImplemented {
|
248
|
return impl.getChecksum(session, pid);
|
249
|
}
|
250
|
|
251
|
@Override
|
252
|
public QueryEngineDescription getQueryEngineDescription(String queryEngine)
|
253
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
254
|
NotFound {
|
255
|
return impl.getQueryEngineDescription(null, queryEngine);
|
256
|
}
|
257
|
|
258
|
@Override
|
259
|
public SystemMetadata getSystemMetadata(Identifier pid)
|
260
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
261
|
NotImplemented {
|
262
|
return impl.getSystemMetadata(null, pid);
|
263
|
}
|
264
|
|
265
|
@Override
|
266
|
@Deprecated
|
267
|
public SystemMetadata getSystemMetadata(Session session, Identifier pid)
|
268
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
269
|
NotImplemented {
|
270
|
return impl.getSystemMetadata(session, pid);
|
271
|
}
|
272
|
|
273
|
@Override
|
274
|
public ObjectList listObjects(Date startTime, Date endTime,
|
275
|
ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start,
|
276
|
Integer count) throws InvalidRequest, InvalidToken, NotAuthorized,
|
277
|
NotImplemented, ServiceFailure {
|
278
|
return impl.listObjects(null, startTime, endTime, formatid, null, replicaStatus, start, count);
|
279
|
}
|
280
|
|
281
|
@Override
|
282
|
@Deprecated
|
283
|
public ObjectList listObjects(Session session, Date startTime, Date endTime,
|
284
|
ObjectFormatIdentifier formatid, Boolean replicaStatus, Integer start,
|
285
|
Integer count) throws InvalidRequest, InvalidToken, NotAuthorized,
|
286
|
NotImplemented, ServiceFailure {
|
287
|
return impl.listObjects(session, startTime, endTime, formatid, null, replicaStatus, start, count);
|
288
|
}
|
289
|
|
290
|
@Override
|
291
|
public QueryEngineList listQueryEngines() throws InvalidToken,
|
292
|
ServiceFailure, NotAuthorized, NotImplemented {
|
293
|
return impl.listQueryEngines(null);
|
294
|
}
|
295
|
|
296
|
@Override
|
297
|
public InputStream query(String queryEngine, String query) throws InvalidToken,
|
298
|
ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented,
|
299
|
NotFound {
|
300
|
return impl.query(null, queryEngine, query);
|
301
|
}
|
302
|
|
303
|
@Override
|
304
|
public ObjectLocationList resolve(Identifier pid) throws InvalidToken,
|
305
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
306
|
return impl.resolve(null, pid);
|
307
|
}
|
308
|
|
309
|
@Override
|
310
|
@Deprecated
|
311
|
public ObjectLocationList resolve(Session session, Identifier pid)
|
312
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotFound,
|
313
|
NotImplemented {
|
314
|
return impl.resolve(session, pid);
|
315
|
}
|
316
|
|
317
|
@Override
|
318
|
public ObjectList search(String queryType, String query) throws InvalidToken,
|
319
|
ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented {
|
320
|
return impl.search(null, queryType, query);
|
321
|
}
|
322
|
|
323
|
@Override
|
324
|
@Deprecated
|
325
|
public ObjectList search(Session session, String queryType, String query)
|
326
|
throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest,
|
327
|
NotImplemented {
|
328
|
return impl.search(session, queryType, query);
|
329
|
}
|
330
|
|
331
|
@Override
|
332
|
public Identifier archive(Identifier pid) throws InvalidToken,
|
333
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
334
|
return impl.archive(null, pid);
|
335
|
}
|
336
|
|
337
|
@Override
|
338
|
@Deprecated
|
339
|
public Identifier archive(Session session, Identifier pid)
|
340
|
throws InvalidToken, ServiceFailure, InvalidRequest, NotAuthorized,
|
341
|
NotFound, NotImplemented {
|
342
|
return impl.archive(session, pid);
|
343
|
}
|
344
|
|
345
|
@Override
|
346
|
public Identifier create(Identifier pid, InputStream object,
|
347
|
SystemMetadata sysmeta) throws InvalidToken, ServiceFailure,
|
348
|
NotAuthorized, IdentifierNotUnique, UnsupportedType,
|
349
|
InsufficientResources, InvalidSystemMetadata, NotImplemented,
|
350
|
InvalidRequest {
|
351
|
return this.create(null, pid, object, sysmeta);
|
352
|
}
|
353
|
|
354
|
@Override
|
355
|
@Deprecated
|
356
|
public Identifier create(Session session, Identifier pid, InputStream object,
|
357
|
SystemMetadata sysmeta) throws InvalidToken, ServiceFailure,
|
358
|
NotAuthorized, IdentifierNotUnique, UnsupportedType,
|
359
|
InsufficientResources, InvalidSystemMetadata, NotImplemented,
|
360
|
InvalidRequest {
|
361
|
|
362
|
//convert sysmeta to newer version
|
363
|
org.dataone.service.types.v2.SystemMetadata v2Sysmeta = null;
|
364
|
try {
|
365
|
v2Sysmeta = TypeMarshaller.convertTypeFromType(sysmeta, org.dataone.service.types.v2.SystemMetadata.class);
|
366
|
} catch (Exception e) {
|
367
|
// report as service failure
|
368
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
369
|
sf.initCause(e);
|
370
|
throw sf;
|
371
|
}
|
372
|
|
373
|
return impl.create(session, pid, object, v2Sysmeta);
|
374
|
}
|
375
|
|
376
|
@Override
|
377
|
public Identifier delete(Identifier pid) throws InvalidToken,
|
378
|
ServiceFailure, NotAuthorized, NotFound, NotImplemented {
|
379
|
return impl.delete(null, pid);
|
380
|
}
|
381
|
|
382
|
@Override
|
383
|
@Deprecated
|
384
|
public Identifier delete(Session session, Identifier pid)
|
385
|
throws InvalidToken, ServiceFailure, InvalidRequest, NotAuthorized,
|
386
|
NotFound, NotImplemented {
|
387
|
return impl.delete(session, pid);
|
388
|
}
|
389
|
|
390
|
@Override
|
391
|
public Identifier generateIdentifier(String scheme, String fragment)
|
392
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
393
|
InvalidRequest {
|
394
|
return impl.generateIdentifier(null, scheme, fragment);
|
395
|
}
|
396
|
|
397
|
@Override
|
398
|
@Deprecated
|
399
|
public Identifier generateIdentifier(Session session, String scheme, String fragment)
|
400
|
throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
|
401
|
InvalidRequest {
|
402
|
return impl.generateIdentifier(session, scheme, fragment);
|
403
|
}
|
404
|
|
405
|
@Override
|
406
|
public ObjectFormat getFormat(ObjectFormatIdentifier fmtid)
|
407
|
throws ServiceFailure, NotFound, NotImplemented, InvalidRequest {
|
408
|
return impl.getFormat(fmtid);
|
409
|
}
|
410
|
|
411
|
@Override
|
412
|
public Log getLogRecords(Date fromDate, Date toDate, Event event,
|
413
|
String pidFilter, Integer start, Integer count) throws InvalidToken, InvalidRequest,
|
414
|
ServiceFailure, NotAuthorized, NotImplemented,
|
415
|
InsufficientResources {
|
416
|
return this.getLogRecords(null, fromDate, toDate, event, pidFilter, start, count);
|
417
|
}
|
418
|
|
419
|
@Override
|
420
|
@Deprecated
|
421
|
public Log getLogRecords(Session session, Date fromDate, Date toDate, Event event,
|
422
|
String pidFilter, Integer start, Integer count) throws InvalidToken,
|
423
|
InvalidRequest, ServiceFailure, NotAuthorized, NotImplemented,
|
424
|
InsufficientResources {
|
425
|
org.dataone.service.types.v2.Log log = impl.getLogRecords(session, fromDate, toDate, event.xmlValue(), pidFilter, start, count);
|
426
|
Log retLog = null;
|
427
|
try {
|
428
|
retLog = TypeMarshaller.convertTypeFromType(log, Log.class);
|
429
|
} catch (Exception e) {
|
430
|
// report as service failure
|
431
|
ServiceFailure sf = new ServiceFailure("1490", e.getMessage());
|
432
|
sf.initCause(e);
|
433
|
throw sf;
|
434
|
}
|
435
|
return retLog;
|
436
|
}
|
437
|
|
438
|
@Override
|
439
|
public boolean hasReservation(Subject subject, Identifier pid)
|
440
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
441
|
NotImplemented, InvalidRequest, IdentifierNotUnique {
|
442
|
return impl.hasReservation(null, subject, pid);
|
443
|
}
|
444
|
|
445
|
@Override
|
446
|
@Deprecated
|
447
|
public boolean hasReservation(Session session, Subject subject, Identifier pid)
|
448
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
449
|
NotImplemented, InvalidRequest, IdentifierNotUnique {
|
450
|
return impl.hasReservation(session, subject, pid);
|
451
|
|
452
|
}
|
453
|
|
454
|
@Override
|
455
|
public ChecksumAlgorithmList listChecksumAlgorithms()
|
456
|
throws ServiceFailure, NotImplemented {
|
457
|
return impl.listChecksumAlgorithms();
|
458
|
}
|
459
|
|
460
|
@Override
|
461
|
public ObjectFormatList listFormats() throws ServiceFailure, NotImplemented {
|
462
|
org.dataone.service.types.v2.ObjectFormatList formats = impl.listFormats();
|
463
|
ObjectFormatList retFormats = null;
|
464
|
try {
|
465
|
retFormats = TypeMarshaller.convertTypeFromType(formats, ObjectFormatList.class);
|
466
|
} catch (Exception e) {
|
467
|
// report as service failure
|
468
|
ServiceFailure sf = new ServiceFailure("4841", e.getMessage());
|
469
|
sf.initCause(e);
|
470
|
throw sf;
|
471
|
}
|
472
|
return retFormats;
|
473
|
}
|
474
|
|
475
|
@Override
|
476
|
public NodeList listNodes() throws NotImplemented, ServiceFailure {
|
477
|
org.dataone.service.types.v2.NodeList nodes = impl.listNodes();
|
478
|
NodeList retNodes = null;
|
479
|
try {
|
480
|
retNodes = TypeMarshaller.convertTypeFromType(nodes, NodeList.class);
|
481
|
} catch (Exception e) {
|
482
|
// report as service failure
|
483
|
ServiceFailure sf = new ServiceFailure("4801", e.getMessage());
|
484
|
sf.initCause(e);
|
485
|
throw sf;
|
486
|
}
|
487
|
return retNodes;
|
488
|
}
|
489
|
|
490
|
@Override
|
491
|
public Date ping() throws NotImplemented, ServiceFailure,
|
492
|
InsufficientResources {
|
493
|
return impl.ping();
|
494
|
}
|
495
|
|
496
|
@Override
|
497
|
public Identifier registerSystemMetadata(Identifier pid,
|
498
|
SystemMetadata sysmeta) throws NotImplemented, NotAuthorized,
|
499
|
ServiceFailure, InvalidRequest, InvalidSystemMetadata, InvalidToken {
|
500
|
return this.registerSystemMetadata(null, pid, sysmeta);
|
501
|
|
502
|
}
|
503
|
|
504
|
@Override
|
505
|
@Deprecated
|
506
|
public Identifier registerSystemMetadata(Session session, Identifier pid,
|
507
|
SystemMetadata sysmeta) throws NotImplemented, NotAuthorized,
|
508
|
ServiceFailure, InvalidRequest, InvalidSystemMetadata, InvalidToken {
|
509
|
//convert sysmeta to newer version
|
510
|
org.dataone.service.types.v2.SystemMetadata v2Sysmeta = null;
|
511
|
try {
|
512
|
v2Sysmeta = TypeMarshaller.convertTypeFromType(sysmeta, org.dataone.service.types.v2.SystemMetadata.class);
|
513
|
} catch (Exception e) {
|
514
|
// report as service failure
|
515
|
ServiceFailure sf = new ServiceFailure("1030", e.getMessage());
|
516
|
sf.initCause(e);
|
517
|
throw sf;
|
518
|
}
|
519
|
|
520
|
return impl.registerSystemMetadata(session, pid, v2Sysmeta);
|
521
|
}
|
522
|
|
523
|
@Override
|
524
|
public Identifier reserveIdentifier(Identifier pid) throws InvalidToken,
|
525
|
ServiceFailure, NotAuthorized, IdentifierNotUnique, NotImplemented,
|
526
|
InvalidRequest {
|
527
|
return impl.reserveIdentifier(null, pid);
|
528
|
}
|
529
|
|
530
|
@Override
|
531
|
@Deprecated
|
532
|
public Identifier reserveIdentifier(Session session, Identifier pid)
|
533
|
throws InvalidToken, ServiceFailure, NotAuthorized,
|
534
|
IdentifierNotUnique, NotImplemented, InvalidRequest {
|
535
|
return impl.reserveIdentifier(session, pid);
|
536
|
}
|
537
|
|
538
|
@Override
|
539
|
public boolean setObsoletedBy(Identifier pid, Identifier obsoletedByPid, long serialVersion)
|
540
|
throws NotImplemented, NotFound, NotAuthorized, ServiceFailure,
|
541
|
InvalidRequest, InvalidToken, VersionMismatch {
|
542
|
return impl.setObsoletedBy(null, pid, obsoletedByPid, serialVersion);
|
543
|
}
|
544
|
|
545
|
@Override
|
546
|
@Deprecated
|
547
|
public boolean setObsoletedBy(Session session, Identifier pid, Identifier obsoletedByPid, long serialVersion)
|
548
|
throws NotImplemented, NotFound,
|
549
|
NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
|
550
|
VersionMismatch {
|
551
|
return impl.setObsoletedBy(session, pid, obsoletedByPid, serialVersion);
|
552
|
|
553
|
}
|
554
|
|
555
|
@Override
|
556
|
public boolean isAuthorized(Identifier pid, Permission permission)
|
557
|
throws ServiceFailure, InvalidToken, NotFound, NotAuthorized,
|
558
|
NotImplemented, InvalidRequest {
|
559
|
return impl.isAuthorized(null, pid, permission);
|
560
|
}
|
561
|
|
562
|
@Override
|
563
|
@Deprecated
|
564
|
public boolean isAuthorized(Session session, Identifier pid, Permission permission)
|
565
|
throws ServiceFailure, InvalidToken, NotFound, NotAuthorized,
|
566
|
NotImplemented, InvalidRequest {
|
567
|
return impl.isAuthorized(session, pid, permission);
|
568
|
}
|
569
|
|
570
|
@Override
|
571
|
public boolean setAccessPolicy(Identifier pid,
|
572
|
AccessPolicy accessPolicy, long serialVersion)
|
573
|
throws InvalidToken, NotFound, NotImplemented, NotAuthorized,
|
574
|
ServiceFailure, InvalidRequest, VersionMismatch {
|
575
|
return impl.setAccessPolicy(null, pid, accessPolicy, serialVersion);
|
576
|
}
|
577
|
|
578
|
@Override
|
579
|
@Deprecated
|
580
|
public boolean setAccessPolicy(Session session, Identifier pid,
|
581
|
AccessPolicy accessPolicy, long serialVersion) throws InvalidToken, NotFound,
|
582
|
NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest,
|
583
|
VersionMismatch {
|
584
|
return impl.setAccessPolicy(session, pid, accessPolicy, serialVersion);
|
585
|
}
|
586
|
|
587
|
@Override
|
588
|
public Identifier setRightsHolder(Identifier pid, Subject userId, long serialVersion)
|
589
|
throws InvalidToken, ServiceFailure, NotFound, NotAuthorized,
|
590
|
NotImplemented, InvalidRequest, VersionMismatch {
|
591
|
return impl.setRightsHolder(null, pid, userId, serialVersion);
|
592
|
}
|
593
|
|
594
|
@Override
|
595
|
@Deprecated
|
596
|
public Identifier setRightsHolder(Session session, Identifier pid,
|
597
|
Subject userId, long serialVersion) throws InvalidToken, ServiceFailure,
|
598
|
NotFound, NotAuthorized, NotImplemented, InvalidRequest,
|
599
|
VersionMismatch {
|
600
|
return impl.setRightsHolder(session, pid, userId, serialVersion);
|
601
|
|
602
|
}
|
603
|
|
604
|
}
|