Project

General

Profile

« Previous | Next » 

Revision 9051

Added by Jing Tao over 9 years ago

Add the code to support the sereis id on isAuthorized and systemMetadataChanged method.

View differences:

MNodeService.java
463 463
	public boolean isAuthorized(Identifier pid, Permission permission)
464 464
			throws ServiceFailure, InvalidRequest, InvalidToken, NotFound,
465 465
			NotAuthorized, NotImplemented {
466
	    String serviceFailure = "1760";
467
        String notFound = "1800";
468
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
469
                "The object specified by "+pid.getValue()+" does not exist at this node.");
466 470
		return impl.isAuthorized(null, pid, permission);
467 471
	}
468 472

  
......
471 475
	public boolean isAuthorized(Session session, Identifier pid, Permission permission)
472 476
			throws ServiceFailure, InvalidRequest, InvalidToken, NotFound,
473 477
			NotAuthorized, NotImplemented {
478
	    String serviceFailure = "1760";
479
        String notFound = "1800";
480
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
481
                "The object specified by "+pid.getValue()+" does not exist at this node.");
474 482
		return impl.isAuthorized(session, pid, permission);
475 483
	}
476 484

  
......
478 486
	public boolean systemMetadataChanged(Identifier pid, long serialVersion, Date dateSysMetaLastModified)
479 487
			throws InvalidToken, ServiceFailure, NotAuthorized, NotImplemented,
480 488
			InvalidRequest {
489
	    String serviceFailure = "1333";
490
        String notFound = "1800";
491
        try {
492
            impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
493
                    "The system metadata of the object specified by "+pid.getValue()+" does not exist at this node.");
494
        } catch (NotFound e) {
495
            throw new ServiceFailure(serviceFailure, e.getMessage());
496
        }
481 497
		return impl.systemMetadataChanged(null, pid, serialVersion, dateSysMetaLastModified);
482 498

  
483 499
	}
......
487 503
	public boolean systemMetadataChanged(Session session, Identifier pid,
488 504
			long serialVersion, Date dateSysMetaLastModified) throws InvalidToken, ServiceFailure,
489 505
			NotAuthorized, NotImplemented, InvalidRequest {
506
	    String serviceFailure = "1333";
507
        String notFound = "1800";
508
        try {
509
            impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The system metadata of the object specified by "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
510
                    "The system metadata of the object specified by "+pid.getValue()+" does not exist at this node.");
511
        } catch (NotFound e) {
512
            throw new ServiceFailure(serviceFailure, e.getMessage());
513
        }
490 514
		return impl.systemMetadataChanged(session, pid, serialVersion, dateSysMetaLastModified);
491 515
	}
492 516
    

Also available in: Unified diff