Revision 6454
Added by ben leinfelder about 13 years ago
src/edu/ucsb/nceas/metacat/IdentifierManager.java | ||
---|---|---|
424 | 424 |
NodeReference node = new NodeReference(); |
425 | 425 |
node.setValue(memberNode); |
426 | 426 |
replica.setReplicaMemberNode(node); |
427 |
replica.setReplicationStatus(ReplicationStatus.convert(status));
|
|
427 |
replica.setReplicationStatus(ReplicationStatus.valueOf(status));
|
|
428 | 428 |
replica.setReplicaVerified(new Date(verified.getTime())); |
429 | 429 |
replicas.add(replica); |
430 | 430 |
} |
... | ... | |
790 | 790 |
// try system metadata only |
791 | 791 |
try { |
792 | 792 |
idExists = systemMetadataExists(guid); |
793 |
} catch (McdbDocNotFoundException e2) {
|
|
793 |
} catch (Exception e2) { |
|
794 | 794 |
idExists = false; |
795 | 795 |
} |
796 | 796 |
} |
... | ... | |
905 | 905 |
return guid; |
906 | 906 |
} |
907 | 907 |
|
908 |
public boolean systemMetadataExists(String guid) |
|
909 |
throws McdbDocNotFoundException { |
|
908 |
public boolean systemMetadataExists(String guid) { |
|
910 | 909 |
logMetacat.debug("looking up system metadata for guid " + guid); |
911 | 910 |
boolean exists = false; |
912 | 911 |
String query = "select guid from systemmetadata where guid = ?"; |
... | ... | |
924 | 923 |
ResultSet rs = stmt.executeQuery(); |
925 | 924 |
if (rs.next()) { |
926 | 925 |
exists = true; |
927 |
} else { |
|
928 |
throw new McdbDocNotFoundException( |
|
929 |
"No system metadata registered for guid " + guid); |
|
930 | 926 |
} |
931 | 927 |
|
932 | 928 |
} catch (SQLException e) { |
Also available in: Unified diff
do not throw exception when checking for system metadata - boolean return is good.
use ReplicationStatus.valueOf() instead of convert()