Project

General

Profile

« Previous | Next » 

Revision 9062

Added by Jing Tao almost 10 years ago

In the getLogRecords method, the pidFilter is checked if it exists.

View differences:

src/edu/ucsb/nceas/metacat/dataone/v1/MNodeService.java
440 440
	public Log getLogRecords(Session session, Date fromDate, Date toDate, Event event,
441 441
			String pidFilter, Integer start, Integer count) throws InvalidRequest, InvalidToken,
442 442
			NotAuthorized, NotImplemented, ServiceFailure {
443
	    Log retLog = new Log();
444
	    if(pidFilter != null && !pidFilter.equals("")) {
445
	        String serviceFailure = "1490";
446
	        String notFound = "1020";
447
	        Identifier pid = new Identifier();
448
	        pid.setValue(pidFilter);
449
	        try {
450
	            impl.checkV1SystemMetaPidExist(pid, serviceFailure, "The object for given PID "+pid.getValue()+" couldn't be identified if it exists",  notFound, 
451
	                    "The given PID: "+pid.getValue()+" doesn't exist in this node");
452
	        } catch (NotFound e) {
453
	            //return 0 record since the pid doesn't exist
454
	            logMetacat.info(e.getMessage());
455
	            return retLog;
456
	        }
457
	        
458
	    }
459
	   
443 460
	    String eventValue = null;
444 461
	    if(event != null) {
445 462
	        eventValue = event.xmlValue();
446 463
	    }
447 464
		org.dataone.service.types.v2.Log log = impl.getLogRecords(session, fromDate, toDate, eventValue, pidFilter, start, count);
448
		Log retLog = null;
465
		
449 466
		try {
450 467
			retLog = TypeMarshaller.convertTypeFromType(log, Log.class);
451 468
		} catch (Exception e) {

Also available in: Unified diff