Project

General

Profile

« Previous | Next » 

Revision 9077

Added by Jing Tao over 9 years ago

Add the code to handle sid in the publish method.

View differences:

src/edu/ucsb/nceas/metacat/dataone/v1/MNodeService.java
542 542
	
543 543
	public Identifier publish(Session session, Identifier originalIdentifier) 
544 544
			throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented, InvalidRequest, NotFound, IdentifierNotUnique, UnsupportedType, InsufficientResources, InvalidSystemMetadata {
545
	    String serviceFailure = "1030";
546
        String notFound = "1020";
547
        impl.checkV1SystemMetaPidExist(originalIdentifier, serviceFailure, "The system metadata of the object specified by "+originalIdentifier.getValue()+" couldn't be identified if it exists",  notFound, 
548
                    "The system metadata of the object specified by "+originalIdentifier.getValue()+" does not exist at this node.");
545 549
		return impl.publish(session, originalIdentifier);
546 550
		
547 551
	}
......
551 555
			NotImplemented, NotFound {
552 556
	    String serviceFailure = "2831";
553 557
        String notFound = "2835";
554
        try {
555
            impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
558
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
556 559
                    "The system metadata of the object specified by "+pid.getValue()+" does not exist at this node.");
557
        } catch (NotFound e) {
558
            throw new ServiceFailure(serviceFailure, e.getMessage());
559
        }
560
       
560 561
		return impl.view(session, format, pid);
561 562
	}
562 563
	
......
565 566
			NotAuthorized, InvalidRequest, NotImplemented, NotFound {
566 567
	    String serviceFailure = "2871";
567 568
        String notFound = "2875";
568
        try {
569
            impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
569
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
570 570
                    "The system metadata of the object specified by "+pid.getValue()+" does not exist at this node.");
571
        } catch (NotFound e) {
572
            throw new ServiceFailure(serviceFailure, e.getMessage());
573
        }
571
        
574 572
		return impl.getPackage(session, formatId, pid);
575 573
	}
576 574
	

Also available in: Unified diff