Revision 6397
Added by ben leinfelder over 13 years ago
test/edu/ucsb/nceas/metacat/dataone/CNodeServiceTest.java | ||
---|---|---|
116 | 116 |
Identifier guid = new Identifier(); |
117 | 117 |
guid.setValue("testRegisterSystemMetadata." + System.currentTimeMillis()); |
118 | 118 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
119 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
120 |
assertTrue(result);
|
|
119 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
120 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
121 | 121 |
} catch(Exception e) { |
122 | 122 |
fail("Unexpected error: " + e.getMessage()); |
123 | 123 |
} |
... | ... | |
134 | 134 |
Identifier guid = new Identifier(); |
135 | 135 |
guid.setValue("testGetSystemMetadata." + System.currentTimeMillis()); |
136 | 136 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
137 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
138 |
assertTrue(result);
|
|
137 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
138 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
139 | 139 |
// get it |
140 | 140 |
SystemMetadata retSysmeta = CNodeService.getInstance().getSystemMetadata(session, guid); |
141 | 141 |
// check it |
... | ... | |
196 | 196 |
InputStream object = new ByteArrayInputStream("test".getBytes("UTF-8")); |
197 | 197 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), object); |
198 | 198 |
Identifier pid = CNodeService.getInstance().create(session, guid, object, sysmeta); |
199 |
assertEquals(guid, pid);
|
|
199 |
assertEquals(guid.getValue(), pid.getValue());
|
|
200 | 200 |
// get it |
201 | 201 |
InputStream retObject = CNodeService.getInstance().get(session, pid); |
202 | 202 |
// check it |
... | ... | |
220 | 220 |
describePid.setValue("describePid." + System.currentTimeMillis()); |
221 | 221 |
//sysmeta.addDescribe(describePid); |
222 | 222 |
// save it |
223 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
224 |
assertTrue(result);
|
|
223 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
224 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
225 | 225 |
// save the other |
226 | 226 |
SystemMetadata describeSysmeta = createSystemMetadata(describePid, session.getSubject(), null); |
227 |
result = CNodeService.getInstance().registerSystemMetadata(session, describePid, describeSysmeta);
|
|
228 |
assertTrue(result);
|
|
227 |
Identifier retDescribePid = CNodeService.getInstance().registerSystemMetadata(session, describePid, describeSysmeta);
|
|
228 |
assertEquals(describePid.getValue(), retDescribePid.getValue());
|
|
229 | 229 |
// check it |
230 |
result = CNodeService.getInstance().assertRelation(session, guid, "describes", describePid); |
|
230 |
boolean result = CNodeService.getInstance().assertRelation(session, guid, "describes", describePid);
|
|
231 | 231 |
assertTrue(result); |
232 | 232 |
} catch(Exception e) { |
233 | 233 |
e.printStackTrace(); |
... | ... | |
244 | 244 |
guid.setValue("testChecksum." + System.currentTimeMillis()); |
245 | 245 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
246 | 246 |
// save it |
247 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
248 |
assertTrue(result);
|
|
247 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
248 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
249 | 249 |
// check it |
250 | 250 |
Checksum checksum = CNodeService.getInstance().getChecksum(session, guid); |
251 | 251 |
assertEquals(sysmeta.getChecksum().getValue(), checksum.getValue()); |
... | ... | |
296 | 296 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
297 | 297 |
|
298 | 298 |
// save it |
299 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
300 |
assertTrue(result);
|
|
299 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
300 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
301 | 301 |
// search for it |
302 | 302 |
ObjectList objectList = CNodeService.getInstance().search(session, null, null); |
303 | 303 |
// check it |
304 | 304 |
assertNotNull(objectList); |
305 |
result = false; |
|
305 |
boolean result = false;
|
|
306 | 306 |
for (ObjectInfo objectInfo: objectList.getObjectInfoList()) { |
307 | 307 |
Identifier pid = objectInfo.getIdentifier(); |
308 | 308 |
if (pid.getValue().equals(guid.getValue())) { |
... | ... | |
325 | 325 |
guid.setValue("testSetOwner." + System.currentTimeMillis()); |
326 | 326 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
327 | 327 |
// save it |
328 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
329 |
assertTrue(result);
|
|
328 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
329 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
330 | 330 |
Subject rightsHolder = new Subject(); |
331 | 331 |
rightsHolder.setValue("newUser"); |
332 | 332 |
// set it |
... | ... | |
352 | 352 |
guid.setValue("testSetAccessPolicy." + System.currentTimeMillis()); |
353 | 353 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
354 | 354 |
// save it |
355 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
356 |
assertTrue(result);
|
|
355 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
356 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
357 | 357 |
AccessPolicy accessPolicy = new AccessPolicy(); |
358 | 358 |
AccessRule accessRule = new AccessRule(); |
359 | 359 |
accessRule.addPermission(Permission.WRITE); |
... | ... | |
362 | 362 |
accessRule.addSubject(publicSubject); |
363 | 363 |
accessPolicy.addAllow(accessRule); |
364 | 364 |
// set it |
365 |
result = CNodeService.getInstance().setAccessPolicy(session, guid, accessPolicy ); |
|
365 |
boolean result = CNodeService.getInstance().setAccessPolicy(session, guid, accessPolicy );
|
|
366 | 366 |
assertTrue(result); |
367 | 367 |
// check it |
368 | 368 |
result = CNodeService.getInstance().isAuthorized(session, guid, Permission.WRITE); |
... | ... | |
381 | 381 |
guid.setValue("testIsAuthorized." + System.currentTimeMillis()); |
382 | 382 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
383 | 383 |
// save it |
384 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
385 |
assertTrue(result);
|
|
384 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
385 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
386 | 386 |
// check it |
387 | 387 |
Subject publicSubject = new Subject(); |
388 | 388 |
publicSubject.setValue(Constants.PUBLIC_SUBJECT); |
389 | 389 |
session.setSubject(publicSubject); |
390 | 390 |
// public read |
391 |
result = CNodeService.getInstance().isAuthorized(session, guid, Permission.READ); |
|
391 |
boolean result = CNodeService.getInstance().isAuthorized(session, guid, Permission.READ);
|
|
392 | 392 |
assertTrue(result); |
393 | 393 |
// not public write |
394 | 394 |
try { |
... | ... | |
413 | 413 |
guid.setValue("testReplicationPolicy." + System.currentTimeMillis()); |
414 | 414 |
SystemMetadata sysmeta = createSystemMetadata(guid, session.getSubject(), null); |
415 | 415 |
// save it |
416 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
417 |
assertTrue(result);
|
|
416 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
417 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
418 | 418 |
|
419 | 419 |
ReplicationPolicy policy = new ReplicationPolicy(); |
420 | 420 |
NodeReference node = new NodeReference(); |
421 | 421 |
node.setValue("testNode"); |
422 | 422 |
policy.addPreferredMemberNode(node ); |
423 | 423 |
// set it |
424 |
result = CNodeService.getInstance().setReplicationPolicy(session, guid, policy); |
|
424 |
boolean result = CNodeService.getInstance().setReplicationPolicy(session, guid, policy);
|
|
425 | 425 |
assertTrue(result); |
426 | 426 |
// get it |
427 | 427 |
sysmeta = CNodeService.getInstance().getSystemMetadata(session, guid); |
... | ... | |
450 | 450 |
replica.setReplicaVerified(new Date()); |
451 | 451 |
sysmeta.addReplica(replica ); |
452 | 452 |
// save it |
453 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
454 |
assertTrue(result);
|
|
453 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, sysmeta);
|
|
454 |
assertEquals(guid.getValue(), retGuid.getValue());
|
|
455 | 455 |
// set it |
456 | 456 |
ReplicationStatus status = ReplicationStatus.COMPLETED; |
457 |
result = CNodeService.getInstance().setReplicationStatus(session, guid, status); |
|
457 |
boolean result = CNodeService.getInstance().setReplicationStatus(session, guid, status);
|
|
458 | 458 |
assertTrue(result); |
459 | 459 |
// get it |
460 | 460 |
sysmeta = CNodeService.getInstance().getSystemMetadata(session, guid); |
test/edu/ucsb/nceas/metacat/dataone/D1NodeServiceTest.java | ||
---|---|---|
43 | 43 |
import org.dataone.service.types.v1.AccessPolicy; |
44 | 44 |
import org.dataone.service.types.v1.AccessRule; |
45 | 45 |
import org.dataone.service.types.v1.Checksum; |
46 |
import org.dataone.service.types.v1.ChecksumAlgorithm; |
|
47 | 46 |
import org.dataone.service.types.v1.Identifier; |
48 | 47 |
import org.dataone.service.types.v1.NodeReference; |
49 | 48 |
import org.dataone.service.types.v1.ObjectFormatList; |
... | ... | |
154 | 153 |
if (object != null) { |
155 | 154 |
checksumS = checksum(object); |
156 | 155 |
} |
157 |
ChecksumAlgorithm ca = ChecksumAlgorithm.convert("MD5");
|
|
156 |
String ca = "MD5";
|
|
158 | 157 |
Checksum checksum = new Checksum(); |
159 | 158 |
checksum.setValue(checksumS); |
160 | 159 |
checksum.setAlgorithm(ca); |
src/edu/ucsb/nceas/metacat/restservice/MNResourceHandler.java | ||
---|---|---|
569 | 569 |
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SZ"); |
570 | 570 |
response.addHeader("pid", pid); |
571 | 571 |
response.addHeader("checksum", dr.getDataONE_Checksum().getValue()); |
572 |
response.addHeader("checksum_algorithm", dr.getDataONE_Checksum().getAlgorithm().xmlValue());
|
|
572 |
response.addHeader("checksum_algorithm", dr.getDataONE_Checksum().getAlgorithm()); |
|
573 | 573 |
response.addHeader("content_length", dr.getContent_Length() + ""); |
574 | 574 |
response.addHeader("last_modified", dateFormat.format(dr.getLast_Modified())); |
575 | 575 |
response.addHeader("format", dr.getDataONE_ObjectFormatIdentifier().getValue()); |
src/edu/ucsb/nceas/metacat/restservice/ResourceHandler.java | ||
---|---|---|
824 | 824 |
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SZ"); |
825 | 825 |
response.addHeader("guid", guid); |
826 | 826 |
response.addHeader("checksum", dr.getDataONE_Checksum().getValue()); |
827 |
response.addHeader("checksum_algorithm", dr.getDataONE_Checksum().getAlgorithm().xmlValue());
|
|
827 |
response.addHeader("checksum_algorithm", dr.getDataONE_Checksum().getAlgorithm()); |
|
828 | 828 |
response.addHeader("content_length", dr.getContent_Length() + ""); |
829 | 829 |
response.addHeader("last_modified", dateFormat.format(dr.getLast_Modified())); |
830 | 830 |
response.addHeader("format", dr.getDataONE_ObjectFormatIdentifier().getValue()); |
... | ... | |
2138 | 2138 |
guid.setValue(pid); |
2139 | 2139 |
logMetacat.debug("registering system metadata with pid " |
2140 | 2140 |
+ guid.getValue()); |
2141 |
boolean result = CNodeService.getInstance().registerSystemMetadata(
|
|
2141 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(
|
|
2142 | 2142 |
session, guid, systemMetadata); |
2143 |
TypeMarshaller.marshalTypeToOutputStream(result, out);
|
|
2143 |
TypeMarshaller.marshalTypeToOutputStream(retGuid, out);
|
|
2144 | 2144 |
|
2145 | 2145 |
} catch (NotAuthorized e) { |
2146 | 2146 |
response.setStatus(500); |
src/edu/ucsb/nceas/metacat/restservice/CNResourceHandler.java | ||
---|---|---|
60 | 60 |
import org.dataone.service.types.v1.ObjectFormatList; |
61 | 61 |
import org.dataone.service.types.v1.ObjectLocationList; |
62 | 62 |
import org.dataone.service.types.v1.Permission; |
63 |
import org.dataone.service.types.v1.QueryType; |
|
64 | 63 |
import org.dataone.service.types.v1.Subject; |
65 | 64 |
import org.dataone.service.types.v1.SystemMetadata; |
66 | 65 |
import org.dataone.service.util.TypeMarshaller; |
... | ... | |
758 | 757 |
* @throws IllegalAccessException |
759 | 758 |
* @throws InstantiationException |
760 | 759 |
*/ |
761 |
protected boolean registerSystemMetadata(String pid) throws ServiceFailure, InvalidRequest, IOException, FileUploadException, JiBXException, NotImplemented, NotAuthorized, InvalidSystemMetadata, InstantiationException, IllegalAccessException {
|
|
760 |
protected Identifier registerSystemMetadata(String pid) throws ServiceFailure, InvalidRequest, IOException, FileUploadException, JiBXException, NotImplemented, NotAuthorized, InvalidSystemMetadata, InstantiationException, IllegalAccessException {
|
|
762 | 761 |
logMetacat.debug("Entering registerSystemMetadata: " + pid); |
763 | 762 |
|
764 | 763 |
// get the system metadata from the request |
... | ... | |
767 | 766 |
Identifier guid = new Identifier(); |
768 | 767 |
guid.setValue(pid); |
769 | 768 |
logMetacat.debug("registering system metadata with pid " + guid.getValue()); |
770 |
boolean result = CNodeService.getInstance().registerSystemMetadata(session, guid, systemMetadata);
|
|
769 |
Identifier retGuid = CNodeService.getInstance().registerSystemMetadata(session, guid, systemMetadata);
|
|
771 | 770 |
|
772 | 771 |
response.setStatus(200); |
773 | 772 |
response.setContentType("text/xml"); |
774 |
return result;
|
|
773 |
return retGuid;
|
|
775 | 774 |
|
776 | 775 |
} |
777 | 776 |
|
... | ... | |
812 | 811 |
private void query() throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, NotImplemented { |
813 | 812 |
|
814 | 813 |
String query = null; |
815 |
QueryType queryType = null;
|
|
814 |
String queryType = null;
|
|
816 | 815 |
try { |
817 | 816 |
query = params.get("query")[0]; |
818 | 817 |
} catch (Exception e) { |
... | ... | |
820 | 819 |
} |
821 | 820 |
try { |
822 | 821 |
String qt = params.get("queryType")[0]; |
823 |
queryType = QueryType.valueOf(qt);
|
|
822 |
queryType = qt;
|
|
824 | 823 |
} catch (Exception e) { |
825 | 824 |
logMetacat.warn("queryType not specified"); |
826 | 825 |
} |
src/edu/ucsb/nceas/metacat/MetacatHandler.java | ||
---|---|---|
78 | 78 |
import org.dataone.service.exceptions.BaseException; |
79 | 79 |
import org.dataone.service.exceptions.NotFound; |
80 | 80 |
import org.dataone.service.types.v1.Checksum; |
81 |
import org.dataone.service.types.v1.ChecksumAlgorithm; |
|
82 | 81 |
import org.dataone.service.types.v1.Identifier; |
83 | 82 |
import org.dataone.service.types.v1.NodeReference; |
84 |
import org.dataone.service.types.v1.ObjectFormat; |
|
85 | 83 |
import org.dataone.service.types.v1.ObjectFormatIdentifier; |
86 | 84 |
import org.dataone.service.types.v1.Subject; |
87 | 85 |
import org.dataone.service.types.v1.SystemMetadata; |
... | ... | |
3739 | 3737 |
|
3740 | 3738 |
//create the checksum |
3741 | 3739 |
inputStream = this.read(localId); |
3742 |
ChecksumAlgorithm algorithm = ChecksumAlgorithm.convert("MD5");
|
|
3740 |
String algorithm = "MD5";
|
|
3743 | 3741 |
Checksum checksum = ChecksumUtil.checksum(inputStream, algorithm); |
3744 | 3742 |
sysMeta.setChecksum(checksum); |
3745 | 3743 |
|
src/edu/ucsb/nceas/metacat/util/MetacatPopulator.java | ||
---|---|---|
50 | 50 |
import org.dataone.service.types.v1.AccessPolicy; |
51 | 51 |
import org.dataone.service.types.v1.AccessRule; |
52 | 52 |
import org.dataone.service.types.v1.Checksum; |
53 |
import org.dataone.service.types.v1.ChecksumAlgorithm; |
|
54 | 53 |
import org.dataone.service.types.v1.Identifier; |
55 | 54 |
import org.dataone.service.types.v1.NodeReference; |
56 | 55 |
import org.dataone.service.types.v1.ObjectFormat; |
... | ... | |
210 | 209 |
dataDocSysMeta.setFmtid(format.getFmtid()); |
211 | 210 |
Checksum checksum = new Checksum(); |
212 | 211 |
dataDocIs = stringToStream(dataDocText); |
213 |
ChecksumAlgorithm ca = ChecksumAlgorithm.convert("MD5");
|
|
212 |
String ca = "MD5";
|
|
214 | 213 |
checksum.setAlgorithm(ca); |
215 | 214 |
checksum.setValue(checksum(dataDocIs)); |
216 | 215 |
dataDocSysMeta.setChecksum(checksum); |
... | ... | |
321 | 320 |
//create the checksum |
322 | 321 |
ByteArrayInputStream bais = new ByteArrayInputStream(doc.doctext.getBytes(MetaCatServlet.DEFAULT_ENCODING)); |
323 | 322 |
String checksumS = checksum(bais); |
324 |
ChecksumAlgorithm ca = ChecksumAlgorithm.convert("MD5");
|
|
323 |
String ca = "MD5";
|
|
325 | 324 |
Checksum checksum = new Checksum(); |
326 | 325 |
checksum.setValue(checksumS); |
327 | 326 |
checksum.setAlgorithm(ca); |
src/edu/ucsb/nceas/metacat/dataone/MNodeService.java | ||
---|---|---|
54 | 54 |
import org.dataone.service.mn.tier3.v1.MNStorage; |
55 | 55 |
import org.dataone.service.mn.tier4.v1.MNReplication; |
56 | 56 |
import org.dataone.service.types.v1.Checksum; |
57 |
import org.dataone.service.types.v1.ChecksumAlgorithm; |
|
58 | 57 |
import org.dataone.service.types.v1.DescribeResponse; |
59 | 58 |
import org.dataone.service.types.v1.Event; |
60 | 59 |
import org.dataone.service.types.v1.Group; |
... | ... | |
64 | 63 |
import org.dataone.service.types.v1.MonitorInfo; |
65 | 64 |
import org.dataone.service.types.v1.MonitorList; |
66 | 65 |
import org.dataone.service.types.v1.Node; |
67 |
import org.dataone.service.types.v1.NodeHealth; |
|
68 | 66 |
import org.dataone.service.types.v1.NodeReference; |
69 | 67 |
import org.dataone.service.types.v1.NodeState; |
70 | 68 |
import org.dataone.service.types.v1.NodeType; |
... | ... | |
76 | 74 |
import org.dataone.service.types.v1.Service; |
77 | 75 |
import org.dataone.service.types.v1.Services; |
78 | 76 |
import org.dataone.service.types.v1.Session; |
79 |
import org.dataone.service.types.v1.Status; |
|
80 | 77 |
import org.dataone.service.types.v1.Subject; |
81 | 78 |
import org.dataone.service.types.v1.Synchronization; |
82 | 79 |
import org.dataone.service.types.v1.SystemMetadata; |
... | ... | |
555 | 552 |
|
556 | 553 |
try { |
557 | 554 |
checksum = |
558 |
ChecksumUtil.checksum(inputStream, ChecksumAlgorithm.convert(algorithm));
|
|
555 |
ChecksumUtil.checksum(inputStream, algorithm);
|
|
559 | 556 |
|
560 | 557 |
} catch (NoSuchAlgorithmException e) { |
561 | 558 |
throw new ServiceFailure("1410", "The checksum for the object specified by " + |
... | ... | |
733 | 730 |
node.setDescription(nodeDesc); |
734 | 731 |
|
735 | 732 |
// set the node's health information |
736 |
NodeHealth health = new NodeHealth(); |
|
737 | 733 |
NodeState state = NodeState.UP; |
738 |
health.setState(state);
|
|
734 |
node.setState(state);
|
|
739 | 735 |
// set the ping response to the current value |
740 | 736 |
Ping canPing = new Ping(); |
741 | 737 |
canPing.setSuccess(false); |
... | ... | |
748 | 744 |
e.printStackTrace(); |
749 | 745 |
|
750 | 746 |
} |
751 |
health.setPing(canPing); |
|
752 |
// TODO: getStatus() should be consulted here when it's implemented |
|
753 |
Status nodeStatus = new Status(); |
|
754 |
nodeStatus.setSuccess(true); |
|
755 |
nodeStatus.setDateChecked(new Date()); |
|
756 |
health.setStatus(nodeStatus); |
|
757 |
node.setHealth(health); |
|
747 |
node.setPing(canPing); |
|
758 | 748 |
|
759 | 749 |
NodeReference identifier = new NodeReference(); |
760 | 750 |
identifier.setValue(nodeId); |
src/edu/ucsb/nceas/metacat/dataone/CNodeService.java | ||
---|---|---|
49 | 49 |
import org.dataone.service.types.v1.ObjectList; |
50 | 50 |
import org.dataone.service.types.v1.ObjectLocationList; |
51 | 51 |
import org.dataone.service.types.v1.Permission; |
52 |
import org.dataone.service.types.v1.QueryType; |
|
53 | 52 |
import org.dataone.service.types.v1.Replica; |
54 | 53 |
import org.dataone.service.types.v1.ReplicationPolicy; |
55 | 54 |
import org.dataone.service.types.v1.ReplicationStatus; |
... | ... | |
351 | 350 |
* @throws NotImplemented |
352 | 351 |
*/ |
353 | 352 |
@Override |
354 |
public ObjectList search(Session session, QueryType queryType, String query)
|
|
353 |
public ObjectList search(Session session, String queryType, String query)
|
|
355 | 354 |
throws InvalidToken, ServiceFailure, NotAuthorized, InvalidRequest, |
356 | 355 |
NotImplemented { |
357 | 356 |
|
... | ... | |
500 | 499 |
* @throws InvalidSystemMetadata |
501 | 500 |
*/ |
502 | 501 |
@Override |
503 |
public boolean registerSystemMetadata(Session session, Identifier guid,
|
|
502 |
public Identifier registerSystemMetadata(Session session, Identifier guid,
|
|
504 | 503 |
SystemMetadata sysmeta) |
505 | 504 |
throws NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest, |
506 | 505 |
InvalidSystemMetadata { |
... | ... | |
543 | 542 |
|
544 | 543 |
logMetacat.debug("Returning from registerSystemMetadata"); |
545 | 544 |
EventLog.getInstance().log(null, session.getSubject().getValue(), guid.getValue(), "registerSystemMetadata"); |
546 |
return true;
|
|
545 |
return guid;
|
|
547 | 546 |
} |
548 | 547 |
|
549 | 548 |
/** |
src/edu/ucsb/nceas/metacat/IdentifierManager.java | ||
---|---|---|
41 | 41 |
import org.dataone.service.types.v1.AccessPolicy; |
42 | 42 |
import org.dataone.service.types.v1.AccessRule; |
43 | 43 |
import org.dataone.service.types.v1.Checksum; |
44 |
import org.dataone.service.types.v1.ChecksumAlgorithm; |
|
45 | 44 |
import org.dataone.service.types.v1.Identifier; |
46 | 45 |
import org.dataone.service.types.v1.NodeReference; |
47 | 46 |
import org.dataone.service.types.v1.ObjectFormat; |
... | ... | |
121 | 120 |
sysMeta.setRightsHolder(rightsHolderSubject); |
122 | 121 |
Checksum checksumObject = new Checksum(); |
123 | 122 |
checksumObject.setValue(checksum); |
124 |
checksumObject.setAlgorithm(ChecksumAlgorithm.convert(checksumAlgorithm));
|
|
123 |
checksumObject.setAlgorithm(checksumAlgorithm);
|
|
125 | 124 |
sysMeta.setChecksum(checksumObject); |
126 | 125 |
NodeReference omn = new NodeReference(); |
127 | 126 |
omn.setValue(originMemberNode); |
... | ... | |
284 | 283 |
sysMeta.setRightsHolder(rightsHolderSubject); |
285 | 284 |
Checksum checksumObject = new Checksum(); |
286 | 285 |
checksumObject.setValue(checksum); |
287 |
checksumObject.setAlgorithm(ChecksumAlgorithm.convert(checksumAlgorithm));
|
|
286 |
checksumObject.setAlgorithm(checksumAlgorithm);
|
|
288 | 287 |
sysMeta.setChecksum(checksumObject); |
289 | 288 |
NodeReference omn = new NodeReference(); |
290 | 289 |
omn.setValue(originMemberNode); |
... | ... | |
1140 | 1139 |
sm.getDateUploaded() == null ? null: sm.getDateUploaded().getTime(), |
1141 | 1140 |
sm.getRightsHolder() == null ? null: sm.getRightsHolder().getValue(), |
1142 | 1141 |
sm.getChecksum() == null ? null: sm.getChecksum().getValue(), |
1143 |
sm.getChecksum() == null ? null: sm.getChecksum().getAlgorithm().xmlValue(),
|
|
1142 |
sm.getChecksum() == null ? null: sm.getChecksum().getAlgorithm(), |
|
1144 | 1143 |
sm.getOriginMemberNode() == null ? null: sm.getOriginMemberNode().getValue(), |
1145 | 1144 |
sm.getAuthoritativeMemberNode() == null ? null: sm.getAuthoritativeMemberNode().getValue(), |
1146 | 1145 |
sm.getDateSysMetadataModified() == null ? null: sm.getDateSysMetadataModified().getTime(), |
... | ... | |
1468 | 1467 |
cs.setValue(checksum); |
1469 | 1468 |
try { |
1470 | 1469 |
//cs.setAlgorithm(ChecksumAlgorithm.valueOf(checksumAlgorithm)); |
1471 |
cs.setAlgorithm(ChecksumAlgorithm.convert(checksumAlgorithm));
|
|
1470 |
cs.setAlgorithm(checksumAlgorithm);
|
|
1472 | 1471 |
} catch (Exception e) { |
1473 | 1472 |
logMetacat.warn("could not parse checksum algorithm", e); |
1474 | 1473 |
} |
Also available in: Unified diff
changes for schema update (d1_common)