Project

General

Profile

« Previous | Next » 

Revision 6574

Modify isAuthorized() to get the most up to date system metadata from the hzSystemMetadata map.

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
585 585
    String pidStr = pid.getValue();
586 586
    SystemMetadata systemMetadata = null;
587 587
    try {
588
      systemMetadata = IdentifierManager.getInstance().getSystemMetadata(pidStr);
589
    } catch (McdbDocNotFoundException e) {
590
      throw new NotFound("1800", "No record found for " + pidStr);
588
        HazelcastService.getInstance().getSystemMetadataMap().lock(pid);
589
        systemMetadata = HazelcastService.getInstance().getSystemMetadataMap().get(pid);
590
        HazelcastService.getInstance().getSystemMetadataMap().unlock(pid);
591

  
592
    } catch (Exception e) {
593
        // convert Hazelcast RuntimeException to NotFound
594
        logMetacat.error("An error occurred while getting system metadata for identifier " +
595
            pid.getValue() + ". The error message was: " + e.getMessage());
596
        throw new NotFound("1800", "No record found for " + pidStr);
597
        
598
    } finally {
599
        HazelcastService.getInstance().getSystemMetadataMap().unlock(pid);
600
        
591 601
    }
592 602
	    
593 603
    // do we own it?

Also available in: Unified diff