Revision 9325
Added by Jing Tao over 9 years ago
src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java | ||
---|---|---|
1634 | 1634 |
logMetacat.debug("the dateUploaded in the new system metadata is (by time) "+sysmeta.getDateUploaded().getTime()); |
1635 | 1635 |
if(currentSysmeta == null ) { |
1636 | 1636 |
//do we need throw an exception? |
1637 |
|
|
1637 |
logMetacat.warn("Currently there is no system metadata in this node associated with the pid "+pid.getValue()); |
|
1638 | 1638 |
} else { |
1639 | 1639 |
|
1640 | 1640 |
BigInteger newVersion = sysmeta.getSerialVersion(); |
... | ... | |
1648 | 1648 |
} |
1649 | 1649 |
Identifier currentSid = currentSysmeta.getSeriesId(); |
1650 | 1650 |
if(currentSid != null) { |
1651 |
logMetacat.debug("In the branch that the sid is not null in the current system metadata and the current sid is "+currentSid.getValue()); |
|
1651 | 1652 |
//new sid must match the current sid |
1652 | 1653 |
Identifier newSid = sysmeta.getSeriesId(); |
1653 | 1654 |
if (!isValidIdentifier(newSid)) { |
... | ... | |
1712 | 1713 |
* Check if the newMeta modifies an immutable field. |
1713 | 1714 |
*/ |
1714 | 1715 |
private void checkModifiedImmutableFields(SystemMetadata orgMeta, SystemMetadata newMeta) throws InvalidRequest{ |
1716 |
logMetacat.debug("in the start of the checkModifiedImmutableFields method"); |
|
1715 | 1717 |
if(orgMeta != null && newMeta != null) { |
1718 |
logMetacat.debug("in the checkModifiedImmutableFields method when the org and new system metadata is not null"); |
|
1716 | 1719 |
if(newMeta.getIdentifier() == null) { |
1717 | 1720 |
throw new InvalidRequest("4869", "The new version of the system metadata is invalid since the identifier is null"); |
1718 | 1721 |
} |
... | ... | |
1733 | 1736 |
throw new InvalidRequest("4869", "The request is trying to modify an immutable field in the SystemMeta: the new system meta's checksum "+newMeta.getChecksum().getValue()+" is "+ |
1734 | 1737 |
"different to the orginal one "+orgMeta.getChecksum().getValue()); |
1735 | 1738 |
} |
1739 |
if(orgMeta.getSubmitter() != null) { |
|
1740 |
logMetacat.debug("in the checkModifiedImmutableFields method and orgMeta.getSubmitter is not null and the orginal submiter is "+orgMeta.getSubmitter().getValue()); |
|
1741 |
} |
|
1742 |
|
|
1743 |
if(newMeta.getSubmitter() != null) { |
|
1744 |
logMetacat.debug("in the checkModifiedImmutableFields method and newMeta.getSubmitter is not null and the submiter in the new system metadata is "+newMeta.getSubmitter().getValue()); |
|
1745 |
} |
|
1736 | 1746 |
if(orgMeta.getSubmitter() != null && newMeta.getSubmitter() != null && !orgMeta.getSubmitter().equals(newMeta.getSubmitter())) { |
1737 | 1747 |
throw new InvalidRequest("4869", "The request is trying to modify an immutable field in the SystemMeta: the new system meta's submitter "+newMeta.getSubmitter().getValue()+" is "+ |
1738 | 1748 |
"different to the orginal one "+orgMeta.getSubmitter().getValue()); |
Also available in: Unified diff
Add more debug statement for the updateSystemMetadata method.