Project

General

Profile

« Previous | Next » 

Revision 9065

Added by Jing Tao almost 10 years ago

Add the code to handle if a identifier is a sid in setAccessPolicy, setReplicationPolicy, setObsoletedBy and setRreplicationStatus.

View differences:

src/edu/ucsb/nceas/metacat/dataone/v1/CNodeService.java
146 146
			ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
147 147
			NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
148 148
			VersionMismatch {
149
	    String serviceFailure = "4882";
150
        String notFound = "4884";
151
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
152
                "No object could be found for given PID: "+pid.getValue());
149 153
		return impl.setReplicationPolicy(null, pid, policy, serialVersion);
150 154
	}
151 155

  
......
155 159
			ReplicationPolicy policy, long serialVersion) throws NotImplemented, NotFound,
156 160
			NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
157 161
			VersionMismatch {
162
	    String serviceFailure = "4882";
163
        String notFound = "4884";
164
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
165
                "No object could be found for given PID: "+pid.getValue());
158 166
		return impl.setReplicationPolicy(session, pid, policy, serialVersion);
159 167

  
160 168
	}
......
163 171
	public boolean setReplicationStatus(Identifier pid,
164 172
			NodeReference targetNode, ReplicationStatus status, BaseException failure) 
165 173
			throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized, InvalidRequest, NotFound {
174
	    String serviceFailure = "4700";
175
        String notFound = "4740";
176
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
177
                "No object could be found for given PID: "+pid.getValue());
166 178
		return impl.setReplicationStatus(null, pid, targetNode, status, failure);
167 179
	}
168 180

  
......
172 184
			NodeReference targetNode, ReplicationStatus status, BaseException failure)
173 185
			throws ServiceFailure, NotImplemented, InvalidToken, NotAuthorized,
174 186
			InvalidRequest, NotFound {
187
	    String serviceFailure = "4700";
188
        String notFound = "4740";
189
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
190
                "No object could be found for given PID: "+pid.getValue());
175 191
		return impl.setReplicationStatus(session, pid, targetNode, status, failure);
176 192
	}
177 193

  
......
582 598
	public boolean setObsoletedBy(Identifier pid, Identifier obsoletedByPid, long serialVersion)
583 599
			throws NotImplemented, NotFound, NotAuthorized, ServiceFailure,
584 600
			InvalidRequest, InvalidToken, VersionMismatch {
601
	    String serviceFailure = "4941";
602
        String notFound = "4944";
603
        impl.checkV1SystemMetaPidExist(obsoletedByPid, serviceFailure, "The object for given PID "+obsoletedByPid.getValue()+" couldn't be identified if it exists",  notFound, 
604
                "No object could be found for given PID: "+obsoletedByPid.getValue());
585 605
		return impl.setObsoletedBy(null, pid, obsoletedByPid, serialVersion);
586 606
	}
587 607

  
......
591 611
			throws NotImplemented, NotFound,
592 612
			NotAuthorized, ServiceFailure, InvalidRequest, InvalidToken,
593 613
			VersionMismatch {
614
	    String serviceFailure = "4941";
615
        String notFound = "4944";
616
        impl.checkV1SystemMetaPidExist(obsoletedByPid, serviceFailure, "The object for given PID "+obsoletedByPid.getValue()+" couldn't be identified if it exists",  notFound, 
617
                "No object could be found for given PID: "+obsoletedByPid.getValue());
594 618
		return impl.setObsoletedBy(session, pid, obsoletedByPid, serialVersion);
595 619

  
596 620
	}
......
623 647
			AccessPolicy accessPolicy, long serialVersion)
624 648
			throws InvalidToken, NotFound, NotImplemented, NotAuthorized,
625 649
			ServiceFailure, InvalidRequest, VersionMismatch {
650
	    String serviceFailure = "4430";
651
        String notFound = "4400";
652
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
653
                "No object could be found for given PID: "+pid.getValue());
626 654
		return impl.setAccessPolicy(null, pid, accessPolicy, serialVersion);
627 655
	}
628 656

  
......
632 660
			AccessPolicy accessPolicy, long serialVersion) throws InvalidToken, NotFound,
633 661
			NotImplemented, NotAuthorized, ServiceFailure, InvalidRequest,
634 662
			VersionMismatch {
663
	    String serviceFailure = "4430";
664
        String notFound = "4400";
665
        impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
666
                "No object could be found for given PID: "+pid.getValue());
635 667
		return impl.setAccessPolicy(session, pid, accessPolicy, serialVersion);
636 668
	}
637 669

  

Also available in: Unified diff