Project

General

Profile

« Previous | Next » 

Revision 6817

Get the object inputstream from the local metacat instance using MetacatHandler.get() rather than MN.getReplica() so we don't throw an InvalidToken exception when passing in a null Session. The D1Client object is never used for this local call.

View differences:

src/edu/ucsb/nceas/metacat/dataone/MNodeService.java
93 93
import edu.ucsb.nceas.metacat.EventLog;
94 94
import edu.ucsb.nceas.metacat.IdentifierManager;
95 95
import edu.ucsb.nceas.metacat.McdbDocNotFoundException;
96
import edu.ucsb.nceas.metacat.McdbException;
96 97
import edu.ucsb.nceas.metacat.MetacatHandler;
97 98
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
98 99
import edu.ucsb.nceas.metacat.database.DBConnection;
......
101 102
import edu.ucsb.nceas.metacat.properties.PropertyService;
102 103
import edu.ucsb.nceas.metacat.shared.ServiceException;
103 104
import edu.ucsb.nceas.metacat.util.SystemUtil;
105
import edu.ucsb.nceas.utilities.ParseLSIDException;
104 106
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
105 107

  
106 108
/**
......
491 493
            try {
492 494
                localSystemMetadata = 
493 495
                    HazelcastService.getInstance().getSystemMetadataMap().get(pid);
494
                object = getReplica(thisNodeSession, pid);
495
                
496
                String localId = IdentifierManager.getInstance().getLocalId(sysmeta.getIdentifier().getValue());
497
                object = MetacatHandler.read(localId);
498

  
496 499
            } catch (RuntimeException e) {
497 500
                String msg = "An error occurred getting system metadata for " +
498 501
                    pid.getValue();
......
501 504
                logMetacat.error(msg);
502 505
                return true;
503 506

  
507
            } catch (McdbDocNotFoundException e) {
508
                // TODO Auto-generated catch block
509
                e.printStackTrace();
510
                
511
            } catch (PropertyNotFoundException e) {
512
                // TODO Auto-generated catch block
513
                e.printStackTrace();
514
                
515
            } catch (ParseLSIDException e) {
516
                // TODO Auto-generated catch block
517
                e.printStackTrace();
518
                
519
            } catch (McdbException e) {
520
                // TODO Auto-generated catch block
521
                e.printStackTrace();
522
                
523
            } catch (SQLException e) {
524
                // TODO Auto-generated catch block
525
                e.printStackTrace();
526
            } catch (ClassNotFoundException e) {
527
                // TODO Auto-generated catch block
528
                e.printStackTrace();
529
            } catch (IOException e) {
530
                // TODO Auto-generated catch block
531
                e.printStackTrace();
504 532
            }
505 533

  
506 534
            // no local replica, get a replica

Also available in: Unified diff